summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-02-27 15:05:16 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-02-27 15:06:16 -0800
commit234d05d52b5a2985e53f9cb6877001b3c8fc780e (patch)
tree9ddac0344649cecde3504fb8f9834e782f8fc756 /test
parent031c5be557ed49f02ab365d64e55f30c616a5939 (diff)
parent4d1a1f7ee596fcec4fe51a505aceb323710d893f (diff)
downloadscala-234d05d52b5a2985e53f9cb6877001b3c8fc780e.tar.gz
scala-234d05d52b5a2985e53f9cb6877001b3c8fc780e.tar.bz2
scala-234d05d52b5a2985e53f9cb6877001b3c8fc780e.zip
Merge 2.10.1 into 2.10.x.
Diffstat (limited to 'test')
-rw-r--r--test/files/jvm/serialization.scala15
-rw-r--r--test/files/jvm/t7146.check5
-rw-r--r--test/files/jvm/t7146.scala23
-rw-r--r--test/files/pos/t7180.scala13
-rw-r--r--test/files/run/t6548.check2
-rw-r--r--test/files/run/t6548/JavaAnnotationWithNestedEnum_1.java17
-rw-r--r--test/files/run/t6548/Test_2.scala12
-rw-r--r--test/files/run/t6827.scala3
-rw-r--r--test/files/run/t6989.check84
9 files changed, 119 insertions, 55 deletions
diff --git a/test/files/jvm/serialization.scala b/test/files/jvm/serialization.scala
index f2c47aad77..34b64938b4 100644
--- a/test/files/jvm/serialization.scala
+++ b/test/files/jvm/serialization.scala
@@ -604,7 +604,6 @@ object Test {
Test7
Test8
Test9_parallel
- Test10_util
}
}
@@ -670,17 +669,3 @@ object Test9_parallel {
throw e
}
}
-
-//############################################################################
-// Test classes in package scala.util
-
-object Test10_util {
- import scala.util.Random
- def rep[A](n: Int)(f: => A) { if (n > 0) { f; rep(n-1)(f) } }
-
- try {
- val random = new Random(345)
- val random2: Random = read(write(random))
- rep(5) { assert(random.nextInt == random2.nextInt) }
- }
-}
diff --git a/test/files/jvm/t7146.check b/test/files/jvm/t7146.check
new file mode 100644
index 0000000000..7c76040205
--- /dev/null
+++ b/test/files/jvm/t7146.check
@@ -0,0 +1,5 @@
+should be scala.concurrent.impl.ExecutionContextImpl == true
+should be scala.concurrent.forkjoin.ForkJoinPool == true
+should have non-null UncaughtExceptionHandler == true
+should be a scala.concurrent.impl.ExecutionContextImpl UncaughtExceptionHandler == true
+should just print out on uncaught == true
diff --git a/test/files/jvm/t7146.scala b/test/files/jvm/t7146.scala
new file mode 100644
index 0000000000..2bd03d6d02
--- /dev/null
+++ b/test/files/jvm/t7146.scala
@@ -0,0 +1,23 @@
+import java.util.concurrent.Executor
+import scala.concurrent._
+import scala.util.control.NoStackTrace
+
+object Test {
+ def main(args: Array[String]) {
+ println("should be scala.concurrent.impl.ExecutionContextImpl == " +
+ ExecutionContext.global.toString.startsWith("scala.concurrent.impl.ExecutionContextImpl"))
+ val i = ExecutionContext.global.asInstanceOf[{ def executor: Executor }]
+ println("should be scala.concurrent.forkjoin.ForkJoinPool == " +
+ i.executor.toString.startsWith("scala.concurrent.forkjoin.ForkJoinPool"))
+ val u = i.executor.
+ asInstanceOf[{ def getUncaughtExceptionHandler: Thread.UncaughtExceptionHandler }].
+ getUncaughtExceptionHandler
+ println("should have non-null UncaughtExceptionHandler == " + (u ne null))
+ println("should be a scala.concurrent.impl.ExecutionContextImpl UncaughtExceptionHandler == " +
+ u.toString.startsWith("scala.concurrent.impl.ExecutionContextImpl"))
+ print("should just print out on uncaught == ")
+ u.uncaughtException(Thread.currentThread, new Throwable {
+ override def printStackTrace() { println("true") }
+ })
+ }
+}
diff --git a/test/files/pos/t7180.scala b/test/files/pos/t7180.scala
new file mode 100644
index 0000000000..15582f6df3
--- /dev/null
+++ b/test/files/pos/t7180.scala
@@ -0,0 +1,13 @@
+trait Higher[F[_]]
+
+trait Box[A]
+object Box {
+ implicit def HigherBox = new Higher[Box] {}
+}
+
+object Foo {
+ val box = implicitly[Higher[Box]] // compiles fine !!!
+
+ type Bar[A] = Box[A]
+ val bar = implicitly[Higher[Bar]] // <-- this doesn't compile in 2.10.1-RC1, but does in 2.10.0 !!!
+}
diff --git a/test/files/run/t6548.check b/test/files/run/t6548.check
deleted file mode 100644
index 5dfcb12e02..0000000000
--- a/test/files/run/t6548.check
+++ /dev/null
@@ -1,2 +0,0 @@
-false
-List(JavaAnnotationWithNestedEnum_1(value = VALUE))
diff --git a/test/files/run/t6548/JavaAnnotationWithNestedEnum_1.java b/test/files/run/t6548/JavaAnnotationWithNestedEnum_1.java
deleted file mode 100644
index 32004de537..0000000000
--- a/test/files/run/t6548/JavaAnnotationWithNestedEnum_1.java
+++ /dev/null
@@ -1,17 +0,0 @@
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.FIELD,
- ElementType.TYPE, ElementType.PARAMETER})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface JavaAnnotationWithNestedEnum_1
-{
- public Value value() default Value.VALUE;
-
- public enum Value
- {
- VALUE;
- }
-} \ No newline at end of file
diff --git a/test/files/run/t6548/Test_2.scala b/test/files/run/t6548/Test_2.scala
deleted file mode 100644
index 6e4f6ba92a..0000000000
--- a/test/files/run/t6548/Test_2.scala
+++ /dev/null
@@ -1,12 +0,0 @@
-import scala.reflect.runtime.universe._
-import scala.reflect.runtime.{currentMirror => cm}
-
-class Bean {
- @JavaAnnotationWithNestedEnum_1(JavaAnnotationWithNestedEnum_1.Value.VALUE)
- def value = 1
-}
-
-object Test extends App {
- println(cm.staticClass("Bean").isCaseClass)
- println(typeOf[Bean].declaration(newTermName("value")).annotations)
-}
diff --git a/test/files/run/t6827.scala b/test/files/run/t6827.scala
index 7e8918e3dc..8e17af09e2 100644
--- a/test/files/run/t6827.scala
+++ b/test/files/run/t6827.scala
@@ -28,4 +28,7 @@ object Test extends App {
tryit("read -1", 0, -1)
tryit("invalid read 0", 30, 0)
tryit("invalid read -1", 30, -1)
+
+ // okay, see SI-7128
+ "...".toIterator.copyToArray(new Array[Char](0), 0, 0)
}
diff --git a/test/files/run/t6989.check b/test/files/run/t6989.check
index 8943792115..3a94f6e8df 100644
--- a/test/files/run/t6989.check
+++ b/test/files/run/t6989.check
@@ -113,6 +113,18 @@ isProtected = false
isPublic = false
privateWithin = <none>
============
+sym = class $PrivateJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1
+isPrivate = true
+isProtected = false
+isPublic = false
+privateWithin = <none>
+============
+sym = value this$0, signature = foo.JavaClass_1, owner = class $PrivateJavaClass
+isPrivate = false
+isProtected = false
+isPublic = false
+privateWithin = package foo
+============
sym = class $ProtectedJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1
isPrivate = false
isProtected = true
@@ -131,6 +143,18 @@ isProtected = false
isPublic = false
privateWithin = package foo
============
+sym = class $ProtectedJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1
+isPrivate = false
+isProtected = true
+isPublic = false
+privateWithin = package foo
+============
+sym = value this$0, signature = foo.JavaClass_1, owner = class $ProtectedJavaClass
+isPrivate = false
+isProtected = false
+isPublic = false
+privateWithin = package foo
+============
sym = class $PublicJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1
isPrivate = false
isProtected = false
@@ -155,55 +179,97 @@ isProtected = false
isPublic = true
privateWithin = <none>
============
-sym = constructor JavaClass_1, signature = ()foo.JavaClass_1, owner = class JavaClass_1
+sym = class $PublicJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1
isPrivate = false
isProtected = false
isPublic = true
privateWithin = <none>
============
-sym = object JavaClass_1, signature = foo.JavaClass_1.type, owner = package foo
+sym = constructor $PublicJavaClass, signature = (x$1: foo.JavaClass_1)JavaClass_1.this.$PublicJavaClass, owner = class $PublicJavaClass
+isPrivate = false
+isProtected = false
+isPublic = true
+privateWithin = <none>
+============
+sym = value this$0, signature = foo.JavaClass_1, owner = class $PublicJavaClass
+isPrivate = false
+isProtected = false
+isPublic = false
+privateWithin = package foo
+============
+sym = constructor JavaClass_1, signature = ()foo.JavaClass_1, owner = class JavaClass_1
isPrivate = false
isProtected = false
isPublic = true
privateWithin = <none>
============
-sym = class PrivateStaticJavaClass, signature = ClassInfoType(...), owner = object JavaClass_1
+sym = class PrivateStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1
isPrivate = true
isProtected = false
isPublic = false
privateWithin = <none>
============
-sym = object PrivateStaticJavaClass, signature = foo.JavaClass_1.PrivateStaticJavaClass.type, owner = object JavaClass_1
+sym = object PrivateStaticJavaClass, signature = JavaClass_1.this.PrivateStaticJavaClass.type, owner = class JavaClass_1
isPrivate = true
isProtected = false
isPublic = false
privateWithin = <none>
============
-sym = class ProtectedStaticJavaClass, signature = ClassInfoType(...), owner = object JavaClass_1
+sym = class ProtectedStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1
isPrivate = true
isProtected = false
isPublic = false
privateWithin = <none>
============
-sym = object ProtectedStaticJavaClass, signature = foo.JavaClass_1.ProtectedStaticJavaClass.type, owner = object JavaClass_1
+sym = object ProtectedStaticJavaClass, signature = JavaClass_1.this.ProtectedStaticJavaClass.type, owner = class JavaClass_1
isPrivate = true
isProtected = false
isPublic = false
privateWithin = <none>
============
-sym = class PublicStaticJavaClass, signature = ClassInfoType(...), owner = object JavaClass_1
+sym = class PublicStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1
+isPrivate = false
+isProtected = false
+isPublic = true
+privateWithin = <none>
+============
+sym = constructor PublicStaticJavaClass, signature = ()JavaClass_1.this.PublicStaticJavaClass, owner = class PublicStaticJavaClass
+isPrivate = false
+isProtected = false
+isPublic = true
+privateWithin = <none>
+============
+sym = object PublicStaticJavaClass, signature = JavaClass_1.this.PublicStaticJavaClass.type, owner = class JavaClass_1
isPrivate = false
isProtected = false
isPublic = true
privateWithin = <none>
============
-sym = constructor PublicStaticJavaClass, signature = ()foo.JavaClass_1.PublicStaticJavaClass, owner = class PublicStaticJavaClass
+sym = object JavaClass_1, signature = foo.JavaClass_1.type, owner = package foo
+isPrivate = false
+isProtected = false
+isPublic = true
+privateWithin = <none>
+============
+sym = class PrivateStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1
+isPrivate = true
+isProtected = false
+isPublic = false
+privateWithin = <none>
+============
+sym = class ProtectedStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1
+isPrivate = true
+isProtected = false
+isPublic = false
+privateWithin = <none>
+============
+sym = class PublicStaticJavaClass, signature = ClassInfoType(...), owner = class JavaClass_1
isPrivate = false
isProtected = false
isPublic = true
privateWithin = <none>
============
-sym = object PublicStaticJavaClass, signature = foo.JavaClass_1.PublicStaticJavaClass.type, owner = object JavaClass_1
+sym = constructor PublicStaticJavaClass, signature = ()JavaClass_1.this.PublicStaticJavaClass, owner = class PublicStaticJavaClass
isPrivate = false
isProtected = false
isPublic = true