diff --git a/tests/neg/i6779.check b/tests/neg/i6779.check new file mode 100644 index 000000000000..07c3473349d2 --- /dev/null +++ b/tests/neg/i6779.check @@ -0,0 +1,15 @@ +-- [E007] Type Mismatch Error: tests/neg/i6779.scala:9:30 -------------------------------------------------------------- +9 |def g1[T](x: T): F[G[T]] = x.f(given summon[Stuff]) // error + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | Found: F[T] + | Required: F[G[T]] +-- [E007] Type Mismatch Error: tests/neg/i6779.scala:11:27 ------------------------------------------------------------- +11 |def g2[T](x: T): F[G[T]] = x.f // error + | ^ + | Found: F[T] + | Required: F[G[T]] +-- [E007] Type Mismatch Error: tests/neg/i6779.scala:13:31 ------------------------------------------------------------- +13 |def g3[T](x: T): F[G[T]] = f(x)(given summon[Stuff]) // error + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | Found: F[T] + | Required: F[G[T]] diff --git a/tests/neg/i6779.scala b/tests/neg/i6779.scala new file mode 100644 index 000000000000..5a24e0763317 --- /dev/null +++ b/tests/neg/i6779.scala @@ -0,0 +1,13 @@ +type F[T] +type G[T] +type Stuff +given Stuff = ??? + +def (x: T) f[T](given Stuff): F[T] = ??? + + +def g1[T](x: T): F[G[T]] = x.f(given summon[Stuff]) // error + +def g2[T](x: T): F[G[T]] = x.f // error + +def g3[T](x: T): F[G[T]] = f(x)(given summon[Stuff]) // error