mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 13:01:04 +01:00
Use match_first to make the impl_recurse_with_simpler_type_in_generic_param_bidirectional_no_cycle.carbon test pass again (#7712)
This commit is contained in:
+4
-17
@@ -246,7 +246,7 @@ fn F() {
|
||||
({} as Wraps(C)) as (Wraps(C) as ComparableTo(Wraps(D)));
|
||||
}
|
||||
|
||||
// --- fail_todo_impl_recurse_with_simpler_type_in_generic_param_bidirectional_no_cycle.carbon
|
||||
// --- impl_recurse_with_simpler_type_in_generic_param_bidirectional_no_cycle.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// Implement this for a type in one direction.
|
||||
@@ -262,30 +262,17 @@ class D {}
|
||||
// - D is ComparableWith(C).
|
||||
impl C as ComparableTo(D) {}
|
||||
|
||||
// TODO: These three `impl`s need to be placed in a match_first as they
|
||||
// overlap.
|
||||
match_first {
|
||||
|
||||
// T is always ComparableWith(T).
|
||||
impl forall [T: type] T as ComparableWith(T) {}
|
||||
// If U is ComparableTo(T), U is ComparableWith(T).
|
||||
// CHECK:STDERR: fail_todo_impl_recurse_with_simpler_type_in_generic_param_bidirectional_no_cycle.carbon:[[@LINE+7]]:1: error: found non-final `impl` with the same type structure as another non-final `impl` [ImplNonFinalSameTypeStructure]
|
||||
// CHECK:STDERR: impl forall [T: type, U: ComparableTo(T)] U as ComparableWith(T) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_impl_recurse_with_simpler_type_in_generic_param_bidirectional_no_cycle.carbon:[[@LINE-5]]:1: note: other `impl` here [ImplNonFinalSameTypeStructureNote]
|
||||
// CHECK:STDERR: impl forall [T: type] T as ComparableWith(T) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
impl forall [T: type, U: ComparableTo(T)] U as ComparableWith(T) {}
|
||||
// If U is ComparableTo(T), T is ComparableWith(U).
|
||||
// CHECK:STDERR: fail_todo_impl_recurse_with_simpler_type_in_generic_param_bidirectional_no_cycle.carbon:[[@LINE+7]]:1: error: found non-final `impl` with the same type structure as another non-final `impl` [ImplNonFinalSameTypeStructure]
|
||||
// CHECK:STDERR: impl forall [T: type, U: ComparableTo(T)] T as ComparableWith(U) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_impl_recurse_with_simpler_type_in_generic_param_bidirectional_no_cycle.carbon:[[@LINE-14]]:1: note: other `impl` here [ImplNonFinalSameTypeStructureNote]
|
||||
// CHECK:STDERR: impl forall [T: type] T as ComparableWith(T) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
impl forall [T: type, U: ComparableTo(T)] T as ComparableWith(U) {}
|
||||
|
||||
}
|
||||
|
||||
fn Compare[T: type, U: ComparableWith(T)](unused t: T, unused u: U) {}
|
||||
|
||||
fn F() {
|
||||
|
||||
Reference in New Issue
Block a user