gcc/testsuite/gdc.test/compilable/test11847.d
raw| 1 | // REQUIRED_ARGS: -Icompilable/imports |
| 2 | // EXTRA_FILES: imports/pkg11847/mod11847.d imports/pkg11847/package.d |
| 3 | import pkg11847; |
| 4 | import pkg11847.mod11847; |
| 5 | |
| 6 | void main() { |
| 7 | static assert(pkg11847.func() == 1); |
| 8 | static assert(pkg11847.mod11847.func() == 2); |
| 9 | |
| 10 | // This correctly won't compile. |
| 11 | // Error: pkg11847.mod11847.func at imports/pkg11847/mod11847.d(3) conflicts with pkg11847.func at imports/pkg11847/package.d(3) |
| 12 | static assert(!__traits(compiles, func())); |
| 13 | |
| 14 | } |