Closed
Description
There are a couple of ways of demonstrating this. The following does not produce a type error when it should:
def foo: 1 | 2 = 1
def bar: 3 | 4 = foo
whereas this does (correctly):
def foo: 1 | 2 = 1
def bar: 1 = foo
Intersection types do, however, appear to work correctly. This produces the expected type error:
trait X {
def foo: 1 & 2
def bar: 2 & 3 = foo
}