diff options
author | Antonio Cunei <antonio.cunei@epfl.ch> | 2011-03-24 16:33:53 +0000 |
---|---|---|
committer | Antonio Cunei <antonio.cunei@epfl.ch> | 2011-03-24 16:33:53 +0000 |
commit | 6c398fa52bfa7a0de1179d6657a8429c6d82e36e (patch) | |
tree | 1405a4c539f888bcf51f592e3c93bad8c17ea630 /test | |
parent | 26643c870b0308e903eb097cae8bae78180c0f4a (diff) | |
download | scala-6c398fa52bfa7a0de1179d6657a8429c6d82e36e.tar.gz scala-6c398fa52bfa7a0de1179d6657a8429c6d82e36e.tar.bz2 scala-6c398fa52bfa7a0de1179d6657a8429c6d82e36e.zip |
Merged revisions 24551-24564,24567 via svnmerge...
Merged revisions 24551-24564,24567 via svnmerge from
https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk
........
r24551 | odersky | 2011-03-23 16:31:04 +0100 (Wed, 23 Mar 2011) | 2 lines
Squashing the signature bugs. The trick is that mixed in methods are
declared as bridges. Review by extempore. ........ r24552 | odersky |
2011-03-23 16:33:58 +0100 (Wed, 23 Mar 2011) | 1 line
Simple test case to see whether Java understands mixed in signatures.
This should be extended with more cases. Review by extempore. ........
r24553 | odersky | 2011-03-23 19:32:39 +0100 (Wed, 23 Mar 2011) | 1 line
Moving signature tests to pending, because they operate under wrong
assumptions now that mixed in members are bridges. Review by extempore.
........ r24554 | odersky | 2011-03-23 22:44:13 +0100 (Wed, 23 Mar 2011)
| 1 line
Fixes #4298. Review by extempore.
........
r24555 | extempore | 2011-03-23 23:35:09 +0100 (Wed, 23 Mar 2011) | 2 lines
Spiced up the signature test infrastructure a bunch, wrote some more
tests, restored the tests in pending. No review. ........ r24556 |
extempore | 2011-03-24 02:10:26 +0100 (Thu, 24 Mar 2011) | 2 lines
Restoring my higher-kinded-Array signature check which martin
callously blew away while fixing all our other problems. Review by
odersky. ........ r24557 | extempore | 2011-03-24 03:35:22 +0100 (Thu,
24 Mar 2011) | 1 line
Looks like I accidentally committed a test log, no review. ........
r24558 | extempore | 2011-03-24 06:49:53 +0100 (Thu, 24 Mar 2011) | 2
lines
Discovered Range.foreach inlining was broken due to a Nothing
signature appearing and confusing the loader. No review. ........ r24559
| extempore | 2011-03-24 08:04:32 +0100 (Thu, 24 Mar 2011) | 3 lines
Removing empty directories the newly informative partest told me
about. No review. ........ r24560 | extempore | 2011-03-24 09:46:55
+0100 (Thu, 24 Mar 2011) | 2 lines
Changed App-using tests to use main() to see if that's our trouble. No
review. ........ r24561 | odersky | 2011-03-24 12:15:37 +0100 (Thu, 24
Mar 2011) | 1 line
Moved failing tests to pending after having diagnosed that the only
problem is a difference in output between Java 1.5 and 1.6 reflection
libraries. Can we moved back once that's fixed. For now, it's more
important to ghet the build back. ........ r24562 | phaller | 2011-03-24
15:09:18 +0100 (Thu, 24 Mar 2011) | 1 line
Deprecated unused members in scala.concurrent. Added documentation to
scala.concurrent.ops and scala.concurrent.FutureTaskRunner. ........
r24563 | phaller | 2011-03-24 15:19:35 +0100 (Thu, 24 Mar 2011) | 1 line
Added implicit TaskRunner parameters to scala.concurrent.ops.{par, replicate}. Review by prokopec.
........
r24564 | prokopec | 2011-03-24 16:00:41 +0100 (Thu, 24 Mar 2011) | 5 lines
Added a temporary fix for #4351, but disabled it because the extend
specialized class with nonspecialized type-parameters is used in the
stdlib already.
Disabling scala.parallel package, adding the currently disabled
scala.concurrent package which will be implemented in some of the next
releases.
Review by phaller.
........
r24567 | odersky | 2011-03-24 17:32:15 +0100 (Thu, 24 Mar 2011) | 1 line
Three things to make Eclipse more robust against deadlocks: (1)
catch stale responses in presentation compile thread. (2) Avoid stale
responses by two try-finallys in getEnteredParsed, askLoadedTyped.
........
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/hkarray.flags | 1 | ||||
-rw-r--r-- | test/files/pos/hkarray.scala | 5 | ||||
-rw-r--r-- | test/files/pos/javaReadsSigs/fromjava.java | 16 | ||||
-rw-r--r-- | test/files/pos/switchUnbox-pos.log | 2 | ||||
-rw-r--r-- | test/files/run/bug4291.check | 4 | ||||
-rw-r--r-- | test/files/run/bug4291.scala | 10 | ||||
-rw-r--r-- | test/files/run/sigtp.check | 7 | ||||
-rw-r--r-- | test/files/run/t3857.check | 2 | ||||
-rw-r--r-- | test/files/run/t3857.scala | 17 | ||||
-rw-r--r-- | test/files/run/testblock.scala | 33 | ||||
-rw-r--r-- | test/files/run/testpar.scala | 24 | ||||
-rw-r--r-- | test/files/specialized/td3651.check | 2 | ||||
-rw-r--r-- | test/files/specialized/td3651.scala | 19 | ||||
-rw-r--r-- | test/pending/run/bug4291.check | 87 | ||||
-rw-r--r-- | test/pending/run/bug4291.scala | 19 | ||||
-rw-r--r-- | test/pending/run/sigtp.check | 11 | ||||
-rw-r--r-- | test/pending/run/sigtp.scala (renamed from test/files/run/sigtp.scala) | 11 | ||||
-rw-r--r-- | test/pending/run/t3857.check | 11 | ||||
-rw-r--r-- | test/pending/run/t3857.scala | 13 |
19 files changed, 189 insertions, 105 deletions
diff --git a/test/files/pos/hkarray.flags b/test/files/pos/hkarray.flags new file mode 100644 index 0000000000..e8fb65d50c --- /dev/null +++ b/test/files/pos/hkarray.flags @@ -0,0 +1 @@ +-Xfatal-warnings
\ No newline at end of file diff --git a/test/files/pos/hkarray.scala b/test/files/pos/hkarray.scala new file mode 100644 index 0000000000..af1160300a --- /dev/null +++ b/test/files/pos/hkarray.scala @@ -0,0 +1,5 @@ +trait Foo[CC[_]] { } + +class Bip { + val x = new Foo[Array] { } +}
\ No newline at end of file diff --git a/test/files/pos/javaReadsSigs/fromjava.java b/test/files/pos/javaReadsSigs/fromjava.java new file mode 100644 index 0000000000..d31244bb95 --- /dev/null +++ b/test/files/pos/javaReadsSigs/fromjava.java @@ -0,0 +1,16 @@ +import scala.collection.immutable.Vector; +import scala.collection.immutable.List; + +public class fromjava { + + void main(String[] args, Vector<String> x) { + Vector<String> y = x.take(2); + String h = y.head(); + System.out.println(h); + } + void main(String[] args, List<String> x) { + List<String> y = x.drop(2); + String h = y.head(); + System.out.println(h); + } +}
\ No newline at end of file diff --git a/test/files/pos/switchUnbox-pos.log b/test/files/pos/switchUnbox-pos.log deleted file mode 100644 index 9c146726d7..0000000000 --- a/test/files/pos/switchUnbox-pos.log +++ /dev/null @@ -1,2 +0,0 @@ -partest error: bad flags: -Ysqueeze:on -one error found diff --git a/test/files/run/bug4291.check b/test/files/run/bug4291.check deleted file mode 100644 index c2b58db6e6..0000000000 --- a/test/files/run/bug4291.check +++ /dev/null @@ -1,4 +0,0 @@ -scala.collection.immutable.List A -scala.Option A -scala.Function1 R -scala.collection.Traversable That diff --git a/test/files/run/bug4291.scala b/test/files/run/bug4291.scala deleted file mode 100644 index 6053c7ac6a..0000000000 --- a/test/files/run/bug4291.scala +++ /dev/null @@ -1,10 +0,0 @@ -import scala.tools.partest._ - -object Test extends SigTest { - def main(args: Array[String]): Unit = { - show[List[_]]("apply") - show[Option[_]]("get") - show[Function1[_, _]]("apply") - show[Traversable[_]]("flatMap") - } -} diff --git a/test/files/run/sigtp.check b/test/files/run/sigtp.check deleted file mode 100644 index 6b961be3d0..0000000000 --- a/test/files/run/sigtp.check +++ /dev/null @@ -1,7 +0,0 @@ -public A Bug.key() -public Bug<A, B> Bug.foo() -public Bug<A, B> Bug.next() -public void Bug.next_$eq(Bug<A, B>) -public abstract A BugBase.key() -public abstract E BugBase.next() -public abstract void BugBase.next_$eq(E) diff --git a/test/files/run/t3857.check b/test/files/run/t3857.check deleted file mode 100644 index 45e9fb23a6..0000000000 --- a/test/files/run/t3857.check +++ /dev/null @@ -1,2 +0,0 @@ -private java.util.Set<java.lang.String> ScalaGeneric.s -private java.util.Set<java.lang.String> ScalaGeneric2.s diff --git a/test/files/run/t3857.scala b/test/files/run/t3857.scala deleted file mode 100644 index 0c8dc996ce..0000000000 --- a/test/files/run/t3857.scala +++ /dev/null @@ -1,17 +0,0 @@ -class ScalaGeneric { var s: java.util.Set[String] = _ } - -trait ScalaGeneric2Trait { var s: java.util.Set[String] = _ } -class ScalaGeneric2 extends ScalaGeneric2Trait - -object Test extends App { - println(classOf[ScalaGeneric].getDeclaredField("s").toGenericString) - // java.util.Set<java.lang.String> ScalaGeneric.s - - println(classOf[ScalaGeneric2].getDeclaredField("s").toGenericString) - // After r24319 this comment was: - // java.util.Set ScalaGeneric2.s -- no signature should be found because it was mixed in. - // - // Having reverted that with this commit, I note the original comment since - // the original signature is also back. - // java.util.Set ScalaGeneric2.s -- should be same as above -} diff --git a/test/files/run/testblock.scala b/test/files/run/testblock.scala deleted file mode 100644 index a334b668fd..0000000000 --- a/test/files/run/testblock.scala +++ /dev/null @@ -1,33 +0,0 @@ - - - - -import scala.parallel._ - - - - -object Test { - - def main(args: Array[String]) { - if (util.Properties.isJavaAtLeast("1.6")) { - val vendor = util.Properties.javaVmVendor - if ((vendor contains "Sun") || (vendor contains "Apple")) blockcomp(10) - } - } - - val lock = new java.util.concurrent.locks.ReentrantLock - - def blockcomp(n: Int): Unit = if (n > 0) { - val (x, y) = par(blockcomp(n - 1), blockcomp(n - 1)) - if (n == 8) blocking { // without this blocking block, deadlock occurs - lock.lock() - } - x() - y() - if (n == 8) { - lock.unlock() - } - } - -} diff --git a/test/files/run/testpar.scala b/test/files/run/testpar.scala deleted file mode 100644 index c4c813ee00..0000000000 --- a/test/files/run/testpar.scala +++ /dev/null @@ -1,24 +0,0 @@ - - - -import scala.parallel._ - - - - - -object Test { - - def main(args: Array[String]) { - if (util.Properties.isJavaAtLeast("1.6")) { - val vendor = util.Properties.javaVmVendor - if ((vendor contains "Sun") || (vendor contains "Apple")) assert(fib(40) == 102334155) - } - } - - def fib(n: Int): Int = if (n < 3) 1 else if (n < 35) fib(n - 1) + fib(n - 2) else { - val (p, pp) = par(fib(n - 1), fib(n - 2)) - p() + pp() - } - -} diff --git a/test/files/specialized/td3651.check b/test/files/specialized/td3651.check new file mode 100644 index 0000000000..9aea9e0ce5 --- /dev/null +++ b/test/files/specialized/td3651.check @@ -0,0 +1,2 @@ +0 +0
\ No newline at end of file diff --git a/test/files/specialized/td3651.scala b/test/files/specialized/td3651.scala new file mode 100644 index 0000000000..117710b6dc --- /dev/null +++ b/test/files/specialized/td3651.scala @@ -0,0 +1,19 @@ + + + + +class Base[@specialized(Double) A](val a: A) + +class Derived(override val a: Double) extends Base[Double](a) + +object Test { + def main(args: Array[String]) { + val b: Base[Double] = new Derived(10) + b.a + println(runtime.BoxesRunTime.doubleBoxCount) + + val der = new Derived(10) + der.a + println(runtime.BoxesRunTime.doubleBoxCount) + } +} diff --git a/test/pending/run/bug4291.check b/test/pending/run/bug4291.check new file mode 100644 index 0000000000..30bacfac28 --- /dev/null +++ b/test/pending/run/bug4291.check @@ -0,0 +1,87 @@ +scala.collection.immutable.List + (m) public java.lang.Object scala.collection.immutable.List.apply(java.lang.Object) (bridge) + (m) public A scala.collection.immutable.List.apply(int) (bridge) +scala.Option + (m) public abstract A scala.Option.get() +scala.Function1 + (m) public abstract R scala.Function1.apply(T1) +scala.collection.Traversable + (m) public abstract <B,That> That scala.collection.TraversableLike.map(scala.Function1<A, B>,scala.collection.generic.CanBuildFrom<Repr, B, That>) +scala.collection.Iterable + (m) public abstract <B,That> That scala.collection.TraversableLike.map(scala.Function1<A, B>,scala.collection.generic.CanBuildFrom<Repr, B, That>) +scala.collection.Seq + (m) public abstract <B,That> That scala.collection.TraversableLike.map(scala.Function1<A, B>,scala.collection.generic.CanBuildFrom<Repr, B, That>) +scala.collection.immutable.Set + (m) public abstract <B,That> That scala.collection.TraversableLike.map(scala.Function1<A, B>,scala.collection.generic.CanBuildFrom<Repr, B, That>) + (m) public abstract <B,That> That scala.collection.SetLike.map(scala.Function1<A, B>,scala.collection.generic.CanBuildFrom<This, B, That>) +scala.collection.immutable.Map + (m) public abstract <B,That> That scala.collection.TraversableLike.map(scala.Function1<A, B>,scala.collection.generic.CanBuildFrom<Repr, B, That>) +scala.collection.immutable.Vector + (m) public <B,That> That scala.collection.immutable.Vector.map(scala.Function1<A, B>,scala.collection.generic.CanBuildFrom<scala.collection.immutable.Vector<A>, B, That>) (bridge) +scala.collection.immutable.Range + (m) public <B,That> That scala.collection.immutable.Range.map(scala.Function1<java.lang.Object, B>,scala.collection.generic.CanBuildFrom<scala.collection.immutable.IndexedSeq<java.lang.Object>, B, That>) (bridge) +scala.collection.Traversable + (m) public abstract <B,That> That scala.collection.TraversableLike.flatMap(scala.Function1<A, scala.collection.TraversableOnce<B>>,scala.collection.generic.CanBuildFrom<Repr, B, That>) +scala.collection.Iterable + (m) public abstract <B,That> That scala.collection.TraversableLike.flatMap(scala.Function1<A, scala.collection.TraversableOnce<B>>,scala.collection.generic.CanBuildFrom<Repr, B, That>) +scala.collection.Seq + (m) public abstract <B,That> That scala.collection.TraversableLike.flatMap(scala.Function1<A, scala.collection.TraversableOnce<B>>,scala.collection.generic.CanBuildFrom<Repr, B, That>) +scala.collection.immutable.Set + (m) public abstract <B,That> That scala.collection.TraversableLike.flatMap(scala.Function1<A, scala.collection.TraversableOnce<B>>,scala.collection.generic.CanBuildFrom<Repr, B, That>) +scala.collection.immutable.Map + (m) public abstract <B,That> That scala.collection.TraversableLike.flatMap(scala.Function1<A, scala.collection.TraversableOnce<B>>,scala.collection.generic.CanBuildFrom<Repr, B, That>) +scala.collection.immutable.Vector + (m) public <B,That> That scala.collection.immutable.Vector.flatMap(scala.Function1<A, scala.collection.TraversableOnce<B>>,scala.collection.generic.CanBuildFrom<scala.collection.immutable.Vector<A>, B, That>) (bridge) +scala.collection.immutable.Range + (m) public <B,That> That scala.collection.immutable.Range.flatMap(scala.Function1<java.lang.Object, scala.collection.TraversableOnce<B>>,scala.collection.generic.CanBuildFrom<scala.collection.immutable.IndexedSeq<java.lang.Object>, B, That>) (bridge) +scala.collection.Traversable + (m) public abstract Repr scala.collection.TraversableLike.filter(scala.Function1<A, java.lang.Object>) +scala.collection.Iterable + (m) public abstract Repr scala.collection.TraversableLike.filter(scala.Function1<A, java.lang.Object>) +scala.collection.Seq + (m) public abstract Repr scala.collection.TraversableLike.filter(scala.Function1<A, java.lang.Object>) +scala.collection.immutable.Set + (m) public abstract Repr scala.collection.TraversableLike.filter(scala.Function1<A, java.lang.Object>) +scala.collection.immutable.Map + (m) public abstract Repr scala.collection.TraversableLike.filter(scala.Function1<A, java.lang.Object>) +scala.collection.immutable.Vector + (m) public scala.collection.immutable.Vector<A> scala.collection.immutable.Vector.filter(scala.Function1<A, java.lang.Object>) (bridge) +scala.collection.immutable.Range + (m) public scala.collection.immutable.IndexedSeq<java.lang.Object> scala.collection.immutable.Range.filter(scala.Function1<java.lang.Object, java.lang.Object>) (bridge) +scala.collection.Traversable + (m) public abstract A scala.collection.TraversableLike.head() + (m) public abstract A scala.collection.generic.GenericTraversableTemplate.head() +scala.collection.Iterable + (m) public abstract A scala.collection.TraversableLike.head() + (m) public abstract A scala.collection.generic.GenericTraversableTemplate.head() + (m) public abstract A scala.collection.IterableLike.head() +scala.collection.Seq + (m) public abstract A scala.collection.TraversableLike.head() + (m) public abstract A scala.collection.generic.GenericTraversableTemplate.head() + (m) public abstract A scala.collection.IterableLike.head() +scala.collection.immutable.Set + (m) public abstract A scala.collection.TraversableLike.head() + (m) public abstract A scala.collection.generic.GenericTraversableTemplate.head() + (m) public abstract A scala.collection.IterableLike.head() +scala.collection.immutable.Map + (m) public abstract A scala.collection.TraversableLike.head() + (m) public abstract A scala.collection.generic.GenericTraversableTemplate.head() + (m) public abstract A scala.collection.IterableLike.head() +scala.collection.immutable.Vector + (m) public A scala.collection.immutable.Vector.head() +scala.collection.immutable.Range + (m) public java.lang.Object scala.collection.immutable.Range.head() (bridge) +scala.collection.Traversable + (m) public abstract <K> scala.collection.immutable.Map<K, Repr> scala.collection.TraversableLike.groupBy(scala.Function1<A, K>) +scala.collection.Iterable + (m) public abstract <K> scala.collection.immutable.Map<K, Repr> scala.collection.TraversableLike.groupBy(scala.Function1<A, K>) +scala.collection.Seq + (m) public abstract <K> scala.collection.immutable.Map<K, Repr> scala.collection.TraversableLike.groupBy(scala.Function1<A, K>) +scala.collection.immutable.Set + (m) public abstract <K> scala.collection.immutable.Map<K, Repr> scala.collection.TraversableLike.groupBy(scala.Function1<A, K>) +scala.collection.immutable.Map + (m) public abstract <K> scala.collection.immutable.Map<K, Repr> scala.collection.TraversableLike.groupBy(scala.Function1<A, K>) +scala.collection.immutable.Vector + (m) public <K> scala.collection.immutable.Map<K, scala.collection.immutable.Vector<A>> scala.collection.immutable.Vector.groupBy(scala.Function1<A, K>) (bridge) +scala.collection.immutable.Range + (m) public <K> scala.collection.immutable.Map<K, scala.collection.immutable.IndexedSeq<java.lang.Object>> scala.collection.immutable.Range.groupBy(scala.Function1<java.lang.Object, K>) (bridge) diff --git a/test/pending/run/bug4291.scala b/test/pending/run/bug4291.scala new file mode 100644 index 0000000000..0213bb2c20 --- /dev/null +++ b/test/pending/run/bug4291.scala @@ -0,0 +1,19 @@ +import scala.tools.partest._ + +object Test extends SigTest { + def main(args: Array[String]): Unit = { + show[List[_]]("apply") + show[Option[_]]("get") + show[Function1[_, _]]("apply") + + for (name <- List("map", "flatMap", "filter", "head", "groupBy")) { + show[Traversable[_]](name) + show[Iterable[_]](name) + show[Seq[_]](name) + show[Set[_]](name) + show[Map[_,_]](name) + show[Vector[_]](name) + show[Range](name) + } + } +} diff --git a/test/pending/run/sigtp.check b/test/pending/run/sigtp.check new file mode 100644 index 0000000000..a4d0f55ece --- /dev/null +++ b/test/pending/run/sigtp.check @@ -0,0 +1,11 @@ +BugBase + (m) public abstract A BugBase.key() + (m) public abstract E BugBase.next() + (m) public abstract void BugBase.next_$eq(E) +Bug + (m) public Bug<A, B> Bug.foo() + (m) public A Bug.key() + (m) public Bug<A, B> Bug.next() (bridge) + (m) public void Bug.next_$eq(Bug<A, B>) (bridge) + (f) private final A Bug.key + (f) private java.lang.Object Bug.next diff --git a/test/files/run/sigtp.scala b/test/pending/run/sigtp.scala index f0cac859f5..3e162cfdba 100644 --- a/test/files/run/sigtp.scala +++ b/test/pending/run/sigtp.scala @@ -1,3 +1,5 @@ +import scala.tools.partest._ + trait BugBase [A, E] { val key: A var next: E = _ @@ -7,12 +9,9 @@ final class Bug[A, B](val key: A) extends BugBase[A, Bug[A, B]] { def foo = next } -object Test { - def f(clazz: Class[_]) = - clazz.getDeclaredMethods.toList.map(_.toGenericString).sorted foreach println - +object Test extends SigTest { def main(args: Array[String]): Unit = { - f(classOf[Bug[_, _]]) - f(classOf[BugBase[_, _]]) + show[BugBase[_, _]]() + show[Bug[_, _]]() } } diff --git a/test/pending/run/t3857.check b/test/pending/run/t3857.check new file mode 100644 index 0000000000..520b350ff5 --- /dev/null +++ b/test/pending/run/t3857.check @@ -0,0 +1,11 @@ +ScalaGeneric + (m) public java.util.Set<java.lang.String> ScalaGeneric.s() + (m) public void ScalaGeneric.s_$eq(java.util.Set<java.lang.String>) + (f) private java.util.Set<java.lang.String> ScalaGeneric.s +ScalaGeneric2Trait + (m) public abstract java.util.Set<java.lang.String> ScalaGeneric2Trait.s() + (m) public abstract void ScalaGeneric2Trait.s_$eq(java.util.Set<java.lang.String>) +ScalaGeneric2 + (m) public java.util.Set<java.lang.String> ScalaGeneric2.s() (bridge) + (m) public void ScalaGeneric2.s_$eq(java.util.Set<java.lang.String>) (bridge) + (f) private java.util.Set<java.lang.String> ScalaGeneric2.s diff --git a/test/pending/run/t3857.scala b/test/pending/run/t3857.scala new file mode 100644 index 0000000000..94f52f72fe --- /dev/null +++ b/test/pending/run/t3857.scala @@ -0,0 +1,13 @@ +import scala.tools.partest._ + +class ScalaGeneric { var s: java.util.Set[String] = _ } +trait ScalaGeneric2Trait { var s: java.util.Set[String] = _ } +class ScalaGeneric2 extends ScalaGeneric2Trait { } + +object Test extends SigTest { + def main(args: Array[String]): Unit = { + show[ScalaGeneric]() + show[ScalaGeneric2Trait]() + show[ScalaGeneric2]() + } +} |