[Issue 2694] New: alias pure nothrow XXX; is not pure nothrow!

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 27 07:09:41 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2694

           Summary: alias pure nothrow XXX; is not pure nothrow!
           Product: D
           Version: 2.025
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: clugdbug at yahoo.com.au


But alias XXX pure nothrow; works!
----
pure nothrow {
  alias void function(int) A;   // A is pure nothrow
}

alias void function(int) pure nothrow  B; // B is pure nothrow
alias pure nothrow void function(int) C; // C is NOT pure nothrow!

void main()
{
    A a = null;
    B b = null;
    C c = null;
    a = b; // ok
    a = c; // fails!
}
---
bug.d(15): Error: cannot implicitly convert expression (c) of type void
function
(int) to void function(int) pure nothrow
---
If you take away the aliases, and use variables A, B, C instead, it works. So
it's a problem with 'alias'.


-- 



More information about the Digitalmars-d-bugs mailing list