aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/i262-null-subtyping.scala
blob: 284be49e8520692942841263347c2100a0807efb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
object O {
  // This compiles
  val a: { type T } = null;
  val b: Any { type T } = null;

  // This doesn't:
  // found   : Null
  // required: AnyRef{T}
  val c: AnyRef { type T } = null;

  class A
  class B

  val d: A & B = null
  val e: A | B = null

  val f: (A & B) { def toString: String } = null
  val g: (A | B) { def toString: String } = null
}