diff options
Diffstat (limited to 'tests/ui/associated-types/issue-24159.rs')
-rw-r--r-- | tests/ui/associated-types/issue-24159.rs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/ui/associated-types/issue-24159.rs b/tests/ui/associated-types/issue-24159.rs new file mode 100644 index 000000000..49753e7bf --- /dev/null +++ b/tests/ui/associated-types/issue-24159.rs @@ -0,0 +1,37 @@ +// check-pass + +#![allow(unused)] + +trait Bar<T> { + fn dummy(&self); +} + +trait Foo { + type A; + type B: Bar<Self::A>; + + fn get_b(&self) -> &Self::B; +} + +fn test_bar<A, B: Bar<A>>(_: &B) {} + +fn test<A, F: Foo<A = A>>(f: &F) { + test_bar(f.get_b()); +} + +trait Bar1<T> {} +trait Caz1 { + type A; + type B: Bar1<Self::A>; +} + +fn test1<T, U>() where T: Caz1, U: Caz1<A = T::A> {} + +trait Bar2<T> {} +trait Caz2 { + type A; + type B: Bar2<Self::A>; +} +fn test2<T: Caz2<A = ()>>() {} + +fn main() {} |