vyperlang / vyper

Pythonic Smart Contract Language for the EVM
https://vyperlang.org
Other
4.91k stars 802 forks source link

fix[lang]: use folded node for typechecking #4365

Closed tserg closed 2 days ago

tserg commented 6 days ago

What I did

Fix #4190, #4360.

How I did it

Use the reduced node for typechecking.

How to verify it

See added tests

Commit message

This commit addresses several issues in the frontend where valid code
fails to compile because typechecking was performed on non-literal
AST nodes, specifically in `slice()` and `raw_log()` builtins. This is
fixed by using the folded node for typechecking instead.

Additionally, folding is applied for the argument to `convert()`, which
results in the typechecker being able to reject more invalid programs.

Description for the changelog

Fix compilation for valid syntax with foldable values

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

codecov[bot] commented 6 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.81%. Comparing base (f38b61a) to head (7f86961). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4365 +/- ## ========================================== - Coverage 90.99% 88.81% -2.18% ========================================== Files 112 112 Lines 16017 16018 +1 Branches 2696 2696 ========================================== - Hits 14574 14226 -348 - Misses 1005 1281 +276 - Partials 438 511 +73 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: