-
-
Notifications
You must be signed in to change notification settings - Fork 806
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat[lang]: add
module.__at__()
to cast to interface (#4090)
add `module.__at__`, a new `MemberFunctionT`, which allows the user to cast addresses to a module's interface. additionally, fix a bug where interfaces defined inline could not be exported. this is simultaneously fixed as a related bug because previously, interfaces could come up in export analysis as `InterfaceT` or `TYPE_T` depending on their provenance. this commit fixes the bug by making them `TYPE_T` in both imported and inlined provenance. this also allows `module.__interface__` to be used in export position by adding it to `ModuleT`'s members. note this has an unwanted side effect of allowing `module.__interface__` in call position; in other words, `module.__interface__(<address>)` has the same behavior as `module.__at__(<address>)` when use as an expression. this can be addressed in a later refactor. refactor: - wrap interfaces in `TYPE_T` - streamline an `isinstance(t, (VyperType, TYPE_T))` check. TYPE_T` now inherits from `VyperType`, so it doesn't need to be listed separately --------- Co-authored-by: cyberthirst <[email protected]>
- Loading branch information
1 parent
8f433f8
commit f249c93
Showing
16 changed files
with
431 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.