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.
Comment #1 by k.hara.pg — 2014-03-17T08:47:26Z
Comment #2 by github-bugzilla — 2014-03-17T13:47:10Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/b2d7d57db9a8fa1a4a8ccd8e0858d3ddce0feabd fix Issue 12392 - No attribute inference if first template instantiation uses `alias` https://github.com/D-Programming-Language/dmd/commit/a2dee1195f94c0f3e78752c7352c569f65c2be8e Merge pull request #3386 from 9rnsr/fix12392 Issue 12392 - No attribute inference if first template instantiation uses `alias`