-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #10107: Improve inline if
constant condition detraction and reporting
#10114
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
inline if
inline if
constant condition detraction and reporting
inline if
constant condition detraction and reportinginline if
constant condition detraction and reporting
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.
Otherwise LGTM
errorTree(tree, em"""cannot reduce inline if | ||
| its condition ${tree.cond} | ||
| is not a constant value""") | ||
errorTree(tree, em"""Cannot reduce `inline if` with non constant value. |
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.
I think the old error message is clearer.
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.
The issue with the previous message is that the condition is printed in the middle of the message. That condition may be long or have several lines. Ideally we should have a message where the tree is printed last.
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.
Cannot reduce `inline if` because its condition is not a constant value:
$cond1
I keep meaning to see that Ralph Fiennes movie, "The Constant Gardener."
If we could use that title for a narrative about compilation, then we'd have the same problem as that other Fiennes movie, "The English Patient," whether to emphasize the adjective or the noun.
The suggested edit avoids "non constant" --> "non-constant" --> "inconstant" discussion.
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.
I used "Cannot reduce `inline if` because its condition is not a constant value: $cond"
.
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.
OK, I see the reasoning now.
Showing the reduced condition is much more useful than showing the original condition.
57dcc2c
to
af9cf43
Compare
Showing the reduced condition is much more useful than showing the original condition.