Closed
Description
object Test {
type F[N <: 0 | 1] = N
def fl[N <: 0 | 1]: F[N] = ???
}
-- [E057] Type Mismatch Error: /test.scala:3:24
3 | def fl[N <: 0 | 1]: F[N] = ???
| ^
|Type argument N does not conform to upper bound (0 : scala.Int) | (1 : scala.Int)
==> isSubType N <:< (0 : scala.Int) | (1 : scala.Int) ?
==> isSubType N <:< scala.Nothing ?
==> isSubType (0 : scala.Int) | (1 : scala.Int) <:< scala.Nothing LoApprox?
==> isSubType scala.Int <:< scala.Nothing LoApprox?
<== isSubType scala.Int <:< scala.Nothing LoApprox = false
==> isSubType (0 : scala.Int) <:< scala.Nothing LoApprox?
==> isSubType scala.Int <:< scala.Nothing LoApprox?
<== isSubType scala.Int <:< scala.Nothing LoApprox = false
<== isSubType (0 : scala.Int) <:< scala.Nothing LoApprox = false
<== isSubType (0 : scala.Int) | (1 : scala.Int) <:< scala.Nothing LoApprox = false
<== isSubType N <:< scala.Nothing = false
<== isSubType N <:< (0 : scala.Int) | (1 : scala.Int) = false
(I tought this was related to #8126, but it's something else)