gcc/testsuite/gdc.test/fail_compilation/fail187.d
raw| 1 | // REQUIRED_ARGS: -d |
| 2 | /* |
| 3 | TEST_OUTPUT: |
| 4 | --- |
| 5 | fail_compilation/fail187.d(16): Error: `catch` at fail_compilation/fail187.d(20) hides `catch` at fail_compilation/fail187.d(24) |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | // On DMD 2.000 bug only with typedef, not alias |
| 10 | |
| 11 | alias Exception A; |
| 12 | alias Exception B; |
| 13 | |
| 14 | void main() |
| 15 | { |
| 16 | try |
| 17 | { |
| 18 | throw new A("test"); |
| 19 | } |
| 20 | catch (B) |
| 21 | { |
| 22 | // this shouldn't happen, but does |
| 23 | } |
| 24 | catch (A) |
| 25 | { |
| 26 | // this ought to happen? |
| 27 | } |
| 28 | } |