diff options
author | Adriaan Moors <adriaan@lightbend.com> | 2016-07-26 11:13:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-26 11:13:27 -0700 |
commit | fd36aa2a3af4e0f39557798e93c23f4ea673880d (patch) | |
tree | 999b4db5168136d263e501c634d3cf792989bcb0 /test | |
parent | 7102f643a9670e7c1b12a23375eba27e4359d0a0 (diff) | |
parent | ce262e45141db642c2d5c7e4c7427f84fd08f854 (diff) | |
download | scala-fd36aa2a3af4e0f39557798e93c23f4ea673880d.tar.gz scala-fd36aa2a3af4e0f39557798e93c23f4ea673880d.tar.bz2 scala-fd36aa2a3af4e0f39557798e93c23f4ea673880d.zip |
Merge pull request #5300 from milessabin/topic/si-4914
SI-4914 Addition of tests resolves as fixed
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t482.scala | 7 | ||||
-rw-r--r-- | test/files/pos/t4914.scala | 20 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test/files/pos/t482.scala b/test/files/pos/t482.scala new file mode 100644 index 0000000000..b121c93337 --- /dev/null +++ b/test/files/pos/t482.scala @@ -0,0 +1,7 @@ +object Test { + class Foo { val z = "foo"; val y : z.type = z } + + val x : ({ val y : z.type } forSome { val z : String }) = new Foo + + val x2 : ({ val y : T } forSome { type T <: String with Singleton }) = new Foo +} 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]() +} |