diff options
author | Martin Odersky <odersky@gmail.com> | 2009-08-18 17:24:36 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-08-18 17:24:36 +0000 |
commit | ec18f148e8afc4101878cd8b05eadac92d26b64c (patch) | |
tree | 7602e12f0a5cab24fea2f73d91a794fbde52bf5b /test | |
parent | 6b5b635f095e29b37fa30487c5a1cf5804107795 (diff) | |
download | scala-ec18f148e8afc4101878cd8b05eadac92d26b64c.tar.gz scala-ec18f148e8afc4101878cd8b05eadac92d26b64c.tar.bz2 scala-ec18f148e8afc4101878cd8b05eadac92d26b64c.zip |
Fixed memory leaks for streams.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/jvm/manifests.check | 34 | ||||
-rw-r--r-- | test/files/neg/bug882.check | 2 | ||||
-rw-r--r-- | test/files/neg/t1701.check | 4 | ||||
-rwxr-xr-x | test/files/neg/t1701.scala | 1 | ||||
-rwxr-xr-x | test/files/pos/exbound.scala | 7 | ||||
-rwxr-xr-x | test/files/pos/implicits.scala | 32 | ||||
-rwxr-xr-x | test/files/pos/t1614/bar.scala | 4 | ||||
-rwxr-xr-x | test/files/pos/t1614/foo.scala | 12 |
8 files changed, 78 insertions, 18 deletions
diff --git a/test/files/jvm/manifests.check b/test/files/jvm/manifests.check index f8ef5b203c..5a11ef3926 100644 --- a/test/files/jvm/manifests.check +++ b/test/files/jvm/manifests.check @@ -1,35 +1,35 @@ -x=(), m=void -x=true, m=boolean -x=a, m=char -x=1, m=int +x=(), m=Unit +x=true, m=Boolean +x=a, m=Char +x=1, m=Int x=abc, m=java.lang.String x='abc, m=scala.Symbol -x=List(()), m=scala.collection.immutable.List[void] -x=List(true), m=scala.collection.immutable.List[boolean] -x=List(1), m=scala.collection.immutable.List[int] +x=List(()), m=scala.collection.immutable.List[Unit] +x=List(true), m=scala.collection.immutable.List[Boolean] +x=List(1), m=scala.collection.immutable.List[Int] x=List(abc), m=scala.collection.immutable.List[java.lang.String] x=List('abc), m=scala.collection.immutable.List[scala.Symbol] -x=[Z, m=Array[boolean] -x=[C, m=Array[char] -x=[I, m=Array[int] +x=[Z, m=Array[Boolean] +x=[C, m=Array[Char] +x=[I, m=Array[Int] x=Array(abc), m=Array[java.lang.String] x=Array('abc), m=Array[scala.Symbol] -x=((),()), m=scala.Tuple2[void, void] -x=(true,false), m=scala.Tuple2[boolean, boolean] -x=(1,2), m=scala.Tuple2[int, int] +x=((),()), m=scala.Tuple2[Unit, Unit] +x=(true,false), m=scala.Tuple2[Boolean, Boolean] +x=(1,2), m=scala.Tuple2[Int, Int] x=(abc,xyz), m=scala.Tuple2[java.lang.String, java.lang.String] x=('abc,'xyz), m=scala.Tuple2[scala.Symbol, scala.Symbol] x=Test$, m=Test$ x=scala.collection.immutable.List$, m=scala.collection.immutable.List$ -x=Foo, m=Foo[int] -x=Foo, m=Foo[scala.collection.immutable.List[int]] -x=Foo, m=Foo[Foo[int]] -x=Foo, m=Foo[scala.collection.immutable.List[Foo[int]]] +x=Foo, m=Foo[Int] +x=Foo, m=Foo[scala.collection.immutable.List[Int]] +x=Foo, m=Foo[Foo[Int]] +x=Foo, m=Foo[scala.collection.immutable.List[Foo[Int]]] x=Test1$$anon$1, m=Test1$$anon$1 diff --git a/test/files/neg/bug882.check b/test/files/neg/bug882.check index 52245eb3b7..8f47fefd9b 100644 --- a/test/files/neg/bug882.check +++ b/test/files/neg/bug882.check @@ -1,4 +1,4 @@ -bug882.scala:2: error: traits cannot have type parameters with <% bounds +bug882.scala:2: error: traits cannot have type parameters with context bounds `: ...' trait SortedSet[A <% Ordered[A]] { ^ one error found diff --git a/test/files/neg/t1701.check b/test/files/neg/t1701.check new file mode 100644 index 0000000000..782b690bf0 --- /dev/null +++ b/test/files/neg/t1701.check @@ -0,0 +1,4 @@ +t1701.scala:1: error: java.lang.Cloneable does not take type parameters +class A extends java.lang.Cloneable[String, Option, Int] + ^ +one error found diff --git a/test/files/neg/t1701.scala b/test/files/neg/t1701.scala new file mode 100755 index 0000000000..7cd6ff9953 --- /dev/null +++ b/test/files/neg/t1701.scala @@ -0,0 +1 @@ +class A extends java.lang.Cloneable[String, Option, Int] diff --git a/test/files/pos/exbound.scala b/test/files/pos/exbound.scala new file mode 100755 index 0000000000..243d5832ce --- /dev/null +++ b/test/files/pos/exbound.scala @@ -0,0 +1,7 @@ +class A[T <: A[T]] { + +} + +object Test { + val x: A[X] forSome { type X } = null +} diff --git a/test/files/pos/implicits.scala b/test/files/pos/implicits.scala new file mode 100755 index 0000000000..88632850fa --- /dev/null +++ b/test/files/pos/implicits.scala @@ -0,0 +1,32 @@ +// #1579 +object Test1579 { + class Column + class Query[E](val value: E) + class Invoker(q: Any) { val foo = null } + + implicit def unwrap[C](q: Query[C]) = q.value + implicit def invoker(q: Query[Column]) = new Invoker(q) + + val q = new Query(new Column) + q.foo +} +// #1625 +object Test1625 { + + class Wrapped(x:Any) { + def unwrap() = x + } + + implicit def byName[A](x: =>A) = new Wrapped(x) + + implicit def byVal[A](x: A) = x + + def main(args: Array[String]) = { + +// val res:Wrapped = 7 // works + + val res = 7.unwrap() // doesn't work + + println("=> result: " + res) + } +} diff --git a/test/files/pos/t1614/bar.scala b/test/files/pos/t1614/bar.scala new file mode 100755 index 0000000000..be994c3af3 --- /dev/null +++ b/test/files/pos/t1614/bar.scala @@ -0,0 +1,4 @@ +// bar.scala +object Bar { + val a = new FooImpl with AbstractOverrideFoo +} diff --git a/test/files/pos/t1614/foo.scala b/test/files/pos/t1614/foo.scala new file mode 100755 index 0000000000..e6cc41bafd --- /dev/null +++ b/test/files/pos/t1614/foo.scala @@ -0,0 +1,12 @@ +// foo.scala +trait Foo { + def foo(arg: List[_]) +} +trait FooImpl extends Foo { + def foo(arg: List[_]) {} +} +trait AbstractOverrideFoo extends Foo { + abstract override def foo(arg: List[_]) { + super.foo(arg) + } +} |