summaryrefslogtreecommitdiff
path: root/test/files/pos/t4914.scala
blob: a6c8ef5a4e22fdb5735f653efadab52f6d4a7797 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
trait Type {
  type S
}

class ConcreteType extends Type {
  type S = Double
}

trait Base {
  type T <: Type
  val m: Map[t#S, t#S] forSome { type t <: T with Singleton }
  val n: Map[x.type#S, x.type#S] forSome { val x: T }
}

abstract class Derived extends Base {
  override type T = ConcreteType
  override val m = Map[Double, Double]()
  /** This does not work. §3.2.10 indicates that types n is shorthand for type of m. */
  override val n = Map[Double, Double]()
}