Open
Description
Compiler version
Tested with 3.0.2
and 3.1.0-RC2
Minimized code
https://github.com/vigoo/scala3-type-infer-bug
Contains a minimal example (the issue originally came up in a parser library under development) and two files from ZIO, Zippable
and Unzippable
as the issue seems to be related to these specific implicits.
Output
[error] 26 | val _ = assertSameType(xy2)
[error] | ^^^
[error] | Found: (Main.xy2 : Example[Int, (AnyVal, Int)])
[error] | Required: Example[T, T]
[error] |
[error] | where: T is a type variable
Expectation
The
val x = pure(1)
val y = pure(2)
val xy1 = x zip y
and
val xy2 = pure(1) zip pure(2)
should both be inferred to the same result, Example[(Int, Int), (Int, Int)]
.