-
Notifications
You must be signed in to change notification settings - Fork 844
Fix #5768, Corrected wrong formatted print of a trait member constraint. #5948
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 #5768, Corrected wrong formatted print of a trait member constraint. #5948
Conversation
Corrected wrong formatted print of a trait member constraint Signed-off-by: realvictorprm <mueller.vpr@gmail.com>
|
@cartermp I won't the neat command "@dotnetbot please test this" back 😭 Closing isn't nice. |
|
CI passes. This is ready. |
|
Can we add the example in #5768 as a test case to make sure we don't regress? |
|
I'll have a look how I can add it. |
dsyme
left a comment
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.
Needs test, otherwise approved
Signed-off-by: realvictorprm <mueller.vpr@gmail.com>
Signed-off-by: realvictorprm <mueller.vpr@gmail.com>
|
Regression test added. |
dsyme
left a comment
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 fix is fine. The testing could be simpler I believe
Signed-off-by: realvictorprm <mueller.vpr@gmail.com>
|
@dsyme I've changed it, please have a short look over it. |
|
CI passes, can this be merged? |
|
approved, please resolve conflict and we can merge |
|
done |
|
Ergh, looks like there were some build issues preventing this from getting merged and the codebase has diverged since. Sorry about that. @realvictorprm are you still interested in pursuing this? In theory it should be easy to adjust the tests and just copy the contents of this branch's |
|
Thanks! Will close in favor of #9728 |
The bug was not that the constraint is ignored. It was that the compiler printed the suggested trait constraint wrongly.
As example, the signature
a * b -> (c -> d)isn't the same asa * b -> c -> dbecause the return type differs (in case one it's(c -> d), in case two it'sd). The compiler however didn't respect that behaviour and prints constraints of case 1 always like case 2 which is wrong. The fix was to enforce that trait constraint return type is always wrapped in brackets if the return type is a function.@dsyme please have a look whether this assumption is fine? It's a short thing only about formatting.
Signed-off-by: realvictorprm mueller.vpr@gmail.com