mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00

This preserves the `CatAssignExp` in the AST until the glue layer where an error is printed in case this expression is used with `-betterC`. This is required to happen in the glue layer as the semantic analysis doesn't correctly distinguish when code needs to be generated. Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
14 lines
288 B
D
14 lines
288 B
D
// https://issues.dlang.org/show_bug.cgi?id=24159
|
|
// REQUIRED_ARGS: -betterC
|
|
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/test24159.d(13): Error: appending to array in `x ~= 3` requires the GC which is not available with -betterC
|
|
---
|
|
*/
|
|
|
|
extern(C) void main()
|
|
{
|
|
int[] x = null;
|
|
x ~= 3;
|
|
}
|