[Issue 1816] New: Parameter names not visible in return type in function declarations

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 4 23:04:26 PST 2008


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

           Summary: Parameter names not visible in return type in function
                    declarations
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: andrei at metalanguage.com


The following code should compile:

typeof(a) identity(T)(T a) { return a; }

void main()
{
    auto x = identity(1);
}

In this case it's trivial to replace typeof(a) with T, but in the general case
(e.g. mixins, complex expressions) it is necessary to access parameter names in
complex expressions inside typeof().


-- 



More information about the Digitalmars-d-bugs mailing list