[Issue 9547] New: typeof() which requires .init must be properly documented

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 19 20:46:49 PST 2013


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

           Summary: typeof() which requires .init must be properly
                    documented
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: regression
          Priority: P2
         Component: websites
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-02-19 20:46:48 PST ---
import std.range;

void getArray(T)()
{
    alias ElementType!T ElemType1;  // OK
    alias typeof(T[0]) ElemType2;   // NG
}

void main()
{
    getArray!(string[])();
}

This worked in 2.061, and broke LuaD in 2.062. The workaround (or rather the
new valid code) is:

alias typeof(T.init[0]) ElemType;

However this change *must* be clearly documented in the changelog, and the
requirement should be part of the documentation somewhere.

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


More information about the Digitalmars-d-bugs mailing list