diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2015-05-30 19:04:23 +0200 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2015-05-30 19:53:31 +0200 |
commit | 8f90105dc4e62e78d53b385df1b2eb29f2855183 (patch) | |
tree | cd9bac9ad514ce3e592217962ac319d0ce0d34f4 /tests/run/t7498.scala | |
parent | dd80fe09cdf4f83efbdf3b7e88f9c686e2a6c137 (diff) | |
download | dotty-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/t7498.scala')
-rw-r--r-- | tests/run/t7498.scala | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/run/t7498.scala b/tests/run/t7498.scala index cab598405..a2555c6b1 100644 --- a/tests/run/t7498.scala +++ b/tests/run/t7498.scala @@ -5,16 +5,18 @@ -object Test extends dotty.runtime.LegacyApp { +object Test { import scala.collection.concurrent.TrieMap class Collision(val idx: Int) { override def hashCode = idx % 10 } - val tm = TrieMap[Collision, Unit]() - for (i <- 0 until 1000) tm(new Collision(i)) = () + def main(args: Array[String]): Unit = { + val tm = TrieMap[Collision, Unit]() + for (i <- 0 until 1000) tm(new Collision(i)) = () - tm.par.foreach(kv => ()) + tm.par.foreach(kv => ()) + } } |