Skip to content

Raise on not-types when type checking#2118

Merged
fubuloubu merged 2 commits into
vyperlang:masterfrom
iamdefinitelyahuman:fix-type-checking
Jul 26, 2020
Merged

Raise on not-types when type checking#2118
fubuloubu merged 2 commits into
vyperlang:masterfrom
iamdefinitelyahuman:fix-type-checking

Conversation

@iamdefinitelyahuman

Copy link
Copy Markdown
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.

2 participants