-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Issue 10329 - Attributes not inferred for indirectly templated methods #2832
Conversation
| @@ -1803,7 +1802,7 @@ void FuncDeclaration::semantic3(Scope *sc) | |||
| f->deco = NULL; | |||
|
|
|||
| // Do semantic type AFTER pure/nothrow inference. | |||
| if (!f->deco) | |||
| if (!f->deco && ident != Lexer::idPool("__xopEquals") && ident != Lexer::idPool("__xopCmp")) | |||
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 noticed in clone.c there's an idPool("_xopCmp") and idPool("__xopCmp"). I have no idea why there are two different identifiers. Also, having a third one suggests that it needs to be moved into idgen.c. Same for __xopEquals.
|
I moved two-underscore names The two functions |
Because `inTemplateInstance` is too similar to `isTemplateInstance`.
|
Auto-merge toggled on |
Issue 10329 - Attributes not inferred for indirectly templated methods
|
Thanks! |
|
Most awesome. |
https://d.puremagic.com/issues/show_bug.cgi?id=10329
This is the last step for the pure/@safe algorithms and ranges.
Except following two cases, all of instantiated function attributes will be inferred.
Virtual methods
Non-eponymous functions which declared in template scope
(I'm not still sure this is an essential restriction, but currently it's necessary to avoid bug 10134).
After merging this PR, for example, following code will be runnable with git-head Phobos.