-
-
Notifications
You must be signed in to change notification settings - Fork 610
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(dsymbolsem): override methods should have semantic logic on attributes #14166
Conversation
|
Thanks for your pull request, @ljmf00! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#14166" |
…butes Fix issue 23138. Signed-off-by: Luís Ferreira <contact@lsferreira.net>
|
Just cross referencing this with #12934 to remind myself to implement this for new |
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.
What about other attributes?
I can't think of other conflicts here. |
|
My expectation is that if you override a method and you do not specifically add any attributes, then it should be considered that you are trying to lower the restrictions. For example: class A
{
void fun() pure @nogc @safe nothrow {}
}
class B
{
override void fun() {}
}I think it is surprising that the compiler simply thinks that To be clear. I think that in my above example, |
I think you missed I thought the other way around though, since for me I see it as: the default attributes are applied and fetched from override, then the explicit ones try to override the default signature. Specification-wise, I don't think we have this explicit, but if someone can point me out, would be cool. Even though, I believe that proposal will bring a breaking change. This change already behaves in pair with the function body semantics so no breaking change. In practice, this fails faster or fails when the function body doesn't have something contrary to specified in the base attributes, which will make the function body semantics more complete. |
|
Ok, sure, my comment should block the addition of this PR. If more people agree with me we can fix this in subsequent PRs. |
Fix issue 23138.
Signed-off-by: Luís Ferreira contact@lsferreira.net