There is an unnecessary error for empty array literals when -betterC is enabled. ``` extern(C) void main() { int[] x = []; int[] y = (cast(int*) null)[0 .. 0]; } ``` Compile with `dmd a.d -betterC` and it outputs: ``` a.d(2): Error: `TypeInfo` cannot be used with -betterC ``` Since the expression `(cast(int*) null)[0 .. 0]` works, DMD should be able to translate `[]` into it without needing TypeInfo.
@dkorpel created dlang/dmd pull request #14004 "Fix issue 22922 - Support empty array literal in -betterC" fixing this issue: - Fix issue 22922 - Support empty array literal in -betterC https://github.com/dlang/dmd/pull/14004
dlang/dmd pull request #14004 "Fix issue 22922 - Support empty array literal in -betterC" was merged into master: - eff4ab3fecdcc4596b0f300e519d27778d38434e by Dennis Korpel: Fix issue 22922 - Support empty array literal in -betterC https://github.com/dlang/dmd/pull/14004
*** Issue 5788 has been marked as a duplicate of this issue. ***