| 1 |
/* |
| 2 |
REQUIRED_ARGS: -verrors=context |
| 3 |
TEST_OUTPUT: |
| 4 |
--- |
| 5 |
fail_compilation/fail_pretty_errors.d(29): Error: undefined identifier `a` |
| 6 |
a = 1; |
| 7 |
^ |
| 8 |
fail_compilation/fail_pretty_errors.d-mixin-34(34): Error: undefined identifier `b` |
| 9 |
b = 1; |
| 10 |
^ |
| 11 |
fail_compilation/fail_pretty_errors.d(39): Error: cannot implicitly convert expression `5` of type `int` to `string` |
| 12 |
string x = 5; |
| 13 |
^ |
| 14 |
fail_compilation/fail_pretty_errors.d(44): Error: mixin `fail_pretty_errors.testMixin2.mixinTemplate!()` error instantiating |
| 15 |
mixin mixinTemplate; |
| 16 |
^ |
| 17 |
fail_compilation/fail_pretty_errors.d(50): Error: invalid array operation `"" + ""` (possible missing []) |
| 18 |
auto x = ""+""; |
| 19 |
^ |
| 20 |
fail_compilation/fail_pretty_errors.d(50): did you mean to concatenate (`"" ~ ""`) instead ? |
| 21 |
fail_compilation/fail_pretty_errors.d(53): Error: cannot implicitly convert expression `1111` of type `int` to `byte` |
| 22 |
byte ɑ = 1111; |
| 23 |
^ |
| 24 |
--- |
| 25 |
*/ |
| 26 |
|
| 27 |
void foo() |
| 28 |
{ |
| 29 |
a = 1; |
| 30 |
} |
| 31 |
|
| 32 |
void testMixin1() |
| 33 |
{ |
| 34 |
mixin("b = 1;"); |
| 35 |
} |
| 36 |
|
| 37 |
mixin template mixinTemplate() |
| 38 |
{ |
| 39 |
string x = 5; |
| 40 |
} |
| 41 |
|
| 42 |
void testMixin2() |
| 43 |
{ |
| 44 |
mixin mixinTemplate; |
| 45 |
} |
| 46 |
|
| 47 |
void f() |
| 48 |
{ |
| 49 |
// check supplemental error doesn't show context |
| 50 |
auto x = ""+""; |
| 51 |
|
| 52 |
// Check correct spacing with the presence of unicode characters and tabs |
| 53 |
byte ɑ = 1111; |
| 54 |
} |