Bug 12392 – No attribute inference if first template instantiation uses `alias`
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-17T08:08:00Z
Last change time
2014-03-17T13:47:19Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg
Comments
Comment #0 by verylonglogin.reg — 2014-03-17T08:08:38Z
This code should compile:
---
void f(T)() { }
alias fa = f;
void main() nothrow
{ fa!int(); }
---
main.d(5): Error: 'main.fa!int.f' is not nothrow
main.d(4): Error: function 'D main' is nothrow yet may throw
---
Same errors for `@safe` and `pure` attributes.
This is major as the behaviour is completely unexpected as e.g. `__traits(compiles, fa!int)` before `f!int()` call changes `f`'s signature.