summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2011-03-24 15:00:41 +0000
committerAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2011-03-24 15:00:41 +0000
commitd0e519a3091ce7e14781a8b929c35a3e228194d8 (patch)
tree161f5c08de8d018d85cd73a663f2929b9a3eeaac /test
parentaf011572ee74162202b2a66a98bf5e480b5b435b (diff)
downloadscala-d0e519a3091ce7e14781a8b929c35a3e228194d8.tar.gz
scala-d0e519a3091ce7e14781a8b929c35a3e228194d8.tar.bz2
scala-d0e519a3091ce7e14781a8b929c35a3e228194d8.zip
Added a temporary fix for #4351, but disabled i...
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.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/testblock.scala33
-rw-r--r--test/files/run/testpar.scala24
-rw-r--r--test/files/specialized/td3651.check2
-rw-r--r--test/files/specialized/td3651.scala19
4 files changed, 21 insertions, 57 deletions
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)
+ }
+}