File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ object Test {
2
+ class Foo { val z = " foo" ; val y : z.type = z }
3
+
4
+ val x : ({ val y : z.type } forSome { val z : String }) = new Foo
5
+
6
+ val x2 : ({ val y : T } forSome { type T <: String with Singleton }) = new Foo
7
+ }
Original file line number Diff line number Diff line change
1
+ trait Type {
2
+ type S
3
+ }
4
+
5
+ class ConcreteType extends Type {
6
+ type S = Double
7
+ }
8
+
9
+ trait Base {
10
+ type T <: Type
11
+ val m : Map [t# S , t# S ] forSome { type t <: T with Singleton }
12
+ val n : Map [x.type # S , x.type # S ] forSome { val x : T }
13
+ }
14
+
15
+ abstract class Derived extends Base {
16
+ override type T = ConcreteType
17
+ override val m = Map [Double , Double ]()
18
+ /** This does not work. §3.2.10 indicates that types n is shorthand for type of m. */
19
+ override val n = Map [Double , Double ]()
20
+ }
You can’t perform that action at this time.
0 commit comments