-
Notifications
You must be signed in to change notification settings - Fork 58
feat(validation): Assignment suggestions for =
operator
#1049
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
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1049 +/- ##
==========================================
+ Coverage 95.72% 95.74% +0.01%
==========================================
Files 153 153
Lines 42883 42875 -8
==========================================
- Hits 41051 41049 -2
+ Misses 1832 1826 -6 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did these tests change? Nothing in the commit affects codegen/debugging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a type-hint onto the condition of control statements does because we then enter the cast_if_needed
here afaik
Ok(cast_if_needed!(self, target_type, actual_type, v, self.annotations.get(expression))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess is because the condition expressions now receive a type-hint, we hit the cast_if_needed call in generate_expression were previously we returned the value as-is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to add some additional context, this issue will go away once we implement #1041
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds a validation to identify binary expressions using the
=
operator with no effects. For example the following statementfoo = bar;
does nothing and the user probably meant to use a:=
here, i.e.foo := bar;
.Resolves #939