File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
toolchain/check/testdata/impl Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 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
1755library "[[@TEST_NAME]]" ;
File renamed without changes.
You can’t perform that action at this time.
0 commit comments