You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[error] ./inference.scala:7:7
[error] No given instance of type Box[T & U] was found for parameter x$2 of method f
[error] f(c)
[error] ^
Note that the implicit Box[T] is only used to showcase a compilation failure. The real problem is that when calling f from g, the type parameters get inferred as f[T & U, T & U] as can be seen after the typer phase:
Compiler version
Scala 3.3.0
Minimized code
Output
Note that the implicit
Box[T]
is only used to showcase a compilation failure. The real problem is that when callingf
fromg
, the type parameters get inferred asf[T & U, T & U]
as can be seen after the typer phase:Expectation
The first type parameter should be inferred as
T
and thus the code should compile.The text was updated successfully, but these errors were encountered: