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 21538,20904: Correct implicitConvTo order for delegate parameters in Type.covariant
#13267
Conversation
Thanks for your pull request and interest in making D better, @MoonlightSentinel! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
|
Should this target stable? |
The overriding functions assumed stricter qualifiers (`@safe` / `scope`) for the callback that are not guaranteed by the definition in `Throwable`. The bug was hidden by [this issue](https://issues.dlang.org/show_bug.cgi?id=21538), see dlang/dmd#13267.
The overriding functions assumed stricter qualifiers (`@safe` / `scope`) for the callback that are not guaranteed by the definition in `Throwable`. The bug was hidden by [this issue](https://issues.dlang.org/show_bug.cgi?id=21538), see dlang/dmd#13267.
It can't without dropping the unit tests, since it builds on top of: #13238, which was already merged in master. |
The overriding functions assumed stricter qualifiers (`@safe` / `scope`) for the callback that are not guaranteed by the definition in `Throwable`. The bug was hidden by [this issue](https://issues.dlang.org/show_bug.cgi?id=21538), see dlang/dmd#13267.
Probably
Could also cherry-pick the commit in this PR |
The overriding functions assumed stricter qualifiers (`@safe` / `scope`) for the callback that are not guaranteed by the definition in `Throwable`. The bug was hidden by [this issue](https://issues.dlang.org/show_bug.cgi?id=21538), see dlang/dmd#13267.
Even though this a type system bug fix, it's also technically a breaking change, so I suggest master to be on the safe side. |
f196f87
to
853e333
Compare
... in `Type.covariant` The ordering was inversed when compared to function pointers. That caused the check to accept e.g. less restrictive attributes for callbacks. Also changed the equality checks for `TypeFuntion` and `TypeDelegate` to `equals` because `==` didn't call the former and hence caused problems for duplicate instances.
853e333
to
f81a1cc
Compare
However it was found in industry codebases. Possibly caused a regression. https://issues.dlang.org/show_bug.cgi?id=23274 Though it should be thought carefully about whether the code broken in xtest46.d was indeed wrong in the first place. |
This pull request introduced a regression: Possibly the same issue as the one above. |
The ordering was inversed when compared to function pointers. That caused
the check to accept e.g. less restrictive attributes for callbacks.
Also changed the equality checks for
TypeFuntion
andTypeDelegate
to
equals
because==
didn't call the former and hence caused problemsfor duplicate instances.
Preliminary check whether this affects projects on BuildKite as this breaks a test case inrunnable/xtest46.d
(which is an accept-invalid when usingdelegate
parameters and already rejected for function pointers).The test case in
runnable/xtest46.d
was not found in any project on Buildkite