diff options
Diffstat (limited to 'test/pending')
127 files changed, 280 insertions, 1043 deletions
diff --git a/test/pending/junit/scala/util/t7265.scala b/test/pending/junit/scala/util/t7265.scala deleted file mode 100644 index 3b8fa80dbe..0000000000 --- a/test/pending/junit/scala/util/t7265.scala +++ /dev/null @@ -1,46 +0,0 @@ - -package scala.util -package test - -import org.junit.Assert._ -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 - -import scala.util.PropertiesTrait - -/** The java version property uses the spec version - * and must work for all "major.minor" and fail otherwise. - */ -@RunWith(classOf[JUnit4]) -class SpecVersionTest { - val sut = new PropertiesTrait { - override def javaSpecVersion = "1.7" - - override protected def pickJarBasedOn: Class[_] = ??? - override protected def propCategory: String = "test" - - // override because of vals like releaseVersion - override lazy val scalaProps = new java.util.Properties - } - - @Test - def comparesCorrectly(): Unit = { - assert(sut isJavaAtLeast "1.5") - assert(sut isJavaAtLeast "1.6") - assert(sut isJavaAtLeast "1.7") - assert(!(sut isJavaAtLeast "1.8")) - } - @Test(expected = classOf[NumberFormatException]) - def badVersion(): Unit = { - sut isJavaAtLeast "1.a" - } - @Test(expected = classOf[NumberFormatException]) - def missingVersion(): Unit = { - sut isJavaAtLeast "1" - } - @Test(expected = classOf[NumberFormatException]) - def notASpec(): Unit = { - sut isJavaAtLeast "1.7.1" - } -} diff --git a/test/pending/jvm/cf-attributes.scala b/test/pending/jvm/cf-attributes.scala index 9e0e9d95de..f4964b63b1 100644 --- a/test/pending/jvm/cf-attributes.scala +++ b/test/pending/jvm/cf-attributes.scala @@ -52,14 +52,14 @@ object anonymousFunctions { } object anonymousClasses { - //InnerClass: + //InnerClass: // public abstract #_= #_ of #_; //Foo=class anonymousClasses$Foo of class anonymousClasses$ // public abstract #_= #_ of #_; //Foo$class=class anonymousClasses$Foo$class of class anonymousClasses$ trait Foo { def foo() { println("foo"); } override def toString = getClass.getName } - //InnerClass: + //InnerClass: // public final #_; //class anonymousClasses$$anon$1 of class anonymousClasses$ val x = new Foo() { override def foo() { println("foo (overriden)"); } @@ -88,16 +88,16 @@ trait Test1 { trait Test2 { @throws(classOf[Exception]) - def printInnerClasses(cls: Class[_]) { - import java.io._, ch.epfl.lamp.fjbg._ - val fjbgContext = new FJBGContext(49, 0) - val outDir = System.getProperty("partest.output", "cf-attributes.obj") - val fileName = outDir+File.separator+cls.getName+".class" - val in = new DataInputStream(new FileInputStream(fileName)) - val jclass = fjbgContext.JClass(in) - println(jclass.getInnerClasses) - in.close() - } + // def printInnerClasses(cls: Class[_]) { + // import java.io._, ch.epfl.lamp.fjbg._ + // val fjbgContext = new FJBGContext(49, 0) + // val outDir = System.getProperty("partest.output", "cf-attributes.obj") + // val fileName = outDir+File.separator+cls.getName+".class" + // val in = new DataInputStream(new FileInputStream(fileName)) + // val jclass = fjbgContext.JClass(in) + // println(jclass.getInnerClasses) + // in.close() + // } def printClass(name: String) { try { printClass(Class.forName(name)) } catch { case e: Exception => println(e) } @@ -105,7 +105,7 @@ trait Test2 { def printClass(cls: Class[_]) { println("\n[[ "+cls.getName+" ]]"); try { printInnerClasses(cls) } - catch { case e: Exception => println(e) } + catch { case e: Exception => println(e) } } } diff --git a/test/pending/neg/plugin-after-terminal.check b/test/pending/neg/plugin-after-terminal.check deleted file mode 100644 index 096efe09cd..0000000000 --- a/test/pending/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/pending/neg/plugin-after-terminal.flags b/test/pending/neg/plugin-after-terminal.flags deleted file mode 100644 index 6a44376213..0000000000 --- a/test/pending/neg/plugin-after-terminal.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-after-terminal/lib/plugins.jar - diff --git a/test/pending/neg/plugin-after-terminal/lib/plugins.jar.desired.sha1 b/test/pending/neg/plugin-after-terminal/lib/plugins.jar.desired.sha1 deleted file mode 100644 index 3e382f3a12..0000000000 --- a/test/pending/neg/plugin-after-terminal/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -f174c50c4363c492362a05c72dd45b0da18fdcd8 ?plugins.jar diff --git a/test/pending/neg/plugin-after-terminal/misc/build.sh b/test/pending/neg/plugin-after-terminal/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/pending/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/pending/neg/plugin-after-terminal/src/ThePlugin.scala b/test/pending/neg/plugin-after-terminal/src/ThePlugin.scala deleted file mode 100644 index 2a4607392f..0000000000 --- a/test/pending/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/pending/neg/plugin-after-terminal/testsource.scala b/test/pending/neg/plugin-after-terminal/testsource.scala deleted file mode 100644 index 519d162fdf..0000000000 --- a/test/pending/neg/plugin-after-terminal/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("afterterminal") -} - diff --git a/test/pending/neg/plugin-before-parser.check b/test/pending/neg/plugin-before-parser.check deleted file mode 100644 index 9a407923b1..0000000000 --- a/test/pending/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/pending/neg/plugin-before-parser.flags b/test/pending/neg/plugin-before-parser.flags deleted file mode 100644 index 632530922c..0000000000 --- a/test/pending/neg/plugin-before-parser.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-before-parser/lib/plugins.jar - diff --git a/test/pending/neg/plugin-before-parser/lib/plugins.jar.desired.sha1 b/test/pending/neg/plugin-before-parser/lib/plugins.jar.desired.sha1 deleted file mode 100644 index e82eed76ce..0000000000 --- a/test/pending/neg/plugin-before-parser/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -d7b100ad483484b598b7cd643424bd2e33898a0d ?plugins.jar diff --git a/test/pending/neg/plugin-before-parser/misc/build.sh b/test/pending/neg/plugin-before-parser/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/pending/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/pending/neg/plugin-before-parser/misc/scalac-plugin.xml b/test/pending/neg/plugin-before-parser/misc/scalac-plugin.xml deleted file mode 100644 index 90ff27dc2a..0000000000 --- a/test/pending/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/pending/neg/plugin-before-parser/src/ThePlugin.scala b/test/pending/neg/plugin-before-parser/src/ThePlugin.scala deleted file mode 100644 index 7ca896650d..0000000000 --- a/test/pending/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/pending/neg/plugin-before-parser/testsource.scala b/test/pending/neg/plugin-before-parser/testsource.scala deleted file mode 100644 index 9928aaa83c..0000000000 --- a/test/pending/neg/plugin-before-parser/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("beforeparser") -} - diff --git a/test/pending/neg/plugin-cyclic-dependency.check b/test/pending/neg/plugin-cyclic-dependency.check deleted file mode 100644 index a29bc3f5be..0000000000 --- a/test/pending/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/pending/neg/plugin-cyclic-dependency.flags b/test/pending/neg/plugin-cyclic-dependency.flags deleted file mode 100644 index 8716aaa65f..0000000000 --- a/test/pending/neg/plugin-cyclic-dependency.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-cyclic-dependency/lib/plugins.jar - diff --git a/test/pending/neg/plugin-cyclic-dependency/lib/plugins.jar.desired.sha1 b/test/pending/neg/plugin-cyclic-dependency/lib/plugins.jar.desired.sha1 deleted file mode 100644 index 7e565e9e61..0000000000 --- a/test/pending/neg/plugin-cyclic-dependency/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -7e6be9e33a87194e7061f94f6be115619f91ada2 ?plugins.jar diff --git a/test/pending/neg/plugin-cyclic-dependency/misc/build.sh b/test/pending/neg/plugin-cyclic-dependency/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/pending/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/pending/neg/plugin-cyclic-dependency/misc/scalac-plugin.xml b/test/pending/neg/plugin-cyclic-dependency/misc/scalac-plugin.xml deleted file mode 100644 index 90ff27dc2a..0000000000 --- a/test/pending/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/pending/neg/plugin-cyclic-dependency/testsource.scala b/test/pending/neg/plugin-cyclic-dependency/testsource.scala deleted file mode 100644 index f1513ec9a0..0000000000 --- a/test/pending/neg/plugin-cyclic-dependency/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("cyclicdependency") -} - diff --git a/test/pending/neg/plugin-multiple-rafter.check b/test/pending/neg/plugin-multiple-rafter.check deleted file mode 100644 index c54f884feb..0000000000 --- a/test/pending/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/pending/neg/plugin-multiple-rafter.flags b/test/pending/neg/plugin-multiple-rafter.flags deleted file mode 100644 index dcae7f2f96..0000000000 --- a/test/pending/neg/plugin-multiple-rafter.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-multiple-rafter/lib/plugins.jar - diff --git a/test/pending/neg/plugin-multiple-rafter/lib/plugins.jar.desired.sha1 b/test/pending/neg/plugin-multiple-rafter/lib/plugins.jar.desired.sha1 deleted file mode 100644 index f4905fcbd4..0000000000 --- a/test/pending/neg/plugin-multiple-rafter/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -2bda582b574287429ad5ee2e1d9a3effc88b0a5f ?plugins.jar diff --git a/test/pending/neg/plugin-multiple-rafter/misc/build.sh b/test/pending/neg/plugin-multiple-rafter/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/pending/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/pending/neg/plugin-multiple-rafter/misc/scalac-plugin.xml b/test/pending/neg/plugin-multiple-rafter/misc/scalac-plugin.xml deleted file mode 100644 index 90ff27dc2a..0000000000 --- a/test/pending/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/pending/neg/plugin-multiple-rafter/src/ThePlugin.scala b/test/pending/neg/plugin-multiple-rafter/src/ThePlugin.scala deleted file mode 100644 index 819176fa88..0000000000 --- a/test/pending/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/pending/neg/plugin-multiple-rafter/testsource.scala b/test/pending/neg/plugin-multiple-rafter/testsource.scala deleted file mode 100644 index f73db1eb60..0000000000 --- a/test/pending/neg/plugin-multiple-rafter/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("multi-rafter") -} - diff --git a/test/pending/neg/plugin-rafter-before-1.check b/test/pending/neg/plugin-rafter-before-1.check deleted file mode 100644 index 19ed4d2fba..0000000000 --- a/test/pending/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/pending/neg/plugin-rafter-before-1.flags b/test/pending/neg/plugin-rafter-before-1.flags deleted file mode 100644 index 8bf03145b9..0000000000 --- a/test/pending/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/pending/neg/plugin-rafter-before-1/lib/plugins.jar.desired.sha1 b/test/pending/neg/plugin-rafter-before-1/lib/plugins.jar.desired.sha1 deleted file mode 100644 index 8ad591b6ea..0000000000 --- a/test/pending/neg/plugin-rafter-before-1/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -af91fd67ccef349e7f8ea662615e17796a339485 ?plugins.jar diff --git a/test/pending/neg/plugin-rafter-before-1/misc/build.sh b/test/pending/neg/plugin-rafter-before-1/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/pending/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/pending/neg/plugin-rafter-before-1/misc/scalac-plugin.xml b/test/pending/neg/plugin-rafter-before-1/misc/scalac-plugin.xml deleted file mode 100644 index 90ff27dc2a..0000000000 --- a/test/pending/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/pending/neg/plugin-rafter-before-1/src/ThePlugin.scala b/test/pending/neg/plugin-rafter-before-1/src/ThePlugin.scala deleted file mode 100644 index 81ba85ae80..0000000000 --- a/test/pending/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/pending/neg/plugin-rafter-before-1/testsource.scala b/test/pending/neg/plugin-rafter-before-1/testsource.scala deleted file mode 100644 index 836459db22..0000000000 --- a/test/pending/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/pending/neg/plugin-rightafter-terminal.check b/test/pending/neg/plugin-rightafter-terminal.check deleted file mode 100644 index 6fe4f63c82..0000000000 --- a/test/pending/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/pending/neg/plugin-rightafter-terminal.flags b/test/pending/neg/plugin-rightafter-terminal.flags deleted file mode 100644 index 948a318668..0000000000 --- a/test/pending/neg/plugin-rightafter-terminal.flags +++ /dev/null @@ -1,2 +0,0 @@ --Xplugin:files/neg/plugin-rightafter-terminal/lib/plugins.jar - diff --git a/test/pending/neg/plugin-rightafter-terminal/lib/plugins.jar.desired.sha1 b/test/pending/neg/plugin-rightafter-terminal/lib/plugins.jar.desired.sha1 deleted file mode 100644 index c2e2b9cd43..0000000000 --- a/test/pending/neg/plugin-rightafter-terminal/lib/plugins.jar.desired.sha1 +++ /dev/null @@ -1 +0,0 @@ -8cccde4914da2058dca893783c231cda23855603 ?plugins.jar diff --git a/test/pending/neg/plugin-rightafter-terminal/misc/build.sh b/test/pending/neg/plugin-rightafter-terminal/misc/build.sh deleted file mode 100755 index 8899009d7f..0000000000 --- a/test/pending/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/pending/neg/plugin-rightafter-terminal/misc/scalac-plugin.xml b/test/pending/neg/plugin-rightafter-terminal/misc/scalac-plugin.xml deleted file mode 100644 index 90ff27dc2a..0000000000 --- a/test/pending/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/pending/neg/plugin-rightafter-terminal/src/ThePlugin.scala b/test/pending/neg/plugin-rightafter-terminal/src/ThePlugin.scala deleted file mode 100644 index 9d6d30b327..0000000000 --- a/test/pending/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/pending/neg/plugin-rightafter-terminal/testsource.scala b/test/pending/neg/plugin-rightafter-terminal/testsource.scala deleted file mode 100644 index 7af767b638..0000000000 --- a/test/pending/neg/plugin-rightafter-terminal/testsource.scala +++ /dev/null @@ -1,4 +0,0 @@ -object Test extends Application { - println("rightafterterminal") -} - diff --git a/test/pending/neg/t5353.check b/test/pending/neg/t5353.check deleted file mode 100644 index 75e2435600..0000000000 --- a/test/pending/neg/t5353.check +++ /dev/null @@ -1,4 +0,0 @@ -t5353.scala:2: error: this type parameter must be specified - def f(x: Boolean) = if (x) Array("abc") else Array() - ^ -one error found diff --git a/test/pending/neg/t5353.scala b/test/pending/neg/t5353.scala deleted file mode 100644 index 1ee869aac1..0000000000 --- a/test/pending/neg/t5353.scala +++ /dev/null @@ -1,3 +0,0 @@ -class A { - def f(x: Boolean) = if (x) Array("abc") else Array() -} diff --git a/test/pending/neg/t6680a.scala b/test/pending/neg/t6680a.scala new file mode 100644 index 0000000000..745334b1cd --- /dev/null +++ b/test/pending/neg/t6680a.scala @@ -0,0 +1,13 @@ +case class Cell[A](var x: A) +object Test { + def f1(x: Any) = x match { case y @ Cell(_) => y } // Inferred type is Cell[Any] + // def f2(x: Cell[_]) = x match { case y @ Cell(_) => y } // Inferred type is Cell[_] + // def f3[A](x: Cell[A]) = x match { case y @ Cell(_) => y } // Inferred type is Cell[A] + + def main(args: Array[String]): Unit = { + // val x = new Cell(1) + // val y = f1(x) + // y.x = "abc" + // println(x.x + 1) + } +}
\ No newline at end of file diff --git a/test/pending/neg/t6680b.check b/test/pending/neg/t6680b.check new file mode 100644 index 0000000000..a16812d91d --- /dev/null +++ b/test/pending/neg/t6680b.check @@ -0,0 +1,6 @@ +t6680b.scala:8: error: type mismatch; + found : String("not what you\'d expect") + required: ?Hidden1 where type ?Hidden1 (this is a GADT skolem) + case Concrete(f) => f("not what you'd expect") + ^ +one error found diff --git a/test/pending/neg/t6680b.scala b/test/pending/neg/t6680b.scala new file mode 100644 index 0000000000..e9f6468315 --- /dev/null +++ b/test/pending/neg/t6680b.scala @@ -0,0 +1,10 @@ +trait Super[+A] +// `Hidden` must occur in both variance positions (covariant/contravariant) for the sneakiness to work +// this way type inference will infer Any for `Hidden` and `A` in the pattern below +case class Concrete[Hidden, +A](havoc: Hidden => Hidden) extends Super[A] + +object Test extends App { + (Concrete((x: Int) => x): Super[Any]) match { + case Concrete(f) => f("not what you'd expect") + } +}
\ No newline at end of file diff --git a/test/pending/neg/t6680c.scala b/test/pending/neg/t6680c.scala new file mode 100644 index 0000000000..f69663a71b --- /dev/null +++ b/test/pending/neg/t6680c.scala @@ -0,0 +1,17 @@ +package s + +trait Stream[+A] +case class Unfold[S,+A](s: S, f: S => Option[(A,S)]) extends Stream[A] + +object Stream { + def fromList[A](a: List[A]): Stream[A] = + Unfold(a, (l:List[A]) => l.headOption.map((_,l.tail))) +} + +object Test { + def main(args: Array[String]): Unit = { + val res = Stream.fromList(List(1,2,3,4)) + + res match { case Unfold(s, f) => f("a string!") } + } +} diff --git a/test/pending/neg/plugin-cyclic-dependency/src/ThePlugin.scala b/test/pending/neg/t7494-cyclic-dependency/ThePlugin.scala index bd94ce60d7..bd94ce60d7 100644 --- a/test/pending/neg/plugin-cyclic-dependency/src/ThePlugin.scala +++ b/test/pending/neg/t7494-cyclic-dependency/ThePlugin.scala diff --git a/test/pending/neg/t7494-cyclic-dependency/sample_2.flags b/test/pending/neg/t7494-cyclic-dependency/sample_2.flags new file mode 100644 index 0000000000..db25b88a12 --- /dev/null +++ b/test/pending/neg/t7494-cyclic-dependency/sample_2.flags @@ -0,0 +1 @@ +-Xplugin:. -Xplugin-require:cyclicdependency diff --git a/test/pending/neg/t7494-cyclic-dependency/sample_2.scala b/test/pending/neg/t7494-cyclic-dependency/sample_2.scala new file mode 100644 index 0000000000..73cdc64e40 --- /dev/null +++ b/test/pending/neg/t7494-cyclic-dependency/sample_2.scala @@ -0,0 +1,6 @@ + +package sample + +// just a sample that is compiled with the sample plugin enabled +object Sample extends App { +} diff --git a/test/pending/neg/plugin-after-terminal/misc/scalac-plugin.xml b/test/pending/neg/t7494-cyclic-dependency/scalac-plugin.xml index 90ff27dc2a..2558d6fd03 100644 --- a/test/pending/neg/plugin-after-terminal/misc/scalac-plugin.xml +++ b/test/pending/neg/t7494-cyclic-dependency/scalac-plugin.xml @@ -1,5 +1,5 @@ <plugin> - <name>beforeparser</name> + <name>ignored</name> <classname>scala.test.plugins.ThePlugin</classname> </plugin> diff --git a/test/pending/pos/exhaust_2.scala b/test/pending/pos/exhaust_2.scala deleted file mode 100644 index 4f4e47c43b..0000000000 --- a/test/pending/pos/exhaust_2.scala +++ /dev/null @@ -1,54 +0,0 @@ -object ExhaustivityWarnBugReportMinimal { - //sealed is needed for the warning - sealed trait FoundNode[T]/*presence of parameters is irrelevant*/ - // This also causes a warning: - // sealed abstract class FoundNode[T]/*presence of parameters is irrelevant*/ - case class FoundFilter[T](/*presence of parameters is irrelevant*/) extends FoundNode[T] - case class FoundTypeCase[T](/*presence of parameters is irrelevant*/) extends FoundNode[T] - val f: Some[_] = ??? - f match { - case x: Some[t] => //no warning - } - //With these variants, no warnings: - //val v: (Some[Int], FoundNode[_]) = (???, ???) - //val v: (Some[AnyRef], FoundNode[_]) = (???, ???) - //val v: (Some[String], FoundNode[_]) = (???, ???) - - val v: (Some[_], FoundNode[_]) = (???, ???) - //Warning here: - v match { - case (x: Some[t], _: FoundNode[_]) => - } - v match { - case (x: Some[t], _) => - } - - v match { - case (x: Some[_], _) => - } - case class Foo[T]() - - val vp: (Foo[_], FoundNode[_]) = (???, ???) - vp match { - case (x: Foo[_], _) => - } - - //No warning here: - v match { - case (Some(y), _) => - } - - v match { - case (x, _) => - } - - val v2: (Some[_], Int) = (???, ???) - v2 match { - case (x: Some[t], _) => - } - - val v3: (Option[_], FoundNode[_]) = (???, ???) - v match { - case (x: Option[_], _) => - } -} diff --git a/test/pending/pos/no-widen-locals.flags b/test/pending/pos/no-widen-locals.flags new file mode 100644 index 0000000000..85d8eb2ba2 --- /dev/null +++ b/test/pending/pos/no-widen-locals.flags @@ -0,0 +1 @@ +-Xfatal-warnings diff --git a/test/pending/pos/overloading-boundaries.scala b/test/pending/pos/overloading-boundaries.scala new file mode 100644 index 0000000000..d2e9fdbb12 --- /dev/null +++ b/test/pending/pos/overloading-boundaries.scala @@ -0,0 +1,37 @@ +package bar { + object bippy extends (Double => String) { + def apply(x: Double): String = "Double" + } +} + +package object bar { + def bippy(x: Int, y: Int, z: Int) = "(Int, Int, Int)" +} + +object Test { + def main(args: Array[String]): Unit = { + println(bar.bippy(5.5d)) + println(bar.bippy(1, 2, 3)) + } +} + +/**** + +% scalac3 a.scala +a.scala:13: error: not enough arguments for method bippy: (x: Int, y: Int, z: Int)String. +Unspecified value parameters y, z. + println(bar.bippy(5.5d)) + ^ +one error found + +# Comment out the call to bar.bippy(5.5d) - compiles +% scalac3 a.scala + +# Compiles only from pure source though - if classes are present, fails. +% scalac3 a.scala +a.scala:2: error: bippy is already defined as method bippy in package object bar + object bippy extends (Double => String) { + ^ +one error found + +****/ diff --git a/test/pending/pos/t1751.cmds b/test/pending/pos/t1751.cmds deleted file mode 100644 index d4a4898ffd..0000000000 --- a/test/pending/pos/t1751.cmds +++ /dev/null @@ -1,3 +0,0 @@ -javac SuiteClasses.java -scalac A2_1.scala -scalac A1_2.scala diff --git a/test/pending/pos/t1751/A1_2.scala b/test/pending/pos/t1751/A1_2.scala deleted file mode 100644 index 354d5eecd0..0000000000 --- a/test/pending/pos/t1751/A1_2.scala +++ /dev/null @@ -1,2 +0,0 @@ -@SuiteClasses(Array(classOf[A2])) -class A1 diff --git a/test/pending/pos/t1751/A2_1.scala b/test/pending/pos/t1751/A2_1.scala deleted file mode 100644 index c768062e43..0000000000 --- a/test/pending/pos/t1751/A2_1.scala +++ /dev/null @@ -1,2 +0,0 @@ -@SuiteClasses(Array()) -class A2 diff --git a/test/pending/pos/t1751/SuiteClasses.java b/test/pending/pos/t1751/SuiteClasses.java deleted file mode 100644 index a415e4f572..0000000000 --- a/test/pending/pos/t1751/SuiteClasses.java +++ /dev/null @@ -1,3 +0,0 @@ -public @interface SuiteClasses { - public Class<?>[] value(); -} diff --git a/test/pending/pos/t1782.cmds b/test/pending/pos/t1782.cmds deleted file mode 100644 index 61f3d3788e..0000000000 --- a/test/pending/pos/t1782.cmds +++ /dev/null @@ -1,2 +0,0 @@ -javac Ann.java Days.java ImplementedBy.java -scalac Test_1.scala diff --git a/test/pending/pos/t1782/Ann.java b/test/pending/pos/t1782/Ann.java deleted file mode 100644 index 0dcfbd2ed7..0000000000 --- a/test/pending/pos/t1782/Ann.java +++ /dev/null @@ -1,3 +0,0 @@ -public @interface Ann { - public Days value(); -} diff --git a/test/pending/pos/t1782/Days.java b/test/pending/pos/t1782/Days.java deleted file mode 100644 index 203a87b1c2..0000000000 --- a/test/pending/pos/t1782/Days.java +++ /dev/null @@ -1,3 +0,0 @@ -public enum Days { - Friday, Sunday -} diff --git a/test/pending/pos/t1782/ImplementedBy.java b/test/pending/pos/t1782/ImplementedBy.java deleted file mode 100644 index 6aa8b4fa9e..0000000000 --- a/test/pending/pos/t1782/ImplementedBy.java +++ /dev/null @@ -1,3 +0,0 @@ -public @interface ImplementedBy { - public Class<?> value(); -} diff --git a/test/pending/pos/t1782/Test_1.scala b/test/pending/pos/t1782/Test_1.scala deleted file mode 100644 index 6467a74c29..0000000000 --- a/test/pending/pos/t1782/Test_1.scala +++ /dev/null @@ -1,16 +0,0 @@ -@ImplementedBy(classOf[Provider]) -trait Service { - def someMethod() -} - -class Provider - extends Service -{ - // test enumeration java annotations - @Ann(Days.Friday) def someMethod() = () - - // #2103 - @scala.beans.BeanProperty - @Ann(value = Days.Sunday) - val t2103 = "test" -} diff --git a/test/pending/pos/t1786.scala b/test/pending/pos/t1786.scala deleted file mode 100644 index dca2edaab4..0000000000 --- a/test/pending/pos/t1786.scala +++ /dev/null @@ -1,20 +0,0 @@ -/** This a consequence of the current type checking algorithm, where bounds - * are checked only after variables are instantiated. I believe this will change once we go to contraint-based type inference. Assigning low priority until then. - * - * - */ -class SomeClass(val intValue:Int) -class MyClass[T <: SomeClass](val myValue:T) - -object Test extends Application { - def myMethod(i:MyClass[_]) { - i.myValue.intValue/2 // << error i is of type Any - } - - def myMethod(i:MyClass[_ <: SomeClass]) { - i.myValue.intValue/2 // << works - } -} -/* -The below code shows a compiler flaw in that the wildcard "_" as value for a bounded type parameter either breaks the boundry - as it result in Any - or doesnt (as id hoped it to be) evaluates to the boundy. -*/ diff --git a/test/pending/pos/t1832.scala b/test/pending/pos/t1832.scala deleted file mode 100644 index bca863f4bd..0000000000 --- a/test/pending/pos/t1832.scala +++ /dev/null @@ -1,10 +0,0 @@ -// Edit by paulp: reduced. -trait Cloning { - trait Foo - def fn(g: Int => Unit): Foo - - implicit def mkStar(i: Int) = new { def *(a: Foo): Foo = null } - - val pool1 = 4 * fn { case i => i * 2 } - val pool2 = 4 * fn { case i: Int => i * 2 } -} diff --git a/test/pending/pos/t294.cmds b/test/pending/pos/t294.cmds deleted file mode 100644 index 62c9a5a068..0000000000 --- a/test/pending/pos/t294.cmds +++ /dev/null @@ -1,3 +0,0 @@ -javac Ann.java Ann2.java -scalac Test_1.scala -scalac Test_2.scala diff --git a/test/pending/pos/t294/Ann.java b/test/pending/pos/t294/Ann.java deleted file mode 100644 index 934ca46297..0000000000 --- a/test/pending/pos/t294/Ann.java +++ /dev/null @@ -1,3 +0,0 @@ -public @interface Ann { - public Ann2[] nested(); -} diff --git a/test/pending/pos/t294/Ann2.java b/test/pending/pos/t294/Ann2.java deleted file mode 100644 index 025b79e794..0000000000 --- a/test/pending/pos/t294/Ann2.java +++ /dev/null @@ -1,3 +0,0 @@ -public @interface Ann2 { - public int value(); -} diff --git a/test/pending/pos/t294/Test_1.scala b/test/pending/pos/t294/Test_1.scala deleted file mode 100644 index ff1f34b10e..0000000000 --- a/test/pending/pos/t294/Test_1.scala +++ /dev/null @@ -1,7 +0,0 @@ -// also test pickling of java annotations; Test_2.scala will -// read this class file -@Ann(nested = Array(new Ann2(10))) class Test { - @Ann2(100) var ctx: Object = _ - @Ann(nested = Array()) def foo = 10 - @Ann(nested = Array(new Ann2(10), new Ann2(23))) val bam = -3 -} diff --git a/test/pending/pos/t294/Test_2.scala b/test/pending/pos/t294/Test_2.scala deleted file mode 100644 index 9fb1c6e175..0000000000 --- a/test/pending/pos/t294/Test_2.scala +++ /dev/null @@ -1 +0,0 @@ -class Test2 extends Test diff --git a/test/pending/pos/t4612.scala b/test/pending/pos/t4612.scala new file mode 100644 index 0000000000..a93c12ef01 --- /dev/null +++ b/test/pending/pos/t4612.scala @@ -0,0 +1,15 @@ +class CyclicReferenceCompilerBug { + trait Trait[A] { + def foo: A + } + + class Class extends Trait[Class] { + def foo = new Class + + trait OtherTrait extends Trait[OtherTrait] { + self: Class => + + def foo = new Class + } + } +} diff --git a/test/pending/pos/t4649.flags b/test/pending/pos/t4649.flags deleted file mode 100644 index e8fb65d50c..0000000000 --- a/test/pending/pos/t4649.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings
\ No newline at end of file diff --git a/test/pending/pos/t4649.scala b/test/pending/pos/t4649.scala deleted file mode 100644 index 0d6caa8d7a..0000000000 --- a/test/pending/pos/t4649.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test { - // @annotation.tailrec - def lazyFilter[E](s: Stream[E], p: E => Boolean): Stream[E] = s match { - case h #:: t => if (p(h)) h #:: lazyFilter(t, p) else lazyFilter(t, p) - } -} diff --git a/test/pending/pos/t4695/T_1.scala b/test/pending/pos/t4695/T_1.scala new file mode 100644 index 0000000000..70fb1a7f21 --- /dev/null +++ b/test/pending/pos/t4695/T_1.scala @@ -0,0 +1,4 @@ +package foo + +class Bar { } +package object Bar { } diff --git a/test/pending/pos/t4695/T_2.scala b/test/pending/pos/t4695/T_2.scala new file mode 100644 index 0000000000..70fb1a7f21 --- /dev/null +++ b/test/pending/pos/t4695/T_2.scala @@ -0,0 +1,4 @@ +package foo + +class Bar { } +package object Bar { } diff --git a/test/pending/pos/t4717.scala b/test/pending/pos/t4717.scala deleted file mode 100644 index 7eaa3dd487..0000000000 --- a/test/pending/pos/t4717.scala +++ /dev/null @@ -1,7 +0,0 @@ -trait Bounds[@specialized A] { - // okay without `>: A` - def x[B >: A]: Unit = new Bounds[B] { - lazy val it = ??? // def or val okay - it - } -}
\ No newline at end of file diff --git a/test/pending/pos/t4786.scala b/test/pending/pos/t4786.scala deleted file mode 100644 index f0579142b8..0000000000 --- a/test/pending/pos/t4786.scala +++ /dev/null @@ -1,24 +0,0 @@ -trait Matrix[@specialized A, Repr[C] <: Matrix[C, Repr]] { // crash goes away if @specialize is removed - def duplicate(mb: MatrixBuilder[A, Repr]): Repr[A] = { - mb.zeros - } -} -trait DenseMatrix[@specialized A] extends Matrix[A, DenseMatrix] -trait DenseMatrixFlt extends DenseMatrix[Float] - -trait MatrixBuilder[@specialized A, Repr[C] <: Matrix[C, Repr]] { - def zeros: Repr[A] -} -object DenseFloatBuilder extends MatrixBuilder[Float, DenseMatrix] { - val zeros = new Object with DenseMatrixFlt - // Note: - // - in 2.9 crash goes away if the explicit type "DenseMatrixFlt" is assigned to "zeros" - // - in 2.9 crash goes away if DenseMatrixFlt is a class instead of a trait: - // val zeros = new DenseMatrixFlt -} - -object Test extends App { - val m1 = DenseFloatBuilder.zeros // in 2.9 crash goes away if explicit type "DenseMatrixFlt" is assigned to m1 - val m2 = m1.duplicate(DenseFloatBuilder) -} - diff --git a/test/pending/pos/t4859.scala b/test/pending/pos/t4859.scala deleted file mode 100644 index ec5abd966d..0000000000 --- a/test/pending/pos/t4859.scala +++ /dev/null @@ -1,15 +0,0 @@ -object O { - C().CC() - D().DD() -} - -case class C() { - case class CC() -} - -case class D() { - class DD() - object DD { - def apply() = new DD() - } -} diff --git a/test/pending/pos/t5082.scala b/test/pending/pos/t5082.scala new file mode 100644 index 0000000000..20a6cfc55f --- /dev/null +++ b/test/pending/pos/t5082.scala @@ -0,0 +1,8 @@ +object Test { + sealed trait A + case object A1 extends A +} + +trait Something[T] + +case class Test() extends Something[Test.A] diff --git a/test/pending/pos/t5259.scala b/test/pending/pos/t5259.scala deleted file mode 100644 index 317e28a9dc..0000000000 --- a/test/pending/pos/t5259.scala +++ /dev/null @@ -1,14 +0,0 @@ -object DefaultArgBogusTypeMismatch { - - class A[T] - class B { - type T = this.type - def m(implicit a : A[T] = new A[T]) = a - } - - def newB = new B - val a1 = newB.m // Bogus type mismatch - - val stableB = new B - val a2 = stableB.m // OK -} diff --git a/test/pending/pos/t5399.scala b/test/pending/pos/t5399.scala deleted file mode 100644 index 89caba39c1..0000000000 --- a/test/pending/pos/t5399.scala +++ /dev/null @@ -1,8 +0,0 @@ -class Test { - class A[T] - class B[T](val a: A[T]) - - case class CaseClass[T](x: T) - - def break(existB: B[_]) = CaseClass(existB.a) match { case CaseClass(_) => } -} diff --git a/test/pending/pos/t5399a.scala b/test/pending/pos/t5399a.scala deleted file mode 100644 index 4ebd85ad03..0000000000 --- a/test/pending/pos/t5399a.scala +++ /dev/null @@ -1,19 +0,0 @@ -class Foo { - trait Init[T] - class ScopedKey[T] extends Init[T] - - trait Setting[T] { - val key: ScopedKey[T] - } - - case class ScopedKey1[T](val foo: Init[T]) extends ScopedKey[T] - - val scalaHome: Setting[Option[String]] = null - val scalaVersion: Setting[String] = null - - def testPatternMatch(s: Setting[_]) { - s.key match { - case ScopedKey1(scalaHome.key | scalaVersion.key) => () - } - } -} diff --git a/test/pending/pos/t5606.scala b/test/pending/pos/t5606.scala deleted file mode 100644 index 2545271e32..0000000000 --- a/test/pending/pos/t5606.scala +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - -case class CaseTest[_](someData:String) diff --git a/test/pending/pos/t5626.scala b/test/pending/pos/t5626.scala deleted file mode 100644 index 7ab3881827..0000000000 --- a/test/pending/pos/t5626.scala +++ /dev/null @@ -1,12 +0,0 @@ -object Test { - val blob0 = new { - case class Foo(i : Int) - } - val foo0 = blob0.Foo(22) - - val blob1 = new { - class Foo(i: Int) - object Foo { def apply(i: Int): Foo = new Foo(i) } - } - val foo1 = blob1.Foo(22) -} diff --git a/test/pending/pos/t5639/Bar.scala b/test/pending/pos/t5639/Bar.scala deleted file mode 100644 index f577500acd..0000000000 --- a/test/pending/pos/t5639/Bar.scala +++ /dev/null @@ -1,7 +0,0 @@ -package pack.age - -import pack.age.Implicits._ - -object Quux { - def baz : Baz = 1 -} diff --git a/test/pending/pos/t5639/Foo.scala b/test/pending/pos/t5639/Foo.scala deleted file mode 100644 index 6602150661..0000000000 --- a/test/pending/pos/t5639/Foo.scala +++ /dev/null @@ -1,7 +0,0 @@ -package pack.age - -class Baz - -object Implicits { - implicit def Baz(n: Int): Baz = new Baz -} diff --git a/test/pending/pos/t5654.scala b/test/pending/pos/t5654.scala deleted file mode 100644 index eb711a5f37..0000000000 --- a/test/pending/pos/t5654.scala +++ /dev/null @@ -1,4 +0,0 @@ -case class Bomb(a: Array[_]) -case class Bomb2(a: Array[T] forSome { type T }) -class Okay1(a: Array[_]) -case class Okay2(s: Seq[_])
\ No newline at end of file diff --git a/test/pending/pos/t5877.scala b/test/pending/pos/t5877.scala new file mode 100644 index 0000000000..b77605f7f2 --- /dev/null +++ b/test/pending/pos/t5877.scala @@ -0,0 +1,5 @@ +package foo { } + +package object foo { + implicit class Foo(val s: String) { } +} diff --git a/test/pending/pos/t5954/T_1.scala b/test/pending/pos/t5954/T_1.scala new file mode 100644 index 0000000000..0064c596b6 --- /dev/null +++ b/test/pending/pos/t5954/T_1.scala @@ -0,0 +1,8 @@ +package p { + package base { + class X + } + package object base { + case class B() + } +} diff --git a/test/pending/pos/t5954/T_2.scala b/test/pending/pos/t5954/T_2.scala new file mode 100644 index 0000000000..0064c596b6 --- /dev/null +++ b/test/pending/pos/t5954/T_2.scala @@ -0,0 +1,8 @@ +package p { + package base { + class X + } + package object base { + case class B() + } +} diff --git a/test/pending/pos/t5954/T_3.scala b/test/pending/pos/t5954/T_3.scala new file mode 100644 index 0000000000..0064c596b6 --- /dev/null +++ b/test/pending/pos/t5954/T_3.scala @@ -0,0 +1,8 @@ +package p { + package base { + class X + } + package object base { + case class B() + } +} diff --git a/test/pending/pos/t6225.scala b/test/pending/pos/t6225.scala new file mode 100644 index 0000000000..d7dff3c419 --- /dev/null +++ b/test/pending/pos/t6225.scala @@ -0,0 +1,11 @@ +package library.x { + class X { + class Foo + implicit val foo = new Foo + } +} +package library { package object x extends X } +package app { + import library.x._ + object App { implicitly[Foo] } +} diff --git a/test/pending/pos/those-kinds-are-high.scala b/test/pending/pos/those-kinds-are-high.scala index 434e64cefb..78367cb746 100644 --- a/test/pending/pos/those-kinds-are-high.scala +++ b/test/pending/pos/those-kinds-are-high.scala @@ -4,18 +4,18 @@ class A { class C1[T] extends Template[C1] with Container[T] class C2[T] extends Template[C2] with Container[T] - + /** Target expression: * List(new C1[String], new C2[String]) */ - + // Here's what would ideally be inferred. // // scala> :type List[Template[Container] with Container[String]](new C1[String], new C2[String]) // List[Template[Container] with Container[java.lang.String]] // // Here's what it does infer. - // + // // scala> :type List(new C1[String], new C2[String]) // <console>:8: error: type mismatch; // found : C1[String] @@ -43,11 +43,54 @@ class A { // def fFail = List(new C1[String], new C2[String]) // ^ // two errors found - + /** Working version explicitly typed. */ def fExplicit = List[Template[Container] with Container[String]](new C1[String], new C2[String]) - + // nope def fFail = List(new C1[String], new C2[String]) } + + +trait Other { + trait GenBar[+A] + trait Bar[+A] extends GenBar[A] + trait Templ[+A, +CC[X] <: GenBar[X]] + + abstract class CC1[+A] extends Templ[A, CC1] with Bar[A] + abstract class CC2[+A] extends Templ[A, CC2] with Bar[A] + + // Compiles + class A1 { + abstract class BarFactory[CC[X] <: Bar[X]] + + def f(x: Boolean) = if (x) (null: BarFactory[CC1]) else (null: BarFactory[CC2]) + } + + // Fails - only difference is CC covariant. + class A2 { + abstract class BarFactory[+CC[X] <: Bar[X]] + + def f(x: Boolean) = if (x) (null: BarFactory[CC1]) else (null: BarFactory[CC2]) + // c.scala:23: error: kinds of the type arguments (Bar with Templ[Any,Bar]) do not conform to the expected kinds of the type parameters (type CC) in class BarFactory. + // Bar with Templ[Any,Bar]'s type parameters do not match type CC's expected parameters: + // <empty> has no type parameters, but type CC has one + // def f(x: Boolean) = if (x) (null: BarFactory[CC1]) else (null: BarFactory[CC2]) + // ^ + // one error found + } + + // Compiles - CC contravariant. + class A3 { + abstract class BarFactory[-CC[X] <: Bar[X]] // with Templ[X, CC]] + + def f(x: Boolean) = if (x) (null: BarFactory[CC1]) else (null: BarFactory[CC2]) + // c.scala:23: error: kinds of the type arguments (Bar with Templ[Any,Bar]) do not conform to the expected kinds of the type parameters (type CC) in class BarFactory. + // Bar with Templ[Any,Bar]'s type parameters do not match type CC's expected parameters: + // <empty> has no type parameters, but type CC has one + // def f(x: Boolean) = if (x) (null: BarFactory[CC1]) else (null: BarFactory[CC2]) + // ^ + // one error found + } +} diff --git a/test/pending/pos/z1720.scala b/test/pending/pos/z1720.scala deleted file mode 100644 index 6050f3ff88..0000000000 --- a/test/pending/pos/z1720.scala +++ /dev/null @@ -1,16 +0,0 @@ -package test - -class Thing { - def info: Info[this.type] = InfoRepository.getInfo(this) - def info2: Info[this.type] = { - def self: this.type = this - InfoRepository.getInfo(self) - } -} - -trait Info[T] -case class InfoImpl[T](thing: T) extends Info[T] - -object InfoRepository { - def getInfo(t: Thing): Info[t.type] = InfoImpl(t) -}
\ No newline at end of file diff --git a/test/pending/run/hk-lub-fail.scala b/test/pending/run/hk-lub-fail.scala index b58a86ee75..0ac4fdd841 100644 --- a/test/pending/run/hk-lub-fail.scala +++ b/test/pending/run/hk-lub-fail.scala @@ -25,12 +25,12 @@ object Test { // A repl session to get you started. /* - val quux1 = EmptyPackageClass.tpe.member(newTermName("Quux1")) - val quux2 = EmptyPackageClass.tpe.member(newTermName("Quux2")) + val quux1 = EmptyPackageClass.tpe.member(TermName("Quux1")) + val quux2 = EmptyPackageClass.tpe.member(TermName("Quux2")) val tps = List(quux1, quux2) map (_.tpe) - val test = EmptyPackageClass.tpe.member(newTermName("Test")) - val f = test.tpe.member(newTypeName("F")).tpe - + val test = EmptyPackageClass.tpe.member(TermName("Test")) + val f = test.tpe.member(TypeName("F")).tpe + val fn = f.normalize.asInstanceOf[ExistentialType] val fn2 = fn.underlying.asInstanceOf[TypeRef] */ diff --git a/test/pending/run/macro-expand-default/Impls_1.scala b/test/pending/run/macro-expand-default/Impls_1.scala index 7cf8d59c75..bb55f02ab2 100644 --- a/test/pending/run/macro-expand-default/Impls_1.scala +++ b/test/pending/run/macro-expand-default/Impls_1.scala @@ -3,8 +3,8 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = { import c.universe._ - val sum = Apply(Select(x.tree, newTermName("$minus")), List(y.tree)) - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(sum)) + val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree)) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum)) Expr[Unit](body) } }
\ No newline at end of file diff --git a/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala b/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala index be00fd0d8a..eed68280cd 100644 --- a/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala +++ b/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala @@ -3,8 +3,8 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo[U](c: Ctx)(x: c.Expr[U])(evidence: c.Expr[Numeric[U]]) = { import c.universe._ - val plusOne = Apply(Select(evidence.tree, newTermName("plus")), List(x.tree, Literal(Constant(1)))) - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(plusOne)) + val plusOne = Apply(Select(evidence.tree, TermName("plus")), List(x.tree, Literal(Constant(1)))) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(plusOne)) Expr[Unit](body) } }
\ No newline at end of file diff --git a/test/pending/run/macro-expand-named/Impls_1.scala b/test/pending/run/macro-expand-named/Impls_1.scala index 7cf8d59c75..bb55f02ab2 100644 --- a/test/pending/run/macro-expand-named/Impls_1.scala +++ b/test/pending/run/macro-expand-named/Impls_1.scala @@ -3,8 +3,8 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = { import c.universe._ - val sum = Apply(Select(x.tree, newTermName("$minus")), List(y.tree)) - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(sum)) + val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree)) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum)) Expr[Unit](body) } }
\ No newline at end of file diff --git a/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala b/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala index 26de70cc12..487ac79673 100644 --- a/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala +++ b/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala @@ -4,9 +4,9 @@ object Impls { def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { import c.universe._ Block(List( - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(V.toString))))), Literal(Constant(()))) } }
\ No newline at end of file diff --git a/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala b/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala index 26de70cc12..487ac79673 100644 --- a/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala +++ b/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala @@ -4,9 +4,9 @@ object Impls { def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { import c.universe._ Block(List( - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(V.toString))))), Literal(Constant(()))) } }
\ No newline at end of file diff --git a/test/pending/run/macro-reify-tagless-b/Test_2.scala b/test/pending/run/macro-reify-tagless-b/Test_2.scala index 10487b1515..09ca6ba30e 100644 --- a/test/pending/run/macro-reify-tagless-b/Test_2.scala +++ b/test/pending/run/macro-reify-tagless-b/Test_2.scala @@ -6,8 +6,8 @@ object Test extends App { import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox val tpt = AppliedTypeTree(Ident(definitions.ListClass), List(Ident(definitions.StringClass))) - val rhs = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant("hello world")))) - val list = ValDef(NoMods, newTermName("list"), tpt, rhs) - val tree = Block(list, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Ident(list.name)))) + val rhs = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant("hello world")))) + val list = ValDef(NoMods, TermName("list"), tpt, rhs) + val tree = Block(list, Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Ident(list.name)))) println(cm.mkToolBox().eval(tree)) } diff --git a/test/pending/run/t5418.check b/test/pending/run/macro-term-declared-in-anonymous-explicit-import.check index e69de29bb2..e69de29bb2 100644 --- a/test/pending/run/t5418.check +++ b/test/pending/run/macro-term-declared-in-anonymous-explicit-import.check diff --git a/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Impls_1.scala b/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Impls_1.scala new file mode 100644 index 0000000000..348f3420f2 --- /dev/null +++ b/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.{Context => Ctx} + +object Impls { + def foo(c: Ctx) = { + import c.{prefix => prefix} + import c.universe._ + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works"))))) + c.Expr[Unit](body) + } +}
\ No newline at end of file diff --git a/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Macros_Test_2.scala b/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Macros_Test_2.scala new file mode 100644 index 0000000000..dd2317b1b7 --- /dev/null +++ b/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Macros_Test_2.scala @@ -0,0 +1,6 @@ +import language.experimental.macros + +object Test extends App { + val macros = new { def foo = macro Impls.foo } + macros.foo +}
\ No newline at end of file diff --git a/test/pending/run/reify_implicits-new.check b/test/pending/run/reify_implicits-new.check deleted file mode 100644 index e3aeb20f6b..0000000000 --- a/test/pending/run/reify_implicits-new.check +++ /dev/null @@ -1 +0,0 @@ -x = List(1, 2, 3, 4) diff --git a/test/pending/run/reify_implicits-new.scala b/test/pending/run/reify_implicits-new.scala deleted file mode 100644 index 42a1deef26..0000000000 --- a/test/pending/run/reify_implicits-new.scala +++ /dev/null @@ -1,16 +0,0 @@ -import scala.reflect.{ClassTag, classTag} -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - implicit def arrayWrapper[A : ClassTag](x: Array[A]) = - new { - def sort(p: (A, A) => Boolean) = { - util.Sorting.stableSort(x, p); x - } - } - val x = Array(2, 3, 1, 4) - println("x = "+ x.sort((x: Int, y: Int) => x < y).toList) - }.eval -}
\ No newline at end of file diff --git a/test/pending/run/reify_implicits-old.check b/test/pending/run/reify_implicits-old.check deleted file mode 100644 index e3aeb20f6b..0000000000 --- a/test/pending/run/reify_implicits-old.check +++ /dev/null @@ -1 +0,0 @@ -x = List(1, 2, 3, 4) diff --git a/test/pending/run/reify_implicits-old.scala b/test/pending/run/reify_implicits-old.scala deleted file mode 100644 index 8ff256d2d4..0000000000 --- a/test/pending/run/reify_implicits-old.scala +++ /dev/null @@ -1,15 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - implicit def arrayWrapper[A : ClassManifest](x: Array[A]) = - new { - def sort(p: (A, A) => Boolean) = { - util.Sorting.stableSort(x, p); x - } - } - val x = Array(2, 3, 1, 4) - println("x = "+ x.sort((x: Int, y: Int) => x < y).toList) - }.eval -}
\ No newline at end of file diff --git a/test/pending/run/t2318.check b/test/pending/run/t2318.check deleted file mode 100644 index a486f1ac47..0000000000 --- a/test/pending/run/t2318.check +++ /dev/null @@ -1,2 +0,0 @@ -bar -bar diff --git a/test/pending/run/t2318.scala b/test/pending/run/t2318.scala deleted file mode 100644 index e42cbb9680..0000000000 --- a/test/pending/run/t2318.scala +++ /dev/null @@ -1,38 +0,0 @@ -import java.security._ - -object Test { - trait Bar { def bar: Unit } - - object Mgr extends SecurityManager { - override def checkPermission(perm: Permission) = perm match { - case _: java.lang.RuntimePermission => () - case _: java.io.FilePermission => () - case x: java.security.AccessControlException if x.getName contains ".networkaddress." => () // generality ftw - case _ => super.checkPermission(perm) - } - } - - def t1() = { - val p = Runtime.getRuntime().exec("ls"); - type Destroyable = { def destroy() : Unit } - def doDestroy( obj : Destroyable ) : Unit = obj.destroy(); - doDestroy( p ); - } - def t2() = { - System.setSecurityManager(Mgr) - - val b = new Bar { def bar = println("bar") } - b.bar - - val structural = b.asInstanceOf[{ def bar: Unit }] - structural.bar - } - - def main(args: Array[String]) { - // figuring this will otherwise break on windows - try t1() - catch { case _: java.io.IOException => () } - - t2() - } -} diff --git a/test/pending/run/t3897.check b/test/pending/run/t3897.check deleted file mode 100644 index 244b83716f..0000000000 --- a/test/pending/run/t3897.check +++ /dev/null @@ -1,8 +0,0 @@ -(One$$messages,scala.collection.mutable.MutableList<java.lang.String>) -(One$$messages,scala.collection.mutable.MutableList<java.lang.String>) -(messages,scala.collection.mutable.MutableList<java.lang.String>) -(messages,scala.collection.mutable.MutableList<java.lang.String>) -(One$$messages,scala.collection.mutable.MutableList<java.lang.String>) -(One$$messages,scala.collection.mutable.MutableList<java.lang.String>) -(messages,scala.collection.mutable.MutableList<java.lang.String>) -(messages,scala.collection.mutable.MutableList<java.lang.String>) diff --git a/test/pending/run/t3897/J_2.java b/test/pending/run/t3897/J_2.java deleted file mode 100644 index 178412dc92..0000000000 --- a/test/pending/run/t3897/J_2.java +++ /dev/null @@ -1,27 +0,0 @@ -import java.lang.reflect.*; - -public class J_2 { - public void f1(Class<?> clazz) { - Field[] fields = clazz.getDeclaredFields(); - for (int i = 0 ; i < fields.length; i++) { - String name = fields[i].getName(); - if (name.length() >= 7 && name.substring(0, 7).equals("bitmap$")) { } - else System.out.println("(" + name + "," + fields[i].getGenericType() + ")"); - } - } - public void f2(Class<?> clazz) { - Method[] methods = clazz.getDeclaredMethods(); - for (int i = 0 ; i < methods.length; i++) { - String name = methods[i].getName(); - if (name.length() >= 7 && name.substring(0, 7).equals("bitmap$")) { } - else System.out.println("(" + name + "," + methods[i].getGenericReturnType() + ")"); - } - } - - public void javaRun() { - f1(One.class); - f2(One.class); - f1(Two.class); - f2(Two.class); - } -}
\ No newline at end of file diff --git a/test/pending/run/t3897/a_1.scala b/test/pending/run/t3897/a_1.scala deleted file mode 100644 index 4da959e2ac..0000000000 --- a/test/pending/run/t3897/a_1.scala +++ /dev/null @@ -1,8 +0,0 @@ -class One { - private val messages = new collection.mutable.MutableList[String] - List("a") foreach { messages += _ } -} - -class Two { - private val messages = new collection.mutable.MutableList[String] -} diff --git a/test/pending/run/t3897/a_2.scala b/test/pending/run/t3897/a_2.scala deleted file mode 100644 index 4d9e59ef05..0000000000 --- a/test/pending/run/t3897/a_2.scala +++ /dev/null @@ -1,23 +0,0 @@ -object Test { - def f1(clazz: Class[_]) = ( - clazz.getDeclaredFields.toList - . filterNot (_.getName contains "bitmap$") - . map (f => (f.getName, f.getGenericType)) - . foreach (println) - ) - def f2(clazz: Class[_]) = ( - clazz.getDeclaredMethods.toList - . filterNot (_.getName contains "bitmap$") - . map (f => (f.getName, f.getGenericReturnType)) - . foreach (println) - ) - - def main(args: Array[String]): Unit = { - f1(classOf[One]) - f2(classOf[One]) - f1(classOf[Two]) - f2(classOf[Two]) - - new J_2().javaRun - } -} diff --git a/test/pending/run/t5293-map.scala b/test/pending/run/t5293-map.scala deleted file mode 100644 index 2707aed07e..0000000000 --- a/test/pending/run/t5293-map.scala +++ /dev/null @@ -1,88 +0,0 @@ - - - -import scala.collection.JavaConverters._ - - - -object Test extends App { - - def bench(label: String)(body: => Unit): Long = { - val start = System.nanoTime - - 0.until(10).foreach(_ => body) - - val end = System.nanoTime - - //println("%s: %s ms".format(label, (end - start) / 1000.0 / 1000.0)) - - end - start - } - - def benchJava(values: java.util.Map[Int, Int]) = { - bench("Java Map") { - val m = new java.util.HashMap[Int, Int] - - m.putAll(values) - } - } - - def benchScala(values: Iterable[(Int, Int)]) = { - bench("Scala Map") { - val m = new scala.collection.mutable.HashMap[Int, Int] - - m ++= values - } - } - - def benchScalaSorted(values: Iterable[(Int, Int)]) = { - bench("Scala Map sorted") { - val m = new scala.collection.mutable.HashMap[Int, Int] - - m ++= values.toArray.sorted - } - } - - def benchScalaPar(values: Iterable[(Int, Int)]) = { - bench("Scala ParMap") { - val m = new scala.collection.parallel.mutable.ParHashMap[Int, Int] map { x => x } - - m ++= values - } - } - - val total = 50000 - val values = (0 until total) zip (0 until total) - val map = scala.collection.mutable.HashMap.empty[Int, Int] - - map ++= values - - // warmup - for (x <- 0 until 5) { - benchJava(map.asJava) - benchScala(map) - benchScalaPar(map) - benchJava(map.asJava) - benchScala(map) - benchScalaPar(map) - } - - val javamap = benchJava(map.asJava) - val scalamap = benchScala(map) - val scalaparmap = benchScalaPar(map) - - // println(javamap) - // println(scalamap) - // println(scalaparmap) - - assert(scalamap < (javamap * 10), "scalamap: " + scalamap + " vs. javamap: " + javamap) - assert(scalaparmap < (javamap * 10), "scalaparmap: " + scalaparmap + " vs. javamap: " + javamap) -} - - - - - - - - diff --git a/test/pending/run/t5293.scala b/test/pending/run/t5293.scala deleted file mode 100644 index 01ead45d2a..0000000000 --- a/test/pending/run/t5293.scala +++ /dev/null @@ -1,83 +0,0 @@ - - - -import scala.collection.JavaConverters._ - - - -object Test extends App { - - def bench(label: String)(body: => Unit): Long = { - val start = System.nanoTime - - 0.until(10).foreach(_ => body) - - val end = System.nanoTime - - //println("%s: %s ms".format(label, (end - start) / 1000.0 / 1000.0)) - - end - start - } - - def benchJava(values: java.util.Collection[Int]) = { - bench("Java Set") { - val set = new java.util.HashSet[Int] - - set.addAll(values) - } - } - - def benchScala(values: Iterable[Int]) = { - bench("Scala Set") { - val set = new scala.collection.mutable.HashSet[Int] - - set ++= values - } - } - - def benchScalaSorted(values: Iterable[Int]) = { - bench("Scala Set sorted") { - val set = new scala.collection.mutable.HashSet[Int] - - set ++= values.toArray.sorted - } - } - - def benchScalaPar(values: Iterable[Int]) = { - bench("Scala ParSet") { - val set = new scala.collection.parallel.mutable.ParHashSet[Int] map { x => x } - - set ++= values - } - } - - val values = 0 until 50000 - val set = scala.collection.mutable.HashSet.empty[Int] - - set ++= values - - // warmup - for (x <- 0 until 5) { - benchJava(set.asJava) - benchScala(set) - benchScalaPar(set) - benchJava(set.asJava) - benchScala(set) - benchScalaPar(set) - } - - val javaset = benchJava(set.asJava) - val scalaset = benchScala(set) - val scalaparset = benchScalaPar(set) - - assert(scalaset < (javaset * 8), "scalaset: " + scalaset + " vs. javaset: " + javaset) - assert(scalaparset < (javaset * 8), "scalaparset: " + scalaparset + " vs. javaset: " + javaset) -} - - - - - - - - diff --git a/test/pending/run/t5418.scala b/test/pending/run/t5418.scala deleted file mode 100644 index e3cb20cf82..0000000000 --- a/test/pending/run/t5418.scala +++ /dev/null @@ -1,8 +0,0 @@ -import scala.reflect.runtime.universe._ -import scala.tools.reflect.Eval - -object Test extends App { - reify { - new Object().getClass - }.eval -}
\ No newline at end of file diff --git a/test/pending/run/t5427a.scala b/test/pending/run/t5427a.scala index f7cd05158d..a7d20922db 100644 --- a/test/pending/run/t5427a.scala +++ b/test/pending/run/t5427a.scala @@ -4,7 +4,7 @@ object Foo { val bar = 2 } object Test extends App { val tpe = getType(Foo) - val bar = tpe.nonPrivateMember(newTermName("bar")) + val bar = tpe.nonPrivateMember(TermName("bar")) val value = getValue(Foo, bar) println(value) }
\ No newline at end of file diff --git a/test/pending/run/t5427b.scala b/test/pending/run/t5427b.scala index e80bd12369..af1ae6ea2f 100644 --- a/test/pending/run/t5427b.scala +++ b/test/pending/run/t5427b.scala @@ -5,7 +5,7 @@ class Foo { val bar = 2 } object Test extends App { val foo = new Foo val tpe = getType(foo) - val bar = tpe.nonPrivateMember(newTermName("bar")) + val bar = tpe.nonPrivateMember(TermName("bar")) val value = getValue(foo, bar) println(value) }
\ No newline at end of file diff --git a/test/pending/run/t5427c.scala b/test/pending/run/t5427c.scala index 7095158e85..ba71803080 100644 --- a/test/pending/run/t5427c.scala +++ b/test/pending/run/t5427c.scala @@ -5,7 +5,7 @@ class Foo(bar: Int) object Test extends App { val foo = new Foo(2) val tpe = getType(foo) - val bar = tpe.nonPrivateMember(newTermName("bar")) + val bar = tpe.nonPrivateMember(TermName("bar")) bar match { case NoSymbol => println("no public member") case _ => println("i'm screwed") diff --git a/test/pending/run/t5427d.scala b/test/pending/run/t5427d.scala index f0cc07d27e..1d37dbdde3 100644 --- a/test/pending/run/t5427d.scala +++ b/test/pending/run/t5427d.scala @@ -5,7 +5,7 @@ class Foo(val bar: Int) object Test extends App { val foo = new Foo(2) val tpe = getType(foo) - val bar = tpe.nonPrivateMember(newTermName("bar")) + val bar = tpe.nonPrivateMember(TermName("bar")) val value = getValue(foo, bar) println(value) }
\ No newline at end of file diff --git a/test/pending/run/t5610a.check b/test/pending/run/t5610a.check deleted file mode 100644 index 2aa46b3b91..0000000000 --- a/test/pending/run/t5610a.check +++ /dev/null @@ -1 +0,0 @@ -Stroke a kitten diff --git a/test/pending/run/t5610a.scala b/test/pending/run/t5610a.scala deleted file mode 100644 index f20b295762..0000000000 --- a/test/pending/run/t5610a.scala +++ /dev/null @@ -1,19 +0,0 @@ -object Test extends App { - class Result(_str: => String) { - lazy val str = _str - } - - def foo(str: => String)(i: Int) = new Result(str) - - def bar(f: Int => Result) = f(42) - - var test: String = null - val result = bar(foo(test)) - test = "bar" - - if (result.str == null) { - println("Destroy ALL THE THINGS!!!") - } else { - println("Stroke a kitten") - } -}
\ No newline at end of file diff --git a/test/pending/run/t7733.check b/test/pending/run/t7733.check new file mode 100644 index 0000000000..19765bd501 --- /dev/null +++ b/test/pending/run/t7733.check @@ -0,0 +1 @@ +null diff --git a/test/pending/run/t7733/Separate_1.scala b/test/pending/run/t7733/Separate_1.scala new file mode 100644 index 0000000000..a326ecd53e --- /dev/null +++ b/test/pending/run/t7733/Separate_1.scala @@ -0,0 +1,5 @@ +package test + +class Separate { + for (i <- 1 to 10) println(i) +}
\ No newline at end of file diff --git a/test/pending/run/t7733/Test_2.scala b/test/pending/run/t7733/Test_2.scala new file mode 100644 index 0000000000..28358574ec --- /dev/null +++ b/test/pending/run/t7733/Test_2.scala @@ -0,0 +1,9 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} +import scala.tools.reflect.ToolBox + +object Test extends App { + val tb = cm.mkToolBox() + val code = tb.parse("{ val x: test.Separate$$anonfun$1 = null; x }") + println(tb.eval(code)) +}
\ No newline at end of file |