| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/diag4596.d(15): Error: cannot modify expression `this` because it is not an lvalue |
| 5 |
fail_compilation/diag4596.d(16): Error: conditional expression `1 ? this : this` is not a modifiable lvalue |
| 6 |
fail_compilation/diag4596.d(18): Error: cannot modify expression `super` because it is not an lvalue |
| 7 |
fail_compilation/diag4596.d(19): Error: conditional expression `1 ? super : super` is not a modifiable lvalue |
| 8 |
--- |
| 9 |
*/ |
| 10 |
|
| 11 |
class NoGo4596 |
| 12 |
{ |
| 13 |
void fun() |
| 14 |
{ |
| 15 |
this = new NoGo4596; |
| 16 |
(1?this:this) = new NoGo4596; |
| 17 |
|
| 18 |
super = new Object; |
| 19 |
(1?super:super) = new Object; |
| 20 |
} |
| 21 |
} |