Regression: Unrepresentable invalid type inferred in implicit search with a HKT type lambda using a library type and ignoring some of its arguments, when variance is used on HKT parameters #15888
Labels
Milestone
Compiler version
3.1.3
Minimized code
Scastie: https://scastie.scala-lang.org/pz6QIrsKQqe6qrdZDeSLvg
Using
-Ykind-projector
Output
However, searching for the implicit with the quoted type immediately works:
implicitly[example.Panic2[([E, A] =>> zio.ZIO[Any, E, A])]]
, as does giving explicit type argument to foldMapThe bug only surfaces with inference with 2 specific conditions: Variance annotations on
Interpreter
and typex.ZIO
must inherit another traittrait ZIOVersionSpecific[-R, +E, +A]
Expectation
Expected to work, as in Scala 2 https://scastie.scala-lang.org/jdr2LjLzT3e9eaztflgzSQ
This code is a minimized version of real library code in https://github.com/izumi/izumi which we're trying to port to Scala 3
The text was updated successfully, but these errors were encountered: