Skip to content

Commit 68a33ab

Browse files
committed
Add extra interface to demonstrate import InterfaceId comparison mismatch
1 parent 304d205 commit 68a33ab

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

toolchain/check/testdata/impl/lookup/impl_overlap.carbon

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ interface Z(T:! type) {}
2222
// --- interface_z_with_impl.carbon
2323
library "[[@TEST_NAME]]";
2424

25+
interface Other(T:! type) {}
26+
2527
interface Z(T:! type) {}
2628

2729
final impl forall [T:! type] T as Z(T) {}
@@ -172,14 +174,6 @@ class C;
172174
// Can't write a final impl in both the interface's file and the root self
173175
// type's file (when they are different files).
174176
//
175-
// CHECK:STDERR: fail_final_impl_with_both_interface_and_self_but_different_files.carbon:[[@LINE+8]]:1: error: `final impl` overlaps with `final impl` from another file [FinalImplOverlapsDifferentFile]
176-
// CHECK:STDERR: final impl C as Z(()) {}
177-
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
178-
// CHECK:STDERR: fail_final_impl_with_both_interface_and_self_but_different_files.carbon:[[@LINE-10]]:1: in import [InImport]
179-
// CHECK:STDERR: interface_z_with_impl.carbon:5:1: note: imported `final impl` here [FinalImplOverlapsDifferentFileNote]
180-
// CHECK:STDERR: final impl forall [T:! type] T as Z(T) {}
181-
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
182-
// CHECK:STDERR:
183177
final impl C as Z(()) {}
184178

185179
// --- fail_final_overlaps_final_from_other_file.carbon
@@ -192,14 +186,6 @@ class C;
192186
// This final impl is overlapped by a final impl in the interface file, and you
193187
// can't write a final impl in two different files.
194188
//
195-
// CHECK:STDERR: fail_final_overlaps_final_from_other_file.carbon:[[@LINE+8]]:1: error: `final impl` overlaps with `final impl` from another file [FinalImplOverlapsDifferentFile]
196-
// CHECK:STDERR: final impl C as Z(C) {}
197-
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
198-
// CHECK:STDERR: fail_final_overlaps_final_from_other_file.carbon:[[@LINE-10]]:1: in import [InImport]
199-
// CHECK:STDERR: interface_z_with_impl.carbon:5:1: note: imported `final impl` here [FinalImplOverlapsDifferentFileNote]
200-
// CHECK:STDERR: final impl forall [T:! type] T as Z(T) {}
201-
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
202-
// CHECK:STDERR:
203189
final impl C as Z(C) {}
204190

205191
// --- fail_final_overlaps_non_final_from_other_file.carbon
@@ -211,14 +197,6 @@ class C;
211197

212198
// This non-final impl is subsumed by a final impl in the interface file.
213199
//
214-
// CHECK:STDERR: fail_final_overlaps_non_final_from_other_file.carbon:[[@LINE+8]]:1: error: `impl` will never be used [ImplFinalOverlapsNonFinal]
215-
// CHECK:STDERR: impl C as Z(C) {}
216-
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
217-
// CHECK:STDERR: fail_final_overlaps_non_final_from_other_file.carbon:[[@LINE-9]]:1: in import [InImport]
218-
// CHECK:STDERR: interface_z_with_impl.carbon:5:1: note: `final impl` declared here would always be used instead [ImplFinalOverlapsNonFinalNote]
219-
// CHECK:STDERR: final impl forall [T:! type] T as Z(T) {}
220-
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
221-
// CHECK:STDERR:
222200
impl C as Z(C) {}
223201

224202
// --- fail_final_different_file_from_self_and_interface.carbon

0 commit comments

Comments
 (0)