www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9562] New: Built-in runtime properties should become error with `Type.prop`


           Summary: Built-in runtime properties should become error with
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid, diagnostic
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com

--- Comment #0 from Kenji Hara <k.hara.pg gmail.com> 2013-02-21 18:40:42 PST ---
This code succeeds to compile with -o- switch.
It means that front-end allows such a meaningless expression, (int[]).length.

void main()
    foreach (A; TypeTuple!(int[1], char[1], int[], char[]))
        auto len  = A.length;
        auto rev  = A.reverse;
        auto sort = A.sort;
        auto dup  = A.dup;
        auto idup = A.idup;

Of course, the invalid expressions will fail code generation in glue layer, but
it is little late.

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