summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t4515.check4
-rw-r--r--test/files/pos/t2613.scala11
-rw-r--r--test/files/pos/t5022.scala22
3 files changed, 35 insertions, 2 deletions
diff --git a/test/files/neg/t4515.check b/test/files/neg/t4515.check
index a60d16295f..64e7cc1ca7 100644
--- a/test/files/neg/t4515.check
+++ b/test/files/neg/t4515.check
@@ -1,6 +1,6 @@
t4515.scala:37: error: type mismatch;
- found : _0(in value $anonfun) where type _0(in value $anonfun)
- required: (some other)_0(in value $anonfun)
+ found : _$1 where type _$1
+ required: _$2
handler.onEvent(target, ctx.getEvent, node, ctx)
^
one error found
diff --git a/test/files/pos/t2613.scala b/test/files/pos/t2613.scala
new file mode 100644
index 0000000000..3a64dbc282
--- /dev/null
+++ b/test/files/pos/t2613.scala
@@ -0,0 +1,11 @@
+import language.existentials
+
+object Test {
+ class Row
+
+ abstract class MyRelation [R <: Row, +Relation <: MyRelation[R, Relation]]
+
+ type M = MyRelation[R, Relation] forSome {type R <: Row; type Relation <: MyRelation[R, Relation]}
+
+ var (x,y): (String, M) = null
+}
diff --git a/test/files/pos/t5022.scala b/test/files/pos/t5022.scala
new file mode 100644
index 0000000000..b9a085fb35
--- /dev/null
+++ b/test/files/pos/t5022.scala
@@ -0,0 +1,22 @@
+class ForSomeVsUnapply {
+ def test {
+ def makeWrap: Wrap = ???
+ def useRep[e](rep: (e, X[e])) = ()
+
+ val repUnapply = Wrap.unapply(makeWrap).get
+ useRep(repUnapply) // okay
+
+ val Wrap(rep0) = makeWrap
+ useRep(rep0) // error
+
+ val rep = makeWrap match {
+ case Wrap(r) => r
+ };
+
+ useRep(rep) // error
+ }
+}
+
+class X[e]
+
+case class Wrap(rep: (e, X[e]) forSome { type e })