aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/run
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-25 22:03:01 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-26 18:12:11 +0200
commit4b48243a24e533ba81149df956fdc16cdaf1460e (patch)
treeca1794cd908fa93259fa081e68f43682ed2fb4da /tests/pending/run
parent5e6a9a28241ea8c64617bf90f9c331a352409035 (diff)
downloaddotty-4b48243a24e533ba81149df956fdc16cdaf1460e.tar.gz
dotty-4b48243a24e533ba81149df956fdc16cdaf1460e.tar.bz2
dotty-4b48243a24e533ba81149df956fdc16cdaf1460e.zip
Fix erasure of Thistypes.
Thistypes erased to the underlying class. This is wrong. When seen as part of some other type, a ThisType has to erase to the erasure of the underlying type (i.e. the erasure if the selftype of the class). unittest-collections.scala failed with a MethodNotFound error because the erasure was computed incorrectly. On the other hand, a tree with a ThisType type, should keep the type, analogous to a tree with a TermRef type.
Diffstat (limited to 'tests/pending/run')
-rw-r--r--tests/pending/run/unittest_collection.check1
-rw-r--r--tests/pending/run/unittest_collection.scala58
2 files changed, 0 insertions, 59 deletions
diff --git a/tests/pending/run/unittest_collection.check b/tests/pending/run/unittest_collection.check
deleted file mode 100644
index df1629dd7..000000000
--- a/tests/pending/run/unittest_collection.check
+++ /dev/null
@@ -1 +0,0 @@
-warning: there was one deprecation warning; re-run with -deprecation for details
diff --git a/tests/pending/run/unittest_collection.scala b/tests/pending/run/unittest_collection.scala
deleted file mode 100644
index d10845475..000000000
--- a/tests/pending/run/unittest_collection.scala
+++ /dev/null
@@ -1,58 +0,0 @@
-object Test {
-
- import scala.collection.mutable.{ArrayBuffer, Buffer, BufferProxy, ListBuffer}
-
- def main(args: Array[String]): Unit = {
- test(collection.mutable.ArrayBuffer[String]())
- test(collection.mutable.ListBuffer[String]())
- class BBuf(z:ListBuffer[String]) extends BufferProxy[String] {
- def self = z
- }
- test(new BBuf(collection.mutable.ListBuffer[String]()))
- }
-
- def test(x: Buffer[String]): Unit = {
- // testing method +=
- x += "one"
- assert(x(0) == "one", "retrieving 'one'")
- assert(x.length == 1, "length A")
- x += "two"
- assert(x(1) == "two", "retrieving 'two'")
- assert(x.length == 2, "length B")
-
- // testing method -= (removing last element)
- x -= "two"
-
- assert(x.length == 1, "length C")
-
- try { x(1); sys.error("no exception for removed element") }
- catch { case i:IndexOutOfBoundsException => }
-
- try { x.remove(1); sys.error("no exception for removed element") }
- catch { case i:IndexOutOfBoundsException => }
-
- x += "two2"
- assert(x.length == 2, "length D")
-
- // removing first element
- x.remove(0)
- assert(x.length == 1, "length E")
-
- // toList
- assert(x.toList == List("two2"), "toList")
-
- // clear
- x.clear()
- assert(x.length == 0, "length 0")
- assert(x.isEmpty, "isEmpty")
-
- // copyToBuffer
- x += "a"
- x += "b"
- val dest = new ArrayBuffer[String]
- x.copyToBuffer(dest)
- assert(List("a", "b") == dest.toList, "dest")
- assert(List("a", "b") == x.toList, "source")
- }
-
-}