summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to 'test/files')
-rw-r--r--test/files/jvm/future-awaitall-zero.scala4
-rw-r--r--test/files/jvm/reactor-producer-consumer.check10
-rw-r--r--test/files/jvm/reactor-producer-consumer.scala75
-rw-r--r--test/files/neg/plugin-after-terminal.check2
-rw-r--r--test/files/neg/plugin-after-terminal.flags2
-rw-r--r--test/files/neg/plugin-after-terminal/lib/plugins.jar.desired.sha11
-rwxr-xr-xtest/files/neg/plugin-after-terminal/misc/build.sh14
-rw-r--r--test/files/neg/plugin-after-terminal/misc/scalac-plugin.xml5
-rw-r--r--test/files/neg/plugin-after-terminal/src/ThePlugin.scala31
-rw-r--r--test/files/neg/plugin-after-terminal/testsource.scala4
-rw-r--r--test/files/neg/plugin-before-parser.check2
-rw-r--r--test/files/neg/plugin-before-parser.flags2
-rw-r--r--test/files/neg/plugin-before-parser/lib/plugins.jar.desired.sha11
-rwxr-xr-xtest/files/neg/plugin-before-parser/misc/build.sh14
-rw-r--r--test/files/neg/plugin-before-parser/misc/scalac-plugin.xml5
-rw-r--r--test/files/neg/plugin-before-parser/src/ThePlugin.scala32
-rw-r--r--test/files/neg/plugin-before-parser/testsource.scala4
-rw-r--r--test/files/neg/plugin-cyclic-dependency.check2
-rw-r--r--test/files/neg/plugin-cyclic-dependency.flags2
-rw-r--r--test/files/neg/plugin-cyclic-dependency/lib/plugins.jar.desired.sha11
-rwxr-xr-xtest/files/neg/plugin-cyclic-dependency/misc/build.sh14
-rw-r--r--test/files/neg/plugin-cyclic-dependency/misc/scalac-plugin.xml5
-rw-r--r--test/files/neg/plugin-cyclic-dependency/src/ThePlugin.scala41
-rw-r--r--test/files/neg/plugin-cyclic-dependency/testsource.scala4
-rw-r--r--test/files/neg/plugin-multiple-rafter.check4
-rw-r--r--test/files/neg/plugin-multiple-rafter.flags2
-rw-r--r--test/files/neg/plugin-multiple-rafter/lib/plugins.jar.desired.sha11
-rwxr-xr-xtest/files/neg/plugin-multiple-rafter/misc/build.sh14
-rw-r--r--test/files/neg/plugin-multiple-rafter/misc/scalac-plugin.xml5
-rw-r--r--test/files/neg/plugin-multiple-rafter/src/ThePlugin.scala31
-rw-r--r--test/files/neg/plugin-multiple-rafter/testsource.scala4
-rw-r--r--test/files/neg/plugin-rafter-before-1.check2
-rw-r--r--test/files/neg/plugin-rafter-before-1.flags2
-rw-r--r--test/files/neg/plugin-rafter-before-1/lib/plugins.jar.desired.sha11
-rwxr-xr-xtest/files/neg/plugin-rafter-before-1/misc/build.sh14
-rw-r--r--test/files/neg/plugin-rafter-before-1/misc/scalac-plugin.xml5
-rw-r--r--test/files/neg/plugin-rafter-before-1/src/ThePlugin.scala31
-rw-r--r--test/files/neg/plugin-rafter-before-1/testsource.scala4
-rw-r--r--test/files/neg/plugin-rightafter-terminal.check2
-rw-r--r--test/files/neg/plugin-rightafter-terminal.flags2
-rw-r--r--test/files/neg/plugin-rightafter-terminal/lib/plugins.jar.desired.sha11
-rwxr-xr-xtest/files/neg/plugin-rightafter-terminal/misc/build.sh14
-rw-r--r--test/files/neg/plugin-rightafter-terminal/misc/scalac-plugin.xml5
-rw-r--r--test/files/neg/plugin-rightafter-terminal/src/ThePlugin.scala32
-rw-r--r--test/files/neg/plugin-rightafter-terminal/testsource.scala4
-rw-r--r--test/files/neg/t2641.check8
-rw-r--r--test/files/pos/implicits.scala16
-rw-r--r--test/files/run/exceptions-2.scala19
-rw-r--r--test/files/run/t2857.check1
-rw-r--r--test/files/run/t2857.scala9
50 files changed, 134 insertions, 376 deletions
diff --git a/test/files/jvm/future-awaitall-zero.scala b/test/files/jvm/future-awaitall-zero.scala
index 49c51f2c7e..125670d049 100644
--- a/test/files/jvm/future-awaitall-zero.scala
+++ b/test/files/jvm/future-awaitall-zero.scala
@@ -3,11 +3,11 @@ import scala.actors.Actor._
object Test {
def main(args: Array[String]) {
- val ft1 = future { reactWithin(1000) {
+ val ft1 = future { reactWithin(10000) {
case _ => println("FAIL")
} }
- val ft2 = future { reactWithin(2000) {
+ val ft2 = future { reactWithin(20000) {
case _ => println("FAIL")
} }
diff --git a/test/files/jvm/reactor-producer-consumer.check b/test/files/jvm/reactor-producer-consumer.check
new file mode 100644
index 0000000000..d971cea19e
--- /dev/null
+++ b/test/files/jvm/reactor-producer-consumer.check
@@ -0,0 +1,10 @@
+42
+42
+42
+42
+42
+42
+42
+42
+42
+42
diff --git a/test/files/jvm/reactor-producer-consumer.scala b/test/files/jvm/reactor-producer-consumer.scala
new file mode 100644
index 0000000000..946e1561ce
--- /dev/null
+++ b/test/files/jvm/reactor-producer-consumer.scala
@@ -0,0 +1,75 @@
+import scala.actors.Reactor
+
+object Test {
+ case class Stop()
+ case class Get(from: Reactor)
+ case class Put(x: Int)
+
+ class UnboundedBuffer extends Reactor {
+ def act() {
+ react {
+ case Stop() =>
+ case Get(from) =>
+ val consumer = from
+ react {
+ case msg @ Put(x) =>
+ consumer ! x
+ act()
+ }
+ }
+ }
+ }
+
+ class Producer(buf: UnboundedBuffer, n: Int, delay: Long, parent: Reactor) extends Reactor {
+ def act() {
+ var i = 0
+ while (i < n) {
+ i += 1
+ if (delay > 0) Thread.sleep(delay)
+ buf ! Put(42)
+ }
+ parent ! Stop()
+ }
+ }
+
+ class Consumer(buf: UnboundedBuffer, n: Int, delay: Long, parent: Reactor) extends Reactor {
+ val step = n / 10
+ var i = 0
+ def act() {
+ if (i < n) {
+ i += 1
+ if (delay > 0) Thread.sleep(delay)
+ buf ! Get(this)
+ react {
+ case res =>
+ if (i % step == 0)
+ println(res)
+ act()
+ }
+ } else {
+ parent ! Stop()
+ }
+ }
+ }
+
+ def main(args: Array[String]) {
+ val parent = new Reactor {
+ def act() {
+ val buffer = new UnboundedBuffer
+ buffer.start()
+ val producer = new Producer(buffer, 10000, 0, this)
+ producer.start()
+ val consumer = new Consumer(buffer, 10000, 0, this)
+ consumer.start()
+ react {
+ case Stop() =>
+ react {
+ case Stop() =>
+ buffer ! Stop()
+ }
+ }
+ }
+ }
+ parent.start()
+ }
+}
diff --git a/test/files/neg/plugin-after-terminal.check b/test/files/neg/plugin-after-terminal.check
deleted file mode 100644
index 096efe09cd..0000000000
--- a/test/files/neg/plugin-after-terminal.check
+++ /dev/null
@@ -1,2 +0,0 @@
-error: [phase assembly, after dependency on terminal phase not allowed: afterterminal => terminal]
-one error found
diff --git a/test/files/neg/plugin-after-terminal.flags b/test/files/neg/plugin-after-terminal.flags
deleted file mode 100644
index 6a44376213..0000000000
--- a/test/files/neg/plugin-after-terminal.flags
+++ /dev/null
@@ -1,2 +0,0 @@
--Xplugin:files/neg/plugin-after-terminal/lib/plugins.jar
-
diff --git a/test/files/neg/plugin-after-terminal/lib/plugins.jar.desired.sha1 b/test/files/neg/plugin-after-terminal/lib/plugins.jar.desired.sha1
deleted file mode 100644
index 23c54fb2de..0000000000
--- a/test/files/neg/plugin-after-terminal/lib/plugins.jar.desired.sha1
+++ /dev/null
@@ -1 +0,0 @@
-cf80703ed94f5176dc099c60b32d0483322de9eb ?plugins.jar
diff --git a/test/files/neg/plugin-after-terminal/misc/build.sh b/test/files/neg/plugin-after-terminal/misc/build.sh
deleted file mode 100755
index 8899009d7f..0000000000
--- a/test/files/neg/plugin-after-terminal/misc/build.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/"
-
-BASE=`pwd`
-
-if [[ -d "${BASE}/src" ]] ; then
-
- mkdir -p build
- ${SCALAC} -d build src/*.scala
- jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build .
- rm -rf build
-fi
-
diff --git a/test/files/neg/plugin-after-terminal/misc/scalac-plugin.xml b/test/files/neg/plugin-after-terminal/misc/scalac-plugin.xml
deleted file mode 100644
index 90ff27dc2a..0000000000
--- a/test/files/neg/plugin-after-terminal/misc/scalac-plugin.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<plugin>
- <name>beforeparser</name>
- <classname>scala.test.plugins.ThePlugin</classname>
-</plugin>
-
diff --git a/test/files/neg/plugin-after-terminal/src/ThePlugin.scala b/test/files/neg/plugin-after-terminal/src/ThePlugin.scala
deleted file mode 100644
index f3c913086e..0000000000
--- a/test/files/neg/plugin-after-terminal/src/ThePlugin.scala
+++ /dev/null
@@ -1,31 +0,0 @@
-package scala.test.plugins
-
-import scala.tools.nsc
-import nsc.Global
-import nsc.Phase
-import nsc.plugins.Plugin
-import nsc.plugins.PluginComponent
-
-class ThePlugin(val global: Global) extends Plugin {
- import global._
-
- val name = "afterterminal"
- val description = "Declares one plugin that wants to be after the terminal phase"
- val components = List[PluginComponent](thePhase)
-
- private object thePhase extends PluginComponent {
- val global = ThePlugin.this.global
-
- val runsAfter = List[String]("terminal")
-
- val phaseName = ThePlugin.this.name
-
- def newPhase(prev: Phase) = new ThePhase(prev)
- }
-
- private class ThePhase(prev: Phase) extends Phase(prev) {
- def name = ThePlugin.this.name
- def run {}
- }
-}
-
diff --git a/test/files/neg/plugin-after-terminal/testsource.scala b/test/files/neg/plugin-after-terminal/testsource.scala
deleted file mode 100644
index 519d162fdf..0000000000
--- a/test/files/neg/plugin-after-terminal/testsource.scala
+++ /dev/null
@@ -1,4 +0,0 @@
-object Test extends Application {
- println("afterterminal")
-}
-
diff --git a/test/files/neg/plugin-before-parser.check b/test/files/neg/plugin-before-parser.check
deleted file mode 100644
index 9a407923b1..0000000000
--- a/test/files/neg/plugin-before-parser.check
+++ /dev/null
@@ -1,2 +0,0 @@
-error: [phase assembly, before dependency on parser phase not allowed: parser => beforeparser]
-one error found
diff --git a/test/files/neg/plugin-before-parser.flags b/test/files/neg/plugin-before-parser.flags
deleted file mode 100644
index 632530922c..0000000000
--- a/test/files/neg/plugin-before-parser.flags
+++ /dev/null
@@ -1,2 +0,0 @@
--Xplugin:files/neg/plugin-before-parser/lib/plugins.jar
-
diff --git a/test/files/neg/plugin-before-parser/lib/plugins.jar.desired.sha1 b/test/files/neg/plugin-before-parser/lib/plugins.jar.desired.sha1
deleted file mode 100644
index 27c022e853..0000000000
--- a/test/files/neg/plugin-before-parser/lib/plugins.jar.desired.sha1
+++ /dev/null
@@ -1 +0,0 @@
-2e05e73ed90aaf286fa6555d992c1da18de3ceca ?plugins.jar
diff --git a/test/files/neg/plugin-before-parser/misc/build.sh b/test/files/neg/plugin-before-parser/misc/build.sh
deleted file mode 100755
index 8899009d7f..0000000000
--- a/test/files/neg/plugin-before-parser/misc/build.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/"
-
-BASE=`pwd`
-
-if [[ -d "${BASE}/src" ]] ; then
-
- mkdir -p build
- ${SCALAC} -d build src/*.scala
- jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build .
- rm -rf build
-fi
-
diff --git a/test/files/neg/plugin-before-parser/misc/scalac-plugin.xml b/test/files/neg/plugin-before-parser/misc/scalac-plugin.xml
deleted file mode 100644
index 90ff27dc2a..0000000000
--- a/test/files/neg/plugin-before-parser/misc/scalac-plugin.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<plugin>
- <name>beforeparser</name>
- <classname>scala.test.plugins.ThePlugin</classname>
-</plugin>
-
diff --git a/test/files/neg/plugin-before-parser/src/ThePlugin.scala b/test/files/neg/plugin-before-parser/src/ThePlugin.scala
deleted file mode 100644
index 8714a55dc4..0000000000
--- a/test/files/neg/plugin-before-parser/src/ThePlugin.scala
+++ /dev/null
@@ -1,32 +0,0 @@
-package scala.test.plugins
-
-import scala.tools.nsc
-import nsc.Global
-import nsc.Phase
-import nsc.plugins.Plugin
-import nsc.plugins.PluginComponent
-
-class ThePlugin(val global: Global) extends Plugin {
- import global._
-
- val name = "beforeparser"
- val description = "Declares one plugin that wants to be before the parser phase"
- val components = List[PluginComponent](thePhase)
-
- private object thePhase extends PluginComponent {
- val global = ThePlugin.this.global
-
- val runsAfter = List[String]()
- override val runsBefore = List[String]("parser")
-
- val phaseName = ThePlugin.this.name
-
- def newPhase(prev: Phase) = new ThePhase(prev)
- }
-
- private class ThePhase(prev: Phase) extends Phase(prev) {
- def name = ThePlugin.this.name
- def run {}
- }
-}
-
diff --git a/test/files/neg/plugin-before-parser/testsource.scala b/test/files/neg/plugin-before-parser/testsource.scala
deleted file mode 100644
index 9928aaa83c..0000000000
--- a/test/files/neg/plugin-before-parser/testsource.scala
+++ /dev/null
@@ -1,4 +0,0 @@
-object Test extends Application {
- println("beforeparser")
-}
-
diff --git a/test/files/neg/plugin-cyclic-dependency.check b/test/files/neg/plugin-cyclic-dependency.check
deleted file mode 100644
index a29bc3f5be..0000000000
--- a/test/files/neg/plugin-cyclic-dependency.check
+++ /dev/null
@@ -1,2 +0,0 @@
-error: fatal error: Cycle in compiler phase dependencies detected, phase cyclicdependency1 reacted twice!
-one error found
diff --git a/test/files/neg/plugin-cyclic-dependency.flags b/test/files/neg/plugin-cyclic-dependency.flags
deleted file mode 100644
index 8716aaa65f..0000000000
--- a/test/files/neg/plugin-cyclic-dependency.flags
+++ /dev/null
@@ -1,2 +0,0 @@
--Xplugin:files/neg/plugin-cyclic-dependency/lib/plugins.jar
-
diff --git a/test/files/neg/plugin-cyclic-dependency/lib/plugins.jar.desired.sha1 b/test/files/neg/plugin-cyclic-dependency/lib/plugins.jar.desired.sha1
deleted file mode 100644
index f1fb45387c..0000000000
--- a/test/files/neg/plugin-cyclic-dependency/lib/plugins.jar.desired.sha1
+++ /dev/null
@@ -1 +0,0 @@
-d96a5f1b3885225a5e203ae59ae2f2f3e3c65c9b ?plugins.jar
diff --git a/test/files/neg/plugin-cyclic-dependency/misc/build.sh b/test/files/neg/plugin-cyclic-dependency/misc/build.sh
deleted file mode 100755
index 8899009d7f..0000000000
--- a/test/files/neg/plugin-cyclic-dependency/misc/build.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/"
-
-BASE=`pwd`
-
-if [[ -d "${BASE}/src" ]] ; then
-
- mkdir -p build
- ${SCALAC} -d build src/*.scala
- jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build .
- rm -rf build
-fi
-
diff --git a/test/files/neg/plugin-cyclic-dependency/misc/scalac-plugin.xml b/test/files/neg/plugin-cyclic-dependency/misc/scalac-plugin.xml
deleted file mode 100644
index 90ff27dc2a..0000000000
--- a/test/files/neg/plugin-cyclic-dependency/misc/scalac-plugin.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<plugin>
- <name>beforeparser</name>
- <classname>scala.test.plugins.ThePlugin</classname>
-</plugin>
-
diff --git a/test/files/neg/plugin-cyclic-dependency/src/ThePlugin.scala b/test/files/neg/plugin-cyclic-dependency/src/ThePlugin.scala
deleted file mode 100644
index 1dfc15cb28..0000000000
--- a/test/files/neg/plugin-cyclic-dependency/src/ThePlugin.scala
+++ /dev/null
@@ -1,41 +0,0 @@
-package scala.test.plugins
-
-import scala.tools.nsc
-import nsc.Global
-import nsc.Phase
-import nsc.plugins.Plugin
-import nsc.plugins.PluginComponent
-
-class ThePlugin(val global: Global) extends Plugin {
- import global._
-
- val name = "cyclicdependency"
- val description = "Declares two phases that have a cyclic dependency"
- val components = List[PluginComponent](thePhase1,thePhase2)
-
- private object thePhase1 extends PluginComponent {
- val global = ThePlugin.this.global
-
- val runsAfter = List[String]("tailcalls","cyclicdependency2")
-
- val phaseName = ThePlugin.this.name + "1"
-
- def newPhase(prev: Phase) = new ThePhase(prev)
- }
-
- private object thePhase2 extends PluginComponent {
- val global = ThePlugin.this.global
-
- val runsAfter = List[String]("dce","cyclicdependency1")
-
- val phaseName = ThePlugin.this.name + "2"
-
- def newPhase(prev: Phase) = new ThePhase(prev)
- }
-
- private class ThePhase(prev: Phase) extends Phase(prev) {
- def name = ThePlugin.this.name
- def run {}
- }
-}
-
diff --git a/test/files/neg/plugin-cyclic-dependency/testsource.scala b/test/files/neg/plugin-cyclic-dependency/testsource.scala
deleted file mode 100644
index f1513ec9a0..0000000000
--- a/test/files/neg/plugin-cyclic-dependency/testsource.scala
+++ /dev/null
@@ -1,4 +0,0 @@
-object Test extends Application {
- println("cyclicdependency")
-}
-
diff --git a/test/files/neg/plugin-multiple-rafter.check b/test/files/neg/plugin-multiple-rafter.check
deleted file mode 100644
index c54f884feb..0000000000
--- a/test/files/neg/plugin-multiple-rafter.check
+++ /dev/null
@@ -1,4 +0,0 @@
-error: fatal error: Multiple phases want to run right after the phase explicitouter
-Phases: erasure, multi-rafter,
-Re-run with -Xgenerate-phase-graph <filename> to better see the problem.
-one error found
diff --git a/test/files/neg/plugin-multiple-rafter.flags b/test/files/neg/plugin-multiple-rafter.flags
deleted file mode 100644
index dcae7f2f96..0000000000
--- a/test/files/neg/plugin-multiple-rafter.flags
+++ /dev/null
@@ -1,2 +0,0 @@
--Xplugin:files/neg/plugin-multiple-rafter/lib/plugins.jar
-
diff --git a/test/files/neg/plugin-multiple-rafter/lib/plugins.jar.desired.sha1 b/test/files/neg/plugin-multiple-rafter/lib/plugins.jar.desired.sha1
deleted file mode 100644
index f4905fcbd4..0000000000
--- a/test/files/neg/plugin-multiple-rafter/lib/plugins.jar.desired.sha1
+++ /dev/null
@@ -1 +0,0 @@
-2bda582b574287429ad5ee2e1d9a3effc88b0a5f ?plugins.jar
diff --git a/test/files/neg/plugin-multiple-rafter/misc/build.sh b/test/files/neg/plugin-multiple-rafter/misc/build.sh
deleted file mode 100755
index 8899009d7f..0000000000
--- a/test/files/neg/plugin-multiple-rafter/misc/build.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/"
-
-BASE=`pwd`
-
-if [[ -d "${BASE}/src" ]] ; then
-
- mkdir -p build
- ${SCALAC} -d build src/*.scala
- jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build .
- rm -rf build
-fi
-
diff --git a/test/files/neg/plugin-multiple-rafter/misc/scalac-plugin.xml b/test/files/neg/plugin-multiple-rafter/misc/scalac-plugin.xml
deleted file mode 100644
index 90ff27dc2a..0000000000
--- a/test/files/neg/plugin-multiple-rafter/misc/scalac-plugin.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<plugin>
- <name>beforeparser</name>
- <classname>scala.test.plugins.ThePlugin</classname>
-</plugin>
-
diff --git a/test/files/neg/plugin-multiple-rafter/src/ThePlugin.scala b/test/files/neg/plugin-multiple-rafter/src/ThePlugin.scala
deleted file mode 100644
index 4c761517c1..0000000000
--- a/test/files/neg/plugin-multiple-rafter/src/ThePlugin.scala
+++ /dev/null
@@ -1,31 +0,0 @@
-package scala.test.plugins
-
-import scala.tools.nsc
-import nsc.Global
-import nsc.Phase
-import nsc.plugins.Plugin
-import nsc.plugins.PluginComponent
-
-class ThePlugin(val global: Global) extends Plugin {
- import global._
-
- val name = "multi-rafter"
- val description = ""
- val components = List[PluginComponent](thePhase)
-
- private object thePhase extends PluginComponent {
- val global = ThePlugin.this.global
-
- val runsAfter = List[String]()
- override val runsRightAfter = Some("explicitouter")
- val phaseName = ThePlugin.this.name
-
- def newPhase(prev: Phase) = new ThePhase(prev)
- }
-
- private class ThePhase(prev: Phase) extends Phase(prev) {
- def name = ThePlugin.this.name
- def run {}
- }
-}
-
diff --git a/test/files/neg/plugin-multiple-rafter/testsource.scala b/test/files/neg/plugin-multiple-rafter/testsource.scala
deleted file mode 100644
index f73db1eb60..0000000000
--- a/test/files/neg/plugin-multiple-rafter/testsource.scala
+++ /dev/null
@@ -1,4 +0,0 @@
-object Test extends Application {
- println("multi-rafter")
-}
-
diff --git a/test/files/neg/plugin-rafter-before-1.check b/test/files/neg/plugin-rafter-before-1.check
deleted file mode 100644
index 19ed4d2fba..0000000000
--- a/test/files/neg/plugin-rafter-before-1.check
+++ /dev/null
@@ -1,2 +0,0 @@
-error: fatal error: phase erasure want to run right after explicitouter, but some phase has declared to run before erasure. Re-run with -Xgenerate-phase-graph <filename> to better see the problem.
-one error found
diff --git a/test/files/neg/plugin-rafter-before-1.flags b/test/files/neg/plugin-rafter-before-1.flags
deleted file mode 100644
index 8bf03145b9..0000000000
--- a/test/files/neg/plugin-rafter-before-1.flags
+++ /dev/null
@@ -1,2 +0,0 @@
--Xplugin:files/neg/plugin-rafter-before-1/lib/plugins.jar
-
diff --git a/test/files/neg/plugin-rafter-before-1/lib/plugins.jar.desired.sha1 b/test/files/neg/plugin-rafter-before-1/lib/plugins.jar.desired.sha1
deleted file mode 100644
index b07cece8b9..0000000000
--- a/test/files/neg/plugin-rafter-before-1/lib/plugins.jar.desired.sha1
+++ /dev/null
@@ -1 +0,0 @@
-398fa866d1d5c6608c9607dd1079afc12182119f ?plugins.jar
diff --git a/test/files/neg/plugin-rafter-before-1/misc/build.sh b/test/files/neg/plugin-rafter-before-1/misc/build.sh
deleted file mode 100755
index 8899009d7f..0000000000
--- a/test/files/neg/plugin-rafter-before-1/misc/build.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/"
-
-BASE=`pwd`
-
-if [[ -d "${BASE}/src" ]] ; then
-
- mkdir -p build
- ${SCALAC} -d build src/*.scala
- jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build .
- rm -rf build
-fi
-
diff --git a/test/files/neg/plugin-rafter-before-1/misc/scalac-plugin.xml b/test/files/neg/plugin-rafter-before-1/misc/scalac-plugin.xml
deleted file mode 100644
index 90ff27dc2a..0000000000
--- a/test/files/neg/plugin-rafter-before-1/misc/scalac-plugin.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<plugin>
- <name>beforeparser</name>
- <classname>scala.test.plugins.ThePlugin</classname>
-</plugin>
-
diff --git a/test/files/neg/plugin-rafter-before-1/src/ThePlugin.scala b/test/files/neg/plugin-rafter-before-1/src/ThePlugin.scala
deleted file mode 100644
index c42a914066..0000000000
--- a/test/files/neg/plugin-rafter-before-1/src/ThePlugin.scala
+++ /dev/null
@@ -1,31 +0,0 @@
-package scala.test.plugins
-
-import scala.tools.nsc
-import nsc.Global
-import nsc.Phase
-import nsc.plugins.Plugin
-import nsc.plugins.PluginComponent
-
-class ThePlugin(val global: Global) extends Plugin {
- import global._
-
- val name = "rafter-before-1"
- val description = ""
- val components = List[PluginComponent](thePhase1)
-
- private object thePhase1 extends PluginComponent {
- val global = ThePlugin.this.global
-
- val runsAfter = List[String]("refchecks")
- override val runsBefore = List[String]("erasure")
- val phaseName = ThePlugin.this.name
-
- def newPhase(prev: Phase) = new ThePhase(prev)
- }
-
- private class ThePhase(prev: Phase) extends Phase(prev) {
- def name = ThePlugin.this.name
- def run {}
- }
-}
-
diff --git a/test/files/neg/plugin-rafter-before-1/testsource.scala b/test/files/neg/plugin-rafter-before-1/testsource.scala
deleted file mode 100644
index 836459db22..0000000000
--- a/test/files/neg/plugin-rafter-before-1/testsource.scala
+++ /dev/null
@@ -1,4 +0,0 @@
-object Test extends Application {
- println("rafter-before-1")
-}
-
diff --git a/test/files/neg/plugin-rightafter-terminal.check b/test/files/neg/plugin-rightafter-terminal.check
deleted file mode 100644
index 6fe4f63c82..0000000000
--- a/test/files/neg/plugin-rightafter-terminal.check
+++ /dev/null
@@ -1,2 +0,0 @@
-error: [phase assembly, right after dependency on terminal phase not allowed: rightafterterminal => terminal]
-one error found
diff --git a/test/files/neg/plugin-rightafter-terminal.flags b/test/files/neg/plugin-rightafter-terminal.flags
deleted file mode 100644
index 948a318668..0000000000
--- a/test/files/neg/plugin-rightafter-terminal.flags
+++ /dev/null
@@ -1,2 +0,0 @@
--Xplugin:files/neg/plugin-rightafter-terminal/lib/plugins.jar
-
diff --git a/test/files/neg/plugin-rightafter-terminal/lib/plugins.jar.desired.sha1 b/test/files/neg/plugin-rightafter-terminal/lib/plugins.jar.desired.sha1
deleted file mode 100644
index 78a4fc0c98..0000000000
--- a/test/files/neg/plugin-rightafter-terminal/lib/plugins.jar.desired.sha1
+++ /dev/null
@@ -1 +0,0 @@
-b2166b6bc2a55264d959e613fa52695295db2281 ?plugins.jar
diff --git a/test/files/neg/plugin-rightafter-terminal/misc/build.sh b/test/files/neg/plugin-rightafter-terminal/misc/build.sh
deleted file mode 100755
index 8899009d7f..0000000000
--- a/test/files/neg/plugin-rightafter-terminal/misc/build.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-SCALAC="../../../../build/pack/bin/scalac -deprecation -cp ../../../../build/quick/classes/compiler/"
-
-BASE=`pwd`
-
-if [[ -d "${BASE}/src" ]] ; then
-
- mkdir -p build
- ${SCALAC} -d build src/*.scala
- jar cf lib/plugins.jar -C misc/ scalac-plugin.xml -C build .
- rm -rf build
-fi
-
diff --git a/test/files/neg/plugin-rightafter-terminal/misc/scalac-plugin.xml b/test/files/neg/plugin-rightafter-terminal/misc/scalac-plugin.xml
deleted file mode 100644
index 90ff27dc2a..0000000000
--- a/test/files/neg/plugin-rightafter-terminal/misc/scalac-plugin.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<plugin>
- <name>beforeparser</name>
- <classname>scala.test.plugins.ThePlugin</classname>
-</plugin>
-
diff --git a/test/files/neg/plugin-rightafter-terminal/src/ThePlugin.scala b/test/files/neg/plugin-rightafter-terminal/src/ThePlugin.scala
deleted file mode 100644
index 47dd06ec8a..0000000000
--- a/test/files/neg/plugin-rightafter-terminal/src/ThePlugin.scala
+++ /dev/null
@@ -1,32 +0,0 @@
-package scala.test.plugins
-
-import scala.tools.nsc
-import nsc.Global
-import nsc.Phase
-import nsc.plugins.Plugin
-import nsc.plugins.PluginComponent
-
-class ThePlugin(val global: Global) extends Plugin {
- import global._
-
- val name = "rightafterterminal"
- val description = "Declares one plugin that wants to be right after the terminal phase"
- val components = List[PluginComponent](thePhase)
-
- private object thePhase extends PluginComponent {
- val global = ThePlugin.this.global
-
- val runsAfter = List[String]()
- override val runsRightAfter = Some("terminal")
-
- val phaseName = ThePlugin.this.name
-
- def newPhase(prev: Phase) = new ThePhase(prev)
- }
-
- private class ThePhase(prev: Phase) extends Phase(prev) {
- def name = ThePlugin.this.name
- def run {}
- }
-}
-
diff --git a/test/files/neg/plugin-rightafter-terminal/testsource.scala b/test/files/neg/plugin-rightafter-terminal/testsource.scala
deleted file mode 100644
index 7af767b638..0000000000
--- a/test/files/neg/plugin-rightafter-terminal/testsource.scala
+++ /dev/null
@@ -1,4 +0,0 @@
-object Test extends Application {
- println("rightafterterminal")
-}
-
diff --git a/test/files/neg/t2641.check b/test/files/neg/t2641.check
index 70123bfc58..07900d0796 100644
--- a/test/files/neg/t2641.check
+++ b/test/files/neg/t2641.check
@@ -9,10 +9,6 @@ t2641.scala:18: error: illegal inheritance;
self-type ManagedSeq does not conform to scala.collection.TraversableView[A,ManagedSeqStrict[A]]'s selftype scala.collection.TraversableView[A,ManagedSeqStrict[A]]
with TraversableView[A, ManagedSeqStrict[A]]
^
-t2641.scala:19: error: illegal inheritance;
- self-type ManagedSeq does not conform to scala.collection.TraversableViewLike[A,ManagedSeqStrict[A],<error>]'s selftype scala.collection.TraversableViewLike[A,Coll,This]
- with TraversableViewLike[A, ManagedSeqStrict[A], ManagedSeq[A]]
- ^
t2641.scala:17: error: illegal inheritance;
self-type ManagedSeq does not conform to ScalaObject's selftype ScalaObject
extends ManagedSeqStrict[A]
@@ -29,11 +25,11 @@ t2641.scala:27: error: illegal inheritance; superclass Any
trait Sliced extends Transformed[A] with super.Sliced {
^
t2641.scala:27: error: illegal inheritance; superclass Any
- is not a subclass of the superclass Object
+ is not a subclass of the superclass TraversableLike
of the mixin trait Sliced
trait Sliced extends Transformed[A] with super.Sliced {
^
t2641.scala:28: error: value managedIterator is not a member of ManagedSeq
override def managedIterator = self.managedIterator slice (from, until)
^
-10 errors found
+9 errors found
diff --git a/test/files/pos/implicits.scala b/test/files/pos/implicits.scala
index 14241a2655..3939a28398 100644
--- a/test/files/pos/implicits.scala
+++ b/test/files/pos/implicits.scala
@@ -66,3 +66,19 @@ object TestNumericWidening {
val y = 1
val x: java.lang.Long = y
}
+
+// #2709
+package foo2709 {
+ class A
+ class B
+
+ package object bar {
+ implicit def a2b(a: A): B = new B
+ }
+
+ package bar {
+ object test {
+ new A: B
+ }
+ }
+}
diff --git a/test/files/run/exceptions-2.scala b/test/files/run/exceptions-2.scala
index 820ab3634d..05aab66dd0 100644
--- a/test/files/run/exceptions-2.scala
+++ b/test/files/run/exceptions-2.scala
@@ -267,6 +267,23 @@ object Test {
try { 1 } catch { case e: java.io.IOException => () }
}
+ /** Test that empty finally clauses containing while are correctly emitted.
+ */
+ class Issue {
+ var b = 0
+ try {
+ // println("abc")
+ } finally {
+ while (b == -1) {b = 0}
+ }
+ }
+
+ /* Tests that class Issue passes verification. */
+ def whileInFinally = {
+ new Issue
+ }
+
+
def main(args: Array[String]): Unit = {
Console.println("nested1: ");
@@ -326,5 +343,7 @@ object Test {
Console.println("Return with finally clause that cleans the stack")
returnWithFinallyClean
+
+ whileInFinally
}
}
diff --git a/test/files/run/t2857.check b/test/files/run/t2857.check
new file mode 100644
index 0000000000..c508d5366f
--- /dev/null
+++ b/test/files/run/t2857.check
@@ -0,0 +1 @@
+false
diff --git a/test/files/run/t2857.scala b/test/files/run/t2857.scala
new file mode 100644
index 0000000000..bd0d6fde16
--- /dev/null
+++ b/test/files/run/t2857.scala
@@ -0,0 +1,9 @@
+object Test extends Application {
+ import collection.mutable._
+ val m = new HashMap[Int, Set[String]] with MultiMap[Int, String]
+ m.addBinding(6, "Foo")
+ m.removeBinding(6, "Foo")
+ println(m.contains(6))
+}
+
+