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

fix: type checking in for loops #2096

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

  • Fix a bug in the type checker preventing proper checks during for loops. This wasn't a critical issue, as any failure is still caught in parser.
  • Improve how exception messages are handled during a failed type check in a for loop

How I did it

  • The main issue was from an improperly indented return. Ooops.
  • For the exception message, I'm tracking every exception raised during the iterative check. At the end, if they're all the same exception, I raise it instead of the more generic "could not determine type for i".

How to verify it

Run tests.

Cute Animal Picture

image

for type_ in type_list:
# type check the fdor loop body using each possible type for iterator value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fdor lol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fnord

@iamdefinitelyahuman iamdefinitelyahuman force-pushed the fix-type-checking-for-loops branch from c7c479e to b18438b Compare July 5, 2020 15:20
@iamdefinitelyahuman iamdefinitelyahuman merged commit 0e6141a into vyperlang:master Jul 5, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the fix-type-checking-for-loops branch July 5, 2020 16:37
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