View mode: basic / threaded / horizontal-split · Log in · Help
February 22, 2013
[Issue 9562] New: Built-in runtime properties should become error with `Type.prop`
http://d.puremagic.com/issues/show_bug.cgi?id=9562

          Summary: Built-in runtime properties should become error with
                   `Type.prop`
          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: -------
Top | Discussion index | About this forum | D home