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[lang]: use folded node for typechecking #4365

Merged
merged 12 commits into from
Nov 23, 2024

Conversation

tserg
Copy link
Collaborator

@tserg tserg commented Nov 20, 2024

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-->

Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@tserg tserg changed the title fix(lang): use folded node for typechecking fix[lang]: use folded node for typechecking Nov 20, 2024
@tserg tserg marked this pull request as ready for review November 20, 2024 06:57
@tserg tserg requested a review from charles-cooper November 20, 2024 06:57
@charles-cooper charles-cooper removed their request for review November 20, 2024 09:37
@tserg tserg requested a review from charles-cooper November 20, 2024 14:45
Copy link
Member

@charles-cooper charles-cooper left a comment

Choose a reason for hiding this comment

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

add another test for conversion of invalid bytestrings

@tserg tserg requested a review from charles-cooper November 21, 2024 03:56
Co-authored-by: Charles Cooper <cooper.charles.m@gmail.com>
Copy link
Member

@charles-cooper charles-cooper left a comment

Choose a reason for hiding this comment

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

lgtm. @cyberthirst is there anything you want to see here?

@charles-cooper charles-cooper enabled auto-merge (squash) November 23, 2024 20:26
@charles-cooper charles-cooper merged commit bd876b1 into vyperlang:master Nov 23, 2024
157 of 158 checks passed
@tserg tserg deleted the fix/slice_folded branch November 24, 2024 03:30
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.

Folding Not Supported in Certain Locations
3 participants