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`

          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

--- Comment #0 from Kenji Hara <> 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:
------- You are receiving this mail because: -------
Top | Discussion index | About this forum | D home