aboutsummaryrefslogtreecommitdiff
path: root/tests/run/t6052.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2015-05-30 19:04:23 +0200
committerGuillaume Martres <smarter@ubuntu.com>2015-05-30 19:53:31 +0200
commit8f90105dc4e62e78d53b385df1b2eb29f2855183 (patch)
treecd9bac9ad514ce3e592217962ac319d0ce0d34f4 /tests/run/t6052.scala
parentdd80fe09cdf4f83efbdf3b7e88f9c686e2a6c137 (diff)
downloaddotty-8f90105dc4e62e78d53b385df1b2eb29f2855183.tar.gz
dotty-8f90105dc4e62e78d53b385df1b2eb29f2855183.tar.bz2
dotty-8f90105dc4e62e78d53b385df1b2eb29f2855183.zip
Avoid static initialization deadlock in run tests.
See https://github.com/lampepfl/dotty/pull/624#issuecomment-107064519 for a lengthy explanation.
Diffstat (limited to 'tests/run/t6052.scala')
-rw-r--r--tests/run/t6052.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/run/t6052.scala b/tests/run/t6052.scala
index e740f00e1..15bffc1eb 100644
--- a/tests/run/t6052.scala
+++ b/tests/run/t6052.scala
@@ -5,7 +5,7 @@
-object Test extends dotty.runtime.LegacyApp {
+object Test {
def seqarr(i: Int) = Array[Int]() ++ (0 until i)
def pararr(i: Int) = seqarr(i).par
@@ -15,7 +15,9 @@ object Test extends dotty.runtime.LegacyApp {
assert(gseq == gpar, (gseq, gpar))
}
- for (i <- 0 until 20) check(i, _ > 0)
- for (i <- 0 until 20) check(i, _ % 2)
- for (i <- 0 until 20) check(i, _ % 4)
+ def main(args: Array[String]): Unit = {
+ for (i <- 0 until 20) check(i, _ > 0)
+ for (i <- 0 until 20) check(i, _ % 2)
+ for (i <- 0 until 20) check(i, _ % 4)
+ }
}