[Issue 12392] New: No attribute inference if first template instantiation uses `alias`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 17 08:08:39 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12392

           Summary: No attribute inference if first template instantiation
                    uses `alias`
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2014-03-17 19:08:38 MSK ---
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.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list