[Issue 15743] New: typeof function literal with unnamed parameter of aliased type is void
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Wed Mar  2 05:59:52 PST 2016
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15743
          Issue ID: 15743
           Summary: typeof function literal with unnamed parameter of
                    aliased type is void
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ryan at rcorre.net
alias T = int;
pragma(msg, typeof((string){}).stringof);   // void
pragma(msg, typeof((string s){}).stringof); // void function(string)
pragma(msg, typeof((int){}).stringof);      // void function(int)
pragma(msg, typeof((T){}).stringof);        // void
I would expect the first pragma to print void function(string), and the last to
print void function(int).
It appears the issue is with a parameter that has no name _and_ is declared as
an aliased type (e.g. if you use immutable(char)* instead of string it works as
expected).
--
    
    
More information about the Digitalmars-d-bugs
mailing list