summaryrefslogtreecommitdiff
path: root/test/files/pos/t4914.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos/t4914.scala')
-rw-r--r--test/files/pos/t4914.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/files/pos/t4914.scala b/test/files/pos/t4914.scala
new file mode 100644
index 0000000000..a6c8ef5a4e
--- /dev/null
+++ b/test/files/pos/t4914.scala
@@ -0,0 +1,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]()
+}