dmd/compiler/test/fail_compilation/bug18743.d
2022-07-09 18:53:07 +02:00

22 lines
418 B
D

// REQUIRED_ARGS:
/*
TEST_OUTPUT:
---
fail_compilation/bug18743.d(18): Error: `a ? a = 4 : a` must be surrounded by parentheses when next to operator `=`
fail_compilation/bug18743.d(19): Error: `a ? --a : a` must be surrounded by parentheses when next to operator `+=`
---
*/
void main()
{
int a;
// ok
(a ? a = 4 : a) = 5;
a ? a = 4 : (a = 5);
a ? a = 4 : a = 5;
a ? --a : a += 1;
a ? a = 4 : a++; // ok
}