aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/pos/infersingle.scala
diff options
context:
space:
mode:
authorSamuel Gruetter <samuel.gruetter@epfl.ch>2014-12-16 16:38:09 +0100
committerSamuel Gruetter <samuel.gruetter@epfl.ch>2014-12-16 16:38:09 +0100
commit42851ed2675015d42bb341b82a09bd0bef4a8ce4 (patch)
tree06806b4183cf74a43553e9a8a9acfeff84fdf712 /tests/pending/pos/infersingle.scala
parent5be609fc4e04e3cca5e1435ee41b8cacac9b0513 (diff)
downloaddotty-42851ed2675015d42bb341b82a09bd0bef4a8ce4.tar.gz
dotty-42851ed2675015d42bb341b82a09bd0bef4a8ce4.tar.bz2
dotty-42851ed2675015d42bb341b82a09bd0bef4a8ce4.zip
move failing tests from tests/untried/pos to tests/pending/pos
Diffstat (limited to 'tests/pending/pos/infersingle.scala')
-rw-r--r--tests/pending/pos/infersingle.scala52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/pending/pos/infersingle.scala b/tests/pending/pos/infersingle.scala
new file mode 100644
index 000000000..60f4ff07e
--- /dev/null
+++ b/tests/pending/pos/infersingle.scala
@@ -0,0 +1,52 @@
+object Test1 {
+ def one[T](x: T): Option[T] = Some(x)
+ val x = "one"
+ val y: Option[x.type] = one(x)
+}
+
+object Test2 {
+ // Has never worked, but seems desirable given the recent changes to
+ // pattern type inference.
+ val a = ""
+ object Id {
+ def unapply(xxxx: Any): Some[a.type] = Some[a.type](a)
+ }
+ val b: a.type = (a: a.type) match {
+ case Id(x) => x
+ }
+}
+
+object Test3 {
+ val a = ""
+ object Id {
+ def unapply(xxxx: Any): Some[Test3.type] = Some[Test3.type](Test3)
+ }
+ val b: Test3.type = a match {
+ case Id(x) => x
+ }
+}
+
+class Test4 {
+ val a = ""
+ object Id {
+ def unapply(xxxx: Any): Some[Test4.this.type] = Some[Test4.this.type](Test4.this)
+ }
+ val b: Test4.this.type = a match {
+ case Id(x) => x
+ }
+}
+
+class Super5 {
+ final val q = ""
+ def q1: q.type = q
+}
+
+class Test5 extends Super5 {
+ val a = ""
+ object Id {
+ def unapply(xxxx: Any): Some[Test5.super.q.type] = Some[Test5.super.q.type](q1)
+ }
+ val b: Test5.super.q.type = a match {
+ case Id(x) => x
+ }
+}