Repository navigation
ConstantAttributeAnalyzer: inspect and report tuple conversions #999
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -275,6 +275,12 @@ string untrusted | |
| { Types.ConstantStruct v = trusted; } | ||
| { Types.ConstantStruct v = /* NonConstantPassedToConstantParameter(value) */ variable /**/; } | ||
| { Types.ConstantStruct v = /* NonConstantPassedToConstantParameter(value) */ untrusted /**/; } | ||
| { (Types.ConstantStruct X, Types.ConstantStruct Y) v = (Constants.String, Constants.String); } | ||
| { (Types.ConstantStruct X, Types.ConstantStruct Y) v = (Constants.String, trusted); } | ||
| { (Types.ConstantStruct X, Types.ConstantStruct Y) v = (Constants.String, /* NonConstantPassedToConstantParameter(value) */ variable /**/); } | ||
| { (Types.ConstantStruct X, Types.ConstantStruct Y) v = (Constants.String, /* NonConstantPassedToConstantParameter(value) */ untrusted /**/); } | ||
|
Comment on lines
+278
to
+281
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These already worked, just adding the tests for it |
||
| { (Types.ConstantStruct X, Types.ConstantStruct Y) v = /* NonConstantPassedToConstantParameter(value) */ true ? (Constants.String, Constants.String) : (Constants.String, Constants.String) /**/; } | ||
| { (Types.ConstantStruct X, Types.ConstantStruct Y) v = /* NonConstantPassedToConstantParameter(value) */ true ? (Constants.String, variable) : (Constants.String, Constants.String) /**/; } | ||
|
Comment on lines
+282
to
+283
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally the former of these two would work, but would require special-casing the ternarys etc. etc. (we similarly don't special case switch expressions or anything)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Either of these cases previously fell into |
||
| { | ||
| Types.ConstantStruct v = Constants.String; | ||
| v += /* NonConstantPassedToConstantParameter(value) */ "abc" /**/; | ||
|
|
||
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.
Basically moved to check constant operands first, and anything after that is deciding if the conversion was to something with a
[Constant]parameter that we should raise a diagnostic for