Skip to content

Commit fd36aa2

Browse files
authored
Merge pull request scala#5300 from milessabin/topic/si-4914
SI-4914 Addition of tests resolves as fixed
2 parents 7102f64 + ce262e4 commit fd36aa2

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

test/files/pos/t482.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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+
}

test/files/pos/t4914.scala

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
}

0 commit comments

Comments
 (0)