summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/compilable/test11847.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gdc.test/compilable/test11847.d')
-rw-r--r--gcc/testsuite/gdc.test/compilable/test11847.d14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gdc.test/compilable/test11847.d b/gcc/testsuite/gdc.test/compilable/test11847.d
new file mode 100644
index 00000000000..d07d9954b06
--- /dev/null
+++ b/gcc/testsuite/gdc.test/compilable/test11847.d
@@ -0,0 +1,14 @@
+// REQUIRED_ARGS: -Icompilable/imports
+// EXTRA_FILES: imports/pkg11847/mod11847.d imports/pkg11847/package.d
+import pkg11847;
+import pkg11847.mod11847;
+
+void main() {
+ static assert(pkg11847.func() == 1);
+ static assert(pkg11847.mod11847.func() == 2);
+
+ // This correctly won't compile.
+ // Error: pkg11847.mod11847.func at imports/pkg11847/mod11847.d(3) conflicts with pkg11847.func at imports/pkg11847/package.d(3)
+ static assert(!__traits(compiles, func()));
+
+}