scala3 icon indicating copy to clipboard operation
scala3 copied to clipboard

Unexpected tuple inferred from dependent typing as an error

Open soronpo opened this issue 3 years ago • 0 comments

Compiler version

v3.2.0-RC2

Minimized code

https://scastie.scala-lang.org/xebUkPLdQUKL9V8Q4Kdyhg

class Box[T]
def dep1[T1 <: Singleton, T2 <: T1](t1: T1)(t2: T2): Box[T1] = ???
val d1 = dep1(1)(2) //error

Output

Found:    Box[(1 : Int) | (2 : Int)]
Required: Box[((1 : Int) | (2 : Int))]

Expectation

Type mismatch for t2.

soronpo avatar Aug 03 '22 05:08 soronpo