Open
Description
Compiler version
3.4.0-RC1
Minimized code
sealed trait Tagged[T]
sealed trait Row[A]
def run[R, A](tagged: Tagged[R & Row[A]], a: A): Tagged[R] = new Tagged[R] {}
/*
order of rows in type annotation affect either y or z compilation;
if changed to Tagged[Row[String] & Row[Int]] y fails to compile while z is not
*/
val x: Tagged[Row[Int] & Row[String]] = new Tagged[Row[Int] & Row[String]] {}
val y = run(x, 1) // compiles OK
val z = run(x, "s") // error
Output
Found: ("s" : String)
Required: Int
Expectation
I expect that order of types in an intersection type doesn't affect type inference.