summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/type-alias-impl-trait/issue-57807-associated-type.rs')
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-57807-associated-type.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.rs b/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.rs
new file mode 100644
index 000000000..fcab2c7db
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.rs
@@ -0,0 +1,31 @@
+// Regression test for issue #57807 - ensure
+// that we properly unify associated types within
+// a type alias impl trait
+// check-pass
+#![feature(type_alias_impl_trait)]
+
+trait Bar {
+ type A;
+}
+
+impl Bar for () {
+ type A = ();
+}
+
+trait Foo {
+ type A;
+ type B: Bar<A = Self::A>;
+
+ fn foo() -> Self::B;
+}
+
+impl Foo for () {
+ type A = ();
+ type B = impl Bar<A = Self::A>;
+
+ fn foo() -> Self::B {
+ ()
+ }
+}
+
+fn main() {}