Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise on not-types when type checking #2118

Merged
merged 2 commits into from
Jul 26, 2020

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

When type checking, raise immediately if a non-type value is encountered (e.g. a type primitive or uncalled builtin function)

How I did it

in vyper/context/validation/utils.py, add a kwarg only_definitions to _ExprTypeChecker.get_exact_type_from_node and _ExprTypeChecker.get_possible_types_from_node. if True and any values aren't definitions, raise InvalidReference.

How to verify it

Run the tests.

Cute Animal Picture

image

@fubuloubu fubuloubu merged commit 0de88b7 into vyperlang:master Jul 26, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the fix-type-checking branch July 26, 2020 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants