Closed
Description
object Test {
def foo(x: 0 | 1) = ()
def bar: 0 | 1 = 0
foo(bar)
}
Fails with:
4 | foo(bar)
| ^^^
| Found: (Test.bar : => (0 : Int) | (1 : Int))
| Required: (0 : Int) | (1 : Int)
Here are the relevant part of the logs with trancing enabled, it looks like there might be a missing case missing in type comparer?:
==> isSubType (Test.bar : => (0 : Int) | (1 : Int)) <:< (0 : Int) | (1 : Int) ?
==> isSubType (Test.bar : => (0 : Int) | (1 : Int)) <:< Nothing ?
==> isSubType => (0 : Int) | (1 : Int) <:< Nothing LoApprox?
<== isSubType => (0 : Int) | (1 : Int) <:< Nothing LoApprox = false
<== isSubType (Test.bar : => (0 : Int) | (1 : Int)) <:< Nothing = false
<== isSubType (Test.bar : => (0 : Int) | (1 : Int)) <:< (0 : Int) | (1 : Int) = false