Skip to content

Commit 3939132

Browse files
committed
wip
1 parent a18bbae commit 3939132

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

toolchain/check/testdata/impl/import_generic.carbon

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,44 @@
1212
// TIP: To dump output, run:
1313
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/import_generic.carbon
1414

15+
// --- basic_import_generic_interface.carbon
16+
17+
library "[[@TEST_NAME]]";
18+
19+
interface I(T:! type) {}
20+
interface J(T:! type) {
21+
extend require impls I(T);
22+
}
23+
24+
// --- basic_import_generic_interface.impl.carbon
25+
26+
impl library "[[@TEST_NAME]]";
27+
28+
// CHECK:STDERR: fail_import_generic.impl.carbon:[[@LINE+4]]:1: error: redeclaration of imported impl [RedeclImportedImpl]
29+
// CHECK:STDERR: impl forall [T:! type] C as I(T);
30+
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31+
// CHECK:STDERR:
32+
impl {} as J({});
33+
34+
// --- basic_import_generic_constraint.carbon
35+
36+
library "[[@TEST_NAME]]";
37+
38+
interface I(T:! type) {}
39+
constraint J(T:! type) {
40+
extend require impls I(T);
41+
}
42+
43+
// --- basic_import_generic_constraint.impl.carbon
44+
45+
impl library "[[@TEST_NAME]]";
46+
47+
// CHECK:STDERR: fail_import_generic.impl.carbon:[[@LINE+4]]:1: error: redeclaration of imported impl [RedeclImportedImpl]
48+
// CHECK:STDERR: impl forall [T:! type] C as I(T);
49+
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50+
// CHECK:STDERR:
51+
impl {} as J({});
52+
1553
// --- import_generic.carbon
1654

1755
library "[[@TEST_NAME]]";

0 commit comments

Comments
 (0)