Bug 9562 – Built-in runtime properties should become error with `Type.prop`

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-21T18:40:00Z
Last change time
2013-11-23T18:38:05Z
Keywords
accepts-invalid, diagnostic, pull
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2013-02-21T18:40:42Z
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.
Comment #1 by yebblies — 2013-11-16T21:46:05Z
Fails now: testx.d(9): Error: type int[1] is not an expression testx.d(10): Error: type int[1] is not an expression testx.d(11): Error: type int[1] is not an expression testx.d(12): Error: type int[1] is not an expression testx.d(9): Error: type char[1] is not an expression testx.d(10): Error: type char[1] is not an expression testx.d(11): Error: type char[1] is not an expression testx.d(12): Error: type char[1] is not an expression testx.d(8): Error: type int[] is not an expression testx.d(9): Error: type int[] is not an expression testx.d(10): Error: type int[] is not an expression testx.d(11): Error: type int[] is not an expression testx.d(12): Error: type int[] is not an expression testx.d(8): Error: type char[] is not an expression testx.d(9): Error: type char[] is not an expression testx.d(10): Error: type char[] is not an expression testx.d(11): Error: type char[] is not an expression testx.d(12): Error: type char[] is not an expression
Comment #2 by yebblies — 2013-11-16T22:03:32Z
Comment #3 by github-bugzilla — 2013-11-23T10:38:23Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ea886613dc5ba9c638b524ae89d32073753a0bfa Fix Issue 9562 - Built-in runtime properties should become error with `Type.prop` https://github.com/D-Programming-Language/dmd/commit/5cae978da230222f54e67f4690d6b246685fd9f1 Merge pull request #2791 from yebblies/issue9562 Issue 9562 - Built-in runtime properties should become error with `Type.prop`