Open
Description
Compiler version
3.5.0-RC1
Minimized code
inline def foo[I <: Int](i: I): ZeroOne[I] = i match
case _: 0 => 0
case _ => 1
// Wrapping the return value and type somehow inhibits proper match type reduction
inline def bar[I <: Int](i: I): W[ZeroOne[I]] = i match
case _: 0 => W(0)
case _ => W(1)
class W[S <: Int & Singleton](s: S)
type ZeroOne[I <: Int] <: Int = I match
case 0 => 0
case _ => 1
Compiler Output
Found: W[(0 : Int)]
Required: W[ZeroOne[I]]
Expectation
No compile-error.