aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/pos
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-03-20 10:07:24 +0100
committerTobias Schlatter <tobias@meisch.ch>2014-03-21 11:28:30 +0100
commit07939c96715cd5adf7f220d239f61b73dd00edc3 (patch)
treede23b24f90ffc32bcbf6a22447cf93a5521abbd5 /tests/pending/pos
parent7e1343e86a0d2575d596198d0f889b7d64cdb5a4 (diff)
downloaddotty-07939c96715cd5adf7f220d239f61b73dd00edc3.tar.gz
dotty-07939c96715cd5adf7f220d239f61b73dd00edc3.tar.bz2
dotty-07939c96715cd5adf7f220d239f61b73dd00edc3.zip
Fix of t1279a: baseTypeWithArgs
baseTypeWithArgs now also keeps track of refinements in the subtypes. Without that, the approximated lub in t1279a is too coarse and the program fails to typecheck.
Diffstat (limited to 'tests/pending/pos')
-rw-r--r--tests/pending/pos/t1279a.scala39
1 files changed, 0 insertions, 39 deletions
diff --git a/tests/pending/pos/t1279a.scala b/tests/pending/pos/t1279a.scala
deleted file mode 100644
index 18b1e53f4..000000000
--- a/tests/pending/pos/t1279a.scala
+++ /dev/null
@@ -1,39 +0,0 @@
-// covariant linked list
-abstract class M {
- self =>
-
- type T
- final type selfType = M {type T <: self.T}
- type actualSelfType >: self.type <: selfType
-
- def next: selfType
-
- // I don't understand why this doesn't compile, but that's a separate matter
- // error: method all2 cannot be accessed in M.this.selfType
- // because its instance type => Stream[M{type T <: M.this.selfType#T}]
- // contains a malformed type: M.this.selfType#T
- def all2: Stream[M {type T <: self.T}] = Stream.cons(self: actualSelfType, next.all2)
-
- // compiles successfully
- def all3: Stream[M {type T <: self.T}] = all3Impl(self: actualSelfType)
- private def all3Impl(first: M {type T <: self.T}): Stream[M {type T <: self.T}] = Stream.cons(first, all3Impl(first.next))
-
- def all4: Stream[M {type T <: self.T}] = Unrelated.all4Impl[T](self: actualSelfType)
-}
-
-// TODO!!! fix this bug for real, it compiles successfully, but weird types are inferred
-object Unrelated {
- // compiles successfully
- def all4Impl[U](first: M {type T <: U}): Stream[M {type T <: U}] = Stream.cons(first, all4Impl[U](first.next))
-
- // should compile successfully without the [U], but:
- // def all4ImplFail[U](first: M {type T <: U}): Stream[M {type T <: U}] = Stream.cons(first, all4ImplFail(first.next))
- //
- // test/files/pos/t1279a.scala:31: error: type mismatch;
- // found : first.selfType
- // (which expands to) M{type T <: first.T}
- // required: M{type T <: Nothing}
- // def all4ImplFail[U](first: M {type T <: U}): Stream[M {type T <: U}] = Stream.cons(first, all4ImplFail(first.next))
- // ^
- // one error found
-}