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.
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
Whoops, forgot to use -o- https://github.com/D-Programming-Language/dmd/pull/2791
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`