Closed
Description
Compiler version
Scala compiler version 3.0.2 -- Copyright 2002-2021, LAMP/EPFL
Minimized code
trait F[A]
trait Z
object Z:
given F[Z] = ???
type Foo[B] = [A] =>> Bar[A, B]
trait Bar[A, B]
given [A: F]: Foo[Unit][A] = ???
// given [A: F]: Bar[A, Unit] = ???
def f[A: F](using Foo[Unit][A]): Nothing = ???
def broken: Nothing = f[Z]
Output
-- Error: bug.scala:14:26 ------------------------------------------------------
14 |def broken: Nothing = f[Z]
| ^
|no implicit argument of type Foo[Unit][Z] was found for parameter x$1 of method f.
|I found:
|
| given_Foo_Unit_A[A](/* missing */summon[F[?]])
|
|But no implicit values were found that match type F[?].
1 error found
Expectation
Should compile, just like it does after de-aliasing:
-given [A: F]: Foo[Unit][A] = ???
-// given [A: F]: Bar[A, Unit] = ???
+// given [A: F]: Foo[Unit][A] = ???
+given [A: F]: Bar[A, Unit] = ???