| 1 |
// PERMUTE_ARGS: |
| 2 |
// REQUIRED_ARGS: -preview=dip1008 |
| 3 |
|
| 4 |
int bar() |
| 5 |
{ |
| 6 |
try |
| 7 |
{ |
| 8 |
throw new Exception("message"); |
| 9 |
} |
| 10 |
catch (Exception e) |
| 11 |
{ |
| 12 |
return 7; |
| 13 |
} |
| 14 |
} |
| 15 |
|
| 16 |
void throwQualifiers() @safe @nogc pure |
| 17 |
{ |
| 18 |
throw new Exception("baz"); |
| 19 |
} |
| 20 |
|
| 21 |
bool testThrowQualifiers() |
| 22 |
{ |
| 23 |
try |
| 24 |
{ |
| 25 |
throwQualifiers(); |
| 26 |
} catch (Exception e) |
| 27 |
{ |
| 28 |
return true; |
| 29 |
} |
| 30 |
|
| 31 |
return false; |
| 32 |
} |
| 33 |
|
| 34 |
void foo() |
| 35 |
{ |
| 36 |
enum r = bar(); |
| 37 |
static assert(r == 7); |
| 38 |
|
| 39 |
static assert(testThrowQualifiers()); |
| 40 |
} |