diff options
Diffstat (limited to 'test/pending')
182 files changed, 709 insertions, 1421 deletions
diff --git a/test/pending/continuations-pos/t3620.scala b/test/pending/continuations-pos/t3620.scala deleted file mode 100644 index 8496ae2858..0000000000 --- a/test/pending/continuations-pos/t3620.scala +++ /dev/null @@ -1,73 +0,0 @@ -import scala.collection.mutable.HashMap -import scala.util.continuations._ - -object Test extends Application { - - class Store[K,V] { - - trait Waiting { - def key: K - def inform(value: V): Unit - } - - private val map = new HashMap[K, V] - private var waiting: List[Waiting] = Nil - - def waitFor(k: K, f: (V => Unit)) { - map.get(k) match { - case Some(v) => f(v) - case None => { - val w = new Waiting { - def key = k - def inform(v: V) = f(v) - } - waiting = w :: waiting - } - } - } - - - def add(key: K, value: V) { - map(key) = value - val p = waiting.partition(_.key == key) - waiting = p._2 - p._1.foreach(_.inform(value)) - } - - def required(key: K) = { - shift { - c: (V => Unit) => { - waitFor(key, c) - } - } - } - - def option(key: Option[K]) = { - shift { - c: (Option[V] => Unit) => { - key match { - case Some(key) => waitFor(key, (v: V) => c(Some(v))) - case None => c(None) - } - - } - } - } - - } - - val store = new Store[String, Int] - - def test(p: Option[String]): Unit = { - reset { - // uncommenting the following two lines makes the compiler happy! -// val o = store.option(p) -// println(o) - val i = store.option(p).getOrElse(1) - println(i) - } - } - - test(Some("a")) - -} diff --git a/test/pending/continuations-run/example0.scala b/test/pending/continuations-run/example0.scala deleted file mode 100644 index de5ea54e9d..0000000000 --- a/test/pending/continuations-run/example0.scala +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ - -object Test { - - def main(args: Array[String]): Any = { - examples.continuations.Test0.main(args) - } - -}
\ No newline at end of file diff --git a/test/pending/continuations-run/example1.scala b/test/pending/continuations-run/example1.scala deleted file mode 100644 index e31d6af88c..0000000000 --- a/test/pending/continuations-run/example1.scala +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ - -object Test { - - def main(args: Array[String]): Any = { - examples.continuations.Test1.main(args) - } - -}
\ No newline at end of file diff --git a/test/pending/continuations-run/example16.scala b/test/pending/continuations-run/example16.scala deleted file mode 100644 index 561f0ab0eb..0000000000 --- a/test/pending/continuations-run/example16.scala +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ - -object Test { - - def main(args: Array[String]): Any = { - examples.continuations.Test16Printf.main(args) - } - -}
\ No newline at end of file diff --git a/test/pending/continuations-run/example2.scala b/test/pending/continuations-run/example2.scala deleted file mode 100644 index 730f7cc63e..0000000000 --- a/test/pending/continuations-run/example2.scala +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ - -object Test { - - def main(args: Array[String]): Any = { - examples.continuations.Test2.main(args) - } - -}
\ No newline at end of file diff --git a/test/pending/continuations-run/example3.scala b/test/pending/continuations-run/example3.scala deleted file mode 100644 index 41cf1cce0c..0000000000 --- a/test/pending/continuations-run/example3.scala +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ - -object Test { - - def main(args: Array[String]): Any = { - examples.continuations.Test3.main(args) - } - -}
\ No newline at end of file diff --git a/test/pending/continuations-run/example4.scala b/test/pending/continuations-run/example4.scala deleted file mode 100644 index adcc7aa90e..0000000000 --- a/test/pending/continuations-run/example4.scala +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ - -object Test { - - def main(args: Array[String]): Any = { - examples.continuations.Test4.main(args) - } - -}
\ No newline at end of file diff --git a/test/pending/continuations-run/example5.scala b/test/pending/continuations-run/example5.scala deleted file mode 100644 index 241e8cd069..0000000000 --- a/test/pending/continuations-run/example5.scala +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ - -object Test { - - def main(args: Array[String]): Any = { - examples.continuations.Test5.main(args) - } - -}
\ No newline at end of file diff --git a/test/pending/continuations-run/example6.scala b/test/pending/continuations-run/example6.scala deleted file mode 100644 index 00f84fcd6c..0000000000 --- a/test/pending/continuations-run/example6.scala +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ - -object Test { - - def main(args: Array[String]): Any = { - examples.continuations.Test6.main(args) - } - -}
\ No newline at end of file diff --git a/test/pending/continuations-run/example7.scala b/test/pending/continuations-run/example7.scala deleted file mode 100644 index 64abc6d9a6..0000000000 --- a/test/pending/continuations-run/example7.scala +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ - -object Test { - - def main(args: Array[String]): Any = { - examples.continuations.Test7.main(args) - } - -}
\ No newline at end of file diff --git a/test/pending/continuations-run/example8.scala b/test/pending/continuations-run/example8.scala deleted file mode 100644 index a5f953d3fc..0000000000 --- a/test/pending/continuations-run/example8.scala +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ - -object Test { - - def main(args: Array[String]): Any = { - examples.continuations.Test8.main(args) - } - -}
\ No newline at end of file diff --git a/test/pending/continuations-run/example9.scala b/test/pending/continuations-run/example9.scala deleted file mode 100644 index 09d792c427..0000000000 --- a/test/pending/continuations-run/example9.scala +++ /dev/null @@ -1,9 +0,0 @@ -// $Id$ - -object Test { - - def main(args: Array[String]): Any = { - examples.continuations.Test9Monads.main(args) - } - -}
\ No newline at end of file diff --git a/test/pending/continuations-run/foreach.check b/test/pending/continuations-run/foreach.check deleted file mode 100644 index 9bab7a2eed..0000000000 --- a/test/pending/continuations-run/foreach.check +++ /dev/null @@ -1,4 +0,0 @@ -1 -2 -3 -enough is enough
\ No newline at end of file diff --git a/test/pending/continuations-run/foreach.scala b/test/pending/continuations-run/foreach.scala deleted file mode 100644 index 76823e7604..0000000000 --- a/test/pending/continuations-run/foreach.scala +++ /dev/null @@ -1,33 +0,0 @@ -// $Id$ - -import scala.util.continuations._ - -import scala.util.continuations.Loops._ - -object Test { - - def main(args: Array[String]): Any = { - - - reset { - - val list = List(1,2,3,4,5) - - for (x <- list.suspendable) { - - shift { k: (Unit => Unit) => - println(x) - if (x < 3) - k() - else - println("enough is enough") - } - - } - - } - - - } - -}
\ No newline at end of file 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/macro-invalidusage-badbounds-b/Impls_1.scala b/test/pending/neg/macro-invalidusage-badbounds-b/Impls_1.scala index 89020de7dd..be47d5cec4 100644 --- a/test/pending/neg/macro-invalidusage-badbounds-b/Impls_1.scala +++ b/test/pending/neg/macro-invalidusage-badbounds-b/Impls_1.scala @@ -1,5 +1,5 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Impls { - def foo[U <: String](c: Ctx) = ??? + def foo[U <: String](c: Context) = ??? } 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/misc/scalac-plugin.xml b/test/pending/neg/plugin-after-terminal/misc/scalac-plugin.xml deleted file mode 100644 index 90ff27dc2a..0000000000 --- a/test/pending/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/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/src/ThePlugin.scala b/test/pending/neg/plugin-cyclic-dependency/src/ThePlugin.scala deleted file mode 100644 index bd94ce60d7..0000000000 --- a/test/pending/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/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/t2066.scala b/test/pending/neg/t2066.scala deleted file mode 100644 index 46177b19f7..0000000000 --- a/test/pending/neg/t2066.scala +++ /dev/null @@ -1,16 +0,0 @@ -object Test extends App { - trait A { - def f[T[_]](x : T[Int]) : T[Any] - } - - class B extends A { - def f[T[+_]](x : T[Int]) : T[Any] = x - } - - class P[Y](var y : Y) - - val p = new P(1) - val palias = (new B():A).f[P](p) - palias.y = "hello" - val z: Int = p.y -}
\ No newline at end of file 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/t5589neg.flags b/test/pending/neg/t5589neg.flags new file mode 100644 index 0000000000..dcc59ebe32 --- /dev/null +++ b/test/pending/neg/t5589neg.flags @@ -0,0 +1 @@ +-deprecation diff --git a/test/pending/neg/t5589neg2.check b/test/pending/neg/t5589neg2.check new file mode 100644 index 0000000000..6af4955a83 --- /dev/null +++ b/test/pending/neg/t5589neg2.check @@ -0,0 +1,9 @@ +t5589neg2.scala:7: error: constructor cannot be instantiated to expected type; + found : (T1, T2) + required: String + for (((((a, (b, (c, (d1, d2)))), es), fs), gs) <- x) yield (d :: es).mkString(", ") // not ok + ^ +t5589neg2.scala:7: error: not found: value d + for (((((a, (b, (c, (d1, d2)))), es), fs), gs) <- x) yield (d :: es).mkString(", ") // not ok + ^ +two errors found diff --git a/test/pending/neg/t7886.scala b/test/pending/neg/t7886.scala new file mode 100644 index 0000000000..55d80a0a43 --- /dev/null +++ b/test/pending/neg/t7886.scala @@ -0,0 +1,22 @@ +trait Covariant[+A] +trait Contra[-A] { def accept(p: A): Unit } +trait Invariant[A] extends Covariant[A] with Contra[A] + +case class Unravel[A](m: Contra[A], msg: A) + +object Test extends Covariant[Any] { + def g(m: Contra[Any]): Unit = m accept 5 + def f(x: Any): Unit = x match { + case Unravel(m, msg) => g(m) + case _ => + } + def main(args: Array[String]) { + f(Unravel[String](new Contra[String] { def accept(x: String) = x.length }, "")) + } +} +// java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String +// at Test$$anon$1.accept(a.scala:18) +// at Test$.g(a.scala:13) +// at Test$.f(a.scala:15) +// at Test$.main(a.scala:18) +// at Test.main(a.scala) diff --git a/test/pending/neg/t7886b.scala b/test/pending/neg/t7886b.scala new file mode 100644 index 0000000000..1db8be9821 --- /dev/null +++ b/test/pending/neg/t7886b.scala @@ -0,0 +1,23 @@ +trait Covariant[+A] +trait Contra[-A] { def accept(p: A): Unit } +trait Invariant[A] extends Covariant[A] with Contra[A] + +trait T +case class Unravel[A](m: Contra[A], msg: A) extends T + +object Test extends Covariant[Any] { + def g(m: Contra[Any]): Unit = m accept 5 + def f(x: T): Unit = x match { + case Unravel(m, msg) => g(m) + case _ => + } + def main(args: Array[String]) { + f(Unravel[String](new Contra[String] { def accept(x: String) = x.length }, "")) + } +} +// java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String +// at Test$$anon$1.accept(a.scala:18) +// at Test$.g(a.scala:13) +// at Test$.f(a.scala:15) +// at Test$.main(a.scala:18) +// at Test.main(a.scala) 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/pattern-typing.scala b/test/pending/pos/pattern-typing.scala new file mode 100644 index 0000000000..7286cc38af --- /dev/null +++ b/test/pending/pos/pattern-typing.scala @@ -0,0 +1,29 @@ +import scala.language.higherKinds + +trait Bound[B] + +package p1 { + case class Sub[B <: Bound[B]](p: B) + object Test { + def g[A](x: Bound[A]) = () + def f(x: Any) = x match { case Sub(p) => g(p) } + } +} + +package p2 { + trait Traversable[+A] { def head: A = ??? } + trait Seq[+A] extends Traversable[A] { def length: Int = ??? } + + case class SubHK[B <: Bound[B], CC[X] <: Traversable[X]](xs: CC[B]) + class MyBound extends Bound[MyBound] + class MySeq extends Seq[MyBound] + + object Test { + def g[B](x: Bound[B]) = () + + def f1(x: Any) = x match { case SubHK(xs) => xs } + def f2[B <: Bound[B], CC[X] <: Traversable[X]](sub: SubHK[B, CC]): CC[B] = sub match { case SubHK(xs) => xs } + def f3 = g(f1(SubHK(new MySeq)).head) + def f4 = g(f2(SubHK(new MySeq)).head) + } +} 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 index dca2edaab4..6299eb9eae 100644 --- a/test/pending/pos/t1786.scala +++ b/test/pending/pos/t1786.scala @@ -1,20 +1,27 @@ -/** 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. - * +/** 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. + * Alternatively, we can pursue a more extensive fix to SI-6169 * - */ + * The below code shows a compiler flaw in that the wildcard "_" as value for a bounded type parameter either + * breaks the boundary - as it result in Any - or doesn't evaluate to the boundary (as I'd hoped it to be). +*/ + class SomeClass(val intValue:Int) -class MyClass[T <: SomeClass](val myValue:T) +class MyClass[T <: SomeClass](val myValue:T) +class Flooz[A >: Null <: SomeClass, T >: Null <: A](var value: T) -object Test extends Application { - def myMethod(i:MyClass[_]) { - i.myValue.intValue/2 // << error i is of type Any - } +class A { + def f1(i:MyClass[_]) = i.myValue.intValue + def f2(i:MyClass[_ <: SomeClass]) = i.myValue.intValue + // def f3[T](i: MyClass[T]) = i.myValue.intValue + def f4[T <: SomeClass](i: MyClass[T]) = i.myValue.intValue + // def f5[T >: Null](i: MyClass[T]) = i.myValue.intValue + // def f6[T >: Null <: String](i: MyClass[T]) = i.myValue.intValue + i.myValue.charAt(0) - def myMethod(i:MyClass[_ <: SomeClass]) { - i.myValue.intValue/2 // << works - } + // def g1[A, T](x: Flooz[A, T]) = { x.value = null ; x.value.intValue } + def g2(x: Flooz[_, _]) = { x.value = null ; x.value.intValue } + + class MyClass2(x: MyClass[_]) { val p = x.myValue.intValue } + // class MyClass3[T <: String](x: MyClass[T]) { val p = x.myValue.intValue + x.myValue.length } + // class MyClass4[T >: Null](x: MyClass[T]) { val p = x.myValue.intValue } } -/* -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/t5459.scala b/test/pending/pos/t5459.scala new file mode 100644 index 0000000000..971e6f896d --- /dev/null +++ b/test/pending/pos/t5459.scala @@ -0,0 +1,48 @@ +trait A1 +trait A2 +trait A3 +trait L1 extends A1 with A2 with A3 + +object Test { + trait T1[-A <: A1] + trait T2[-A >: L1] + trait T3[ A <: A1] + trait T4[ A >: L1] + trait T5[+A <: A1] + trait T6[+A >: L1] + + def f1(x: T1[_]) = x + def f2(x: T2[_]) = x + def f3(x: T3[_]) = x + def f4(x: T4[_]) = x + def f5(x: T5[_]) = x + def f6(x: T6[_]) = x + // a.scala:22: error: type arguments [Any] do not conform to trait T5's type parameter bounds [+A <: A1] + // def f5(x: T5[_]) = x + // ^ + + def g1(x: T1[_ <: A1]) = x + def g2(x: T2[_ >: L1]) = x + def g3(x: T3[_ <: A1]) = x + def g4(x: T4[_ >: L1]) = x + def g5(x: T5[_ <: A1]) = x + def g6(x: T6[_ >: L1]) = x + + def q1(x: T1[_ >: L1]) = x + def q2(x: T2[_ <: A1]) = x + def q3(x: T3[_ >: L1]) = x + def q4(x: T4[_ <: A1]) = x + def q5(x: T5[_ >: L1]) = x + def q6(x: T6[_ <: A1]) = x + // a.scala:41: error: type arguments [Any] do not conform to trait T5's type parameter bounds [+A <: A1] + // def q5(x: T5[_ >: L1]) = x + // ^ + // two errors found + + def h1(x: T1[_ >: L1 <: A1]) = x + def h2(x: T2[_ >: L1 <: A1]) = x + def h3(x: T3[_ >: L1 <: A1]) = x + def h4(x: T4[_ >: L1 <: A1]) = x + def h5(x: T5[_ >: L1 <: A1]) = x + def h6(x: T6[_ >: L1 <: A1]) = x +} 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/t6161.scala b/test/pending/pos/t6161.scala new file mode 100644 index 0000000000..5783cc85f2 --- /dev/null +++ b/test/pending/pos/t6161.scala @@ -0,0 +1,22 @@ +object t6161 { + trait N { + type Name + } + + trait N1 extends N { + class Name { + type ThisNameType <: Name + def encode: ThisNameType = ??? + } + } + + trait S { + self: N => // change to N1 and it compiles + type NameType <: Name + } + + object g extends S with N1 + + val n1: g.NameType = ??? + val n2: g.Name = n1.encode +} 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/t8128b.scala b/test/pending/pos/t8128b.scala new file mode 100644 index 0000000000..dd44a25a90 --- /dev/null +++ b/test/pending/pos/t8128b.scala @@ -0,0 +1,18 @@ +class Optiony[X] { def isEmpty = true; def get: X = ??? } +class Seqy[X] { def head: X = ???; def length = 0; def apply(i: Int): X = ??? } + +object G { + def unapply(m: Any): Optiony[_] = ??? +} + +object H { + def unapplySeq(m: Any): Optiony[Seqy[_]] = ??? +} + +object Test { + (0: Any) match { + case G(v) => v + case H(v) => v + case _ => + } +} diff --git a/test/pending/pos/t8363b.scala b/test/pending/pos/t8363b.scala new file mode 100644 index 0000000000..393e2a0237 --- /dev/null +++ b/test/pending/pos/t8363b.scala @@ -0,0 +1,7 @@ +class C(a: Any) +class Test { + def foo: Any = { + def form = 0 + class C1 extends C({def x = form; ()}) + } +} 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/treecheckers.flags b/test/pending/pos/treecheckers.flags new file mode 100644 index 0000000000..5319681590 --- /dev/null +++ b/test/pending/pos/treecheckers.flags @@ -0,0 +1 @@ +-Ycheck:all
\ No newline at end of file diff --git a/test/pending/pos/treecheckers/c1.scala b/test/pending/pos/treecheckers/c1.scala new file mode 100644 index 0000000000..b936839039 --- /dev/null +++ b/test/pending/pos/treecheckers/c1.scala @@ -0,0 +1,12 @@ +object Test1 { + def f[T](xs: Array[T]): Array[T] = xs match { case xs => xs } + // [check: patmat] The symbol, tpe or info of tree `(x) : Array[T]` refers to a out-of-scope symbol, type T. tree.symbol.ownerChain: value x + // [check: patmat] The symbol, tpe or info of tree `(x) : Array[T]` refers to a out-of-scope symbol, type T. tree.symbol.ownerChain: value x + + def g[T](xs: Array[T]): Array[T] = { + val x1: Array[T] = xs + def case4() = matchEnd3(x1) + def matchEnd3(x: Array[T]) = x + case4() + } +} diff --git a/test/pending/pos/treecheckers/c2.scala b/test/pending/pos/treecheckers/c2.scala new file mode 100644 index 0000000000..c893a5c922 --- /dev/null +++ b/test/pending/pos/treecheckers/c2.scala @@ -0,0 +1 @@ +class Test2(val valueVal: Int) extends AnyVal diff --git a/test/pending/pos/treecheckers/c3.scala b/test/pending/pos/treecheckers/c3.scala new file mode 100644 index 0000000000..e480bbfb08 --- /dev/null +++ b/test/pending/pos/treecheckers/c3.scala @@ -0,0 +1,8 @@ +import scala.collection.mutable.ArrayOps + +object Test3 { + implicit def genericArrayOps[T](xs: Array[T]): ArrayOps[T] = (xs match { + case x: Array[AnyRef] => refArrayOps[AnyRef](x) + case x: Array[Boolean] => booleanArrayOps(x) + }).asInstanceOf[ArrayOps[T]] +} diff --git a/test/pending/pos/treecheckers/c4.scala b/test/pending/pos/treecheckers/c4.scala new file mode 100644 index 0000000000..2328131770 --- /dev/null +++ b/test/pending/pos/treecheckers/c4.scala @@ -0,0 +1,9 @@ +sealed trait Message[+A] +class Script[A] extends Message[A] { + def iterator: Iterator[Message[A]] = ??? +} + +trait Test4[A] { + def f(cmd: Message[A]): Iterator[A] = cmd match { case s: Script[t] => s.iterator flatMap f } + def g(cmd: Message[A]) = cmd match { case s: Script[t] => s } +} diff --git a/test/pending/pos/treecheckers/c5.scala b/test/pending/pos/treecheckers/c5.scala new file mode 100644 index 0000000000..43cbb65d74 --- /dev/null +++ b/test/pending/pos/treecheckers/c5.scala @@ -0,0 +1,3 @@ +trait Factory[CC[X] <: Traversable[X]] + +object Test5 extends Factory[Traversable] diff --git a/test/pending/pos/treecheckers/c6.scala b/test/pending/pos/treecheckers/c6.scala new file mode 100644 index 0000000000..8283655f3a --- /dev/null +++ b/test/pending/pos/treecheckers/c6.scala @@ -0,0 +1,4 @@ +object Test6 { + import scala.reflect.ClassTag + def f[T: ClassTag] = implicitly[ClassTag[T]].runtimeClass match { case x => x } +} 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/presentation/context-bounds1.check b/test/pending/presentation/context-bounds1.check new file mode 100644 index 0000000000..b444de59a4 --- /dev/null +++ b/test/pending/presentation/context-bounds1.check @@ -0,0 +1,51 @@ +reload: ContextBounds.scala + +askHyperlinkPos for `Blubb` at (2,23) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `Blubb` at (13,7) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `Foo` at (4,17) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `Foo` at (9,7) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `Blubb` at (4,32) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `Blubb` at (13,7) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `A` at (4,42) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `A` at (4,12) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `A` at (4,51) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `A` at (4,12) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `blubb` at (4,66) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `blubb` at (2,7) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `Foo` at (5,18) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `Foo` at (9,7) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `A` at (5,25) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `A` at (4,12) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `foo` at (5,36) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `foo` at (10,7) ContextBounds.scala +================================================================================ + +askHyperlinkPos for `A` at (10,14) ContextBounds.scala +================================================================================ +[response] found askHyperlinkPos for `A` at (9,11) ContextBounds.scala +================================================================================ diff --git a/test/pending/presentation/context-bounds1/Test.scala b/test/pending/presentation/context-bounds1/Test.scala new file mode 100644 index 0000000000..bec1131c4c --- /dev/null +++ b/test/pending/presentation/context-bounds1/Test.scala @@ -0,0 +1,3 @@ +import scala.tools.nsc.interactive.tests.InteractiveTest + +object Test extends InteractiveTest
\ No newline at end of file diff --git a/test/pending/presentation/context-bounds1/src/ContextBounds.scala b/test/pending/presentation/context-bounds1/src/ContextBounds.scala new file mode 100644 index 0000000000..72a8f694a3 --- /dev/null +++ b/test/pending/presentation/context-bounds1/src/ContextBounds.scala @@ -0,0 +1,13 @@ +object ContextBound { + val blubb = new Blubb/*#*/ + + def work[A: Foo/*#*/](f: Blubb/*#*/ => A/*#*/): A/*#*/ = f(blubb/*#*/) ensuring { + implicitly[Foo/*#*/[A/*#*/]].foo/*#*/(_) >= 42 + } +} + +trait Foo[A] { + def foo(a: A/*#*/): Int +} + +class Blubb
\ No newline at end of file diff --git a/test/pending/reify_typeof.check b/test/pending/reify_typeof.check new file mode 100644 index 0000000000..670f76faa4 --- /dev/null +++ b/test/pending/reify_typeof.check @@ -0,0 +1,10 @@ +Expr[Unit]({ + val ru = `package`.universe; + val tpe1: ru.Type = ru.typeOf[`package`.List[Int]]; + Predef.println(tpe1); + val tpe2: ru.Type = ru.typeOf(List.apply(1, 2, 3)); + Predef.println(tpe2) +}) +scala.List[Int] +List[Int] +() diff --git a/test/pending/reify_typeof.scala b/test/pending/reify_typeof.scala new file mode 100644 index 0000000000..985c57b9ab --- /dev/null +++ b/test/pending/reify_typeof.scala @@ -0,0 +1,14 @@ +import scala.reflect.runtime.universe._ +import scala.tools.reflect.Eval + +object Test extends App { + val reified = reify { + val ru = scala.reflect.runtime.universe + val tpe1: ru.Type = ru.typeOf[List[Int]] + println(tpe1) + val tpe2: ru.Type = ru.typeOf(List(1, 2, 3)) + println(tpe2) + } + println(reified) + println(reified.eval) +}
\ 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/idempotency-partial-functions.scala b/test/pending/run/idempotency-partial-functions.scala index bc0ca706dd..b26c442599 100644 --- a/test/pending/run/idempotency-partial-functions.scala +++ b/test/pending/run/idempotency-partial-functions.scala @@ -20,9 +20,9 @@ object Test extends App { case e: ToolBoxError => println(e) } val tb = cm.mkToolBox() - val tpartials = tb.typeCheck(partials.tree) + val tpartials = tb.typecheck(partials.tree) println(tpartials) - val rtpartials = tb.resetAllAttrs(tpartials) + val rtpartials = tb.untypecheck(tpartials) println(tb.eval(rtpartials)) } Test.main(null)
\ No newline at end of file diff --git a/test/pending/run/macro-expand-default/Impls_1.scala b/test/pending/run/macro-expand-default/Impls_1.scala index 7cf8d59c75..fd5d8d7f18 100644 --- a/test/pending/run/macro-expand-default/Impls_1.scala +++ b/test/pending/run/macro-expand-default/Impls_1.scala @@ -1,10 +1,10 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Impls { - def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = { + def foo(c: Context)(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-implicit-macro-defeats-type-inference/Impls_1.scala b/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Impls_1.scala index 15bcb581c8..e8170fda07 100644 --- a/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Impls_1.scala +++ b/test/pending/run/macro-expand-implicit-macro-defeats-type-inference/Impls_1.scala @@ -1,4 +1,4 @@ -import scala.reflect.macros.Context +import scala.reflect.macros.whitebox.Context object Impls { def foo[T: c.WeakTypeTag](c: Context): c.Expr[List[T]] = c.universe.reify { 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..34182b7968 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 @@ -1,10 +1,10 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Impls { - def foo[U](c: Ctx)(x: c.Expr[U])(evidence: c.Expr[Numeric[U]]) = { + def foo[U](c: Context)(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..fd5d8d7f18 100644 --- a/test/pending/run/macro-expand-named/Impls_1.scala +++ b/test/pending/run/macro-expand-named/Impls_1.scala @@ -1,10 +1,10 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Impls { - def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = { + def foo(c: Context)(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..683622b29d 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 @@ -1,12 +1,12 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Impls { - def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { + def foo[T, U: c.WeakTypeTag, V](c: Context)(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..683622b29d 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 @@ -1,12 +1,12 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Impls { - def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { + def foo[T, U: c.WeakTypeTag, V](c: Context)(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-quasiinvalidbody-a/Impls_1.scala b/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala index daedde4021..741a921b72 100644 --- a/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala +++ b/test/pending/run/macro-quasiinvalidbody-a/Impls_1.scala @@ -1,5 +1,5 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context trait Impls { - def impl(c: Ctx)(x: c.Expr[Any]) = x + def impl(c: Context)(x: c.Expr[Any]) = x }
\ No newline at end of file diff --git a/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala b/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala index 27140a77ad..2735321eae 100644 --- a/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala +++ b/test/pending/run/macro-quasiinvalidbody-a/Macros_Test_2.scala @@ -1,4 +1,4 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Macros extends Impls { def foo(x: Any) = macro impl diff --git a/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala b/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala index 246fc9f904..b023d31f05 100644 --- a/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala +++ b/test/pending/run/macro-quasiinvalidbody-b/Impls_1.scala @@ -1,7 +1,7 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context trait ImplContainer { object Impls { - def foo(c: Ctx)(x: c.Expr[Any]) = x + def foo(c: Context)(x: c.Expr[Any]) = x } }
\ No newline at end of file diff --git a/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala b/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala index da9445ac52..639d93fb5f 100644 --- a/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala +++ b/test/pending/run/macro-quasiinvalidbody-b/Macros_Test_2.scala @@ -1,4 +1,4 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Macros extends ImplContainer { def foo(x: Any) = macro Impls.foo diff --git a/test/pending/run/macro-reify-array/Macros_1.scala b/test/pending/run/macro-reify-array/Macros_1.scala index f970be5caa..eea0133feb 100644 --- a/test/pending/run/macro-reify-array/Macros_1.scala +++ b/test/pending/run/macro-reify-array/Macros_1.scala @@ -1,10 +1,10 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Macros { def foo[T](s: String) = macro Impls.foo[T] object Impls { - def foo[T: c.WeakTypeTag](c: Ctx)(s: c.Expr[T]) = c.universe.reify { + def foo[T: c.WeakTypeTag](c: Context)(s: c.Expr[T]) = c.universe.reify { Array(s.splice) } } diff --git a/test/pending/run/macro-reify-tagful-b/Macros_1.scala b/test/pending/run/macro-reify-tagful-b/Macros_1.scala index 59dbe7157b..f4d8062a14 100644 --- a/test/pending/run/macro-reify-tagful-b/Macros_1.scala +++ b/test/pending/run/macro-reify-tagful-b/Macros_1.scala @@ -1,10 +1,10 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Macros { def foo[T](s: T) = macro Impls.foo[List[T]] object Impls { - def foo[T: c.WeakTypeTag](c: Ctx)(s: c.Expr[T]) = c.universe.reify { + def foo[T: c.WeakTypeTag](c: Context)(s: c.Expr[T]) = c.universe.reify { List(s.splice) } } diff --git a/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala b/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala index a581c47026..1307052394 100644 --- a/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala +++ b/test/pending/run/macro-reify-tagless-b/Impls_Macros_1.scala @@ -1,10 +1,10 @@ -import scala.reflect.macros.{Context => Ctx} +import scala.reflect.macros.blackbox.Context object Macros { def foo[T](s: T) = macro Impls.foo[List[T]] object Impls { - def foo[T](c: Ctx)(s: c.Expr[T]) = c.universe.reify { + def foo[T](c: Context)(s: c.Expr[T]) = c.universe.reify { List(s.splice) } } 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/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..c43f5f3f53 --- /dev/null +++ b/test/pending/run/macro-term-declared-in-anonymous-explicit-import/Impls_1.scala @@ -0,0 +1,11 @@ +import scala.reflect.macros.blackbox.Context + +object Impls { + def foo(c: Context) = { + 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_callccinterpreter.scala b/test/pending/run/reify_callccinterpreter.scala index d9f7736769..82c70da28f 100644 --- a/test/pending/run/reify_callccinterpreter.scala +++ b/test/pending/run/reify_callccinterpreter.scala @@ -43,15 +43,15 @@ object Test extends App { override def toString() = "<function>" } - type Environment = List[Pair[Name, Value]]; + type Environment = List[Tuple2[Name, Value]]; def lookup(x: Name, e: Environment): M[Value] = e match { case List() => unitM(Wrong) - case Pair(y, b) :: e1 => if (x == y) unitM(b) else lookup(x, e1) + case (y, b) :: e1 => if (x == y) unitM(b) else lookup(x, e1) } - def add(a: Value, b: Value): M[Value] = Pair(a, b) match { - case Pair(Num(m), Num(n)) => unitM(Num(m + n)) + def add(a: Value, b: Value): M[Value] = (a, b) match { + case (Num(m), Num(n)) => unitM(Num(m + n)) case _ => unitM(Wrong) } @@ -67,12 +67,12 @@ object Test extends App { b <- interp(r, e); c <- add(a, b)) yield c - case Lam(x, t) => unitM(Fun(a => interp(t, Pair(x, a) :: e))) + case Lam(x, t) => unitM(Fun(a => interp(t, (x, a) :: e))) case App(f, t) => for (a <- interp(f, e); b <- interp(t, e); c <- apply(a, b)) yield c - case Ccc(x, t) => callCC(k => interp(t, Pair(x, Fun(k)) :: e)) + case Ccc(x, t) => callCC(k => interp(t, (x, Fun(k)) :: e)) } def test(t: Term): String = showM(interp(t, List())) 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/reify_simpleinterpreter.scala b/test/pending/run/reify_simpleinterpreter.scala index 6cf87ea7c5..1f6d6c8da7 100644 --- a/test/pending/run/reify_simpleinterpreter.scala +++ b/test/pending/run/reify_simpleinterpreter.scala @@ -32,15 +32,15 @@ object Test extends App { override def toString() = "<function>" } - type Environment = List[Pair[Name, Value]] + type Environment = List[Tuple2[Name, Value]] def lookup(x: Name, e: Environment): M[Value] = e match { case List() => unitM(Wrong) - case Pair(y, b) :: e1 => if (x == y) unitM(b) else lookup(x, e1) + case (y, b) :: e1 => if (x == y) unitM(b) else lookup(x, e1) } - def add(a: Value, b: Value): M[Value] = Pair(a, b) match { - case Pair(Num(m), Num(n)) => unitM(Num(m + n)) + def add(a: Value, b: Value): M[Value] = (a, b) match { + case (Num(m), Num(n)) => unitM(Num(m + n)) case _ => unitM(Wrong) } @@ -56,7 +56,7 @@ object Test extends App { b <- interp(r, e); c <- add(a, b)) yield c - case Lam(x, t) => unitM(Fun(a => interp(t, Pair(x, a) :: e))) + case Lam(x, t) => unitM(Fun(a => interp(t, (x, a) :: e))) case App(f, t) => for (a <- interp(f, e); b <- interp(t, e); c <- apply(a, b)) 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/t4728.check b/test/pending/run/t4728.check deleted file mode 100644 index 7a754f414c..0000000000 --- a/test/pending/run/t4728.check +++ /dev/null @@ -1,2 +0,0 @@ -1 -2
\ No newline at end of file diff --git a/test/pending/run/t4728.scala b/test/pending/run/t4728.scala deleted file mode 100644 index 36f7860613..0000000000 --- a/test/pending/run/t4728.scala +++ /dev/null @@ -1,11 +0,0 @@ -class X -class Y extends X -object Ambiguous { - def f(x: X) = 1 - def f(ys: Y*) = 2 -} - -object Test extends App { - println(Ambiguous.f(new X)) - println(Ambiguous.f(new Y)) -}
\ No newline at end of file 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.check b/test/pending/run/t5418.check deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/pending/run/t5418.check +++ /dev/null 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/t5866b.scala b/test/pending/run/t5866b.scala new file mode 100644 index 0000000000..44d8b114b8 --- /dev/null +++ b/test/pending/run/t5866b.scala @@ -0,0 +1,17 @@ +class Foo(val d: Double) extends AnyVal { + override def toString = s"Foo($d)" +} + +class Bar(val d: String) extends AnyVal { + override def toString = s"Foo($d)" +} + +object Test { + def main(args: Array[String]): Unit = { + val f: Foo = {val n: Any = null; n.asInstanceOf[Foo]} + println(f) + + val b: Bar = {val n: Any = null; n.asInstanceOf[Bar]} + println(b) + } +} diff --git a/test/pending/run/t5943b1.scala b/test/pending/run/t5943b1.scala index 0d54718753..79c638fedc 100644 --- a/test/pending/run/t5943b1.scala +++ b/test/pending/run/t5943b1.scala @@ -6,5 +6,5 @@ import scala.tools.reflect.ToolBox object Test extends App { val tb = cm.mkToolBox() val expr = tb.parse("math.sqrt(4.0)") - println(tb.typeCheck(expr)) + println(tb.typecheck(expr)) }
\ 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 diff --git a/test/pending/run/virtpatmat_anonfun_underscore.check b/test/pending/run/virtpatmat_anonfun_underscore.check deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/pending/run/virtpatmat_anonfun_underscore.check +++ /dev/null diff --git a/test/pending/shootout/fasta.scala b/test/pending/shootout/fasta.scala index 8b711083a5..ae99ba5936 100644 --- a/test/pending/shootout/fasta.scala +++ b/test/pending/shootout/fasta.scala @@ -5,7 +5,7 @@ import java.io._ -object fasta { +object fasta { def main(args: Array[String]) = { val ALU = @@ -18,31 +18,31 @@ object fasta { "AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA" val _IUB = Array( - Pair('a', 0.27), - Pair('c', 0.12), - Pair('g', 0.12), - Pair('t', 0.27), - - Pair('B', 0.02), - Pair('D', 0.02), - Pair('H', 0.02), - Pair('K', 0.02), - Pair('M', 0.02), - Pair('N', 0.02), - Pair('R', 0.02), - Pair('S', 0.02), - Pair('V', 0.02), - Pair('W', 0.02), - Pair('Y', 0.02) + ('a', 0.27), + ('c', 0.12), + ('g', 0.12), + ('t', 0.27), + + ('B', 0.02), + ('D', 0.02), + ('H', 0.02), + ('K', 0.02), + ('M', 0.02), + ('N', 0.02), + ('R', 0.02), + ('S', 0.02), + ('V', 0.02), + ('W', 0.02), + ('Y', 0.02) ) val IUB = makeCumulative(_IUB) val _HomoSapiens = Array( - Pair('a', 0.3029549426680), - Pair('c', 0.1979883004921), - Pair('g', 0.1975473066391), - Pair('t', 0.3015094502008) + ('a', 0.3029549426680), + ('c', 0.1979883004921), + ('g', 0.1975473066391), + ('t', 0.3015094502008) ) val HomoSapiens = makeCumulative(_HomoSapiens) @@ -61,15 +61,15 @@ object fasta { s.writeRandomSequence(HomoSapiens,n*5) s.close - } + } - def makeCumulative(a: Array[Pair[Char,Double]]) = { + def makeCumulative(a: Array[Tuple2[Char,Double]]) = { var cp = 0.0 a map (frequency => - frequency match { - case Pair(code,percent) => - cp = cp + percent; new Frequency(code.toByte,cp) - } + frequency match { + case (code,percent) => + cp = cp + percent; new Frequency(code.toByte,cp) + } ) } @@ -79,7 +79,7 @@ object fasta { // We could use instances of Pair or Tuple2 but specific labels // make the code more readable than index numbers -class Frequency(_code: Byte, _percent: Double){ +class Frequency(_code: Byte, _percent: Double){ var code = _code; var percent = _percent; } @@ -101,13 +101,13 @@ class FastaOutputStream(out: OutputStream) extends BufferedOutputStream(out) { val m = if (n < LineLength) n else LineLength var i = 0 - while (i < m){ + while (i < m){ if (k == kn) k = 0 val b = alu(k) if (count < buf.length){ buf(count) = b; count = count + 1 } else { write(b) } // flush buffer k = k+1 - i = i+1 + i = i+1 } write(nl) @@ -122,11 +122,11 @@ class FastaOutputStream(out: OutputStream) extends BufferedOutputStream(out) { val m = if (n < LineLength) n else LineLength var i = 0 - while (i < m){ + while (i < m){ val b = selectRandom(distribution) if (count < buf.length){ buf(count) = b; count = count + 1 } else { write(b) } // flush buffer - i = i+1 + i = i+1 } if (count < buf.length){ buf(count) = nl; count = count + 1 } diff --git a/test/pending/shootout/revcomp.scala-2.scala b/test/pending/shootout/revcomp.scala-2.scala index 92260ad021..03fb25af1b 100644 --- a/test/pending/shootout/revcomp.scala-2.scala +++ b/test/pending/shootout/revcomp.scala-2.scala @@ -6,7 +6,7 @@ import java.io._ import scala.collection.mutable.Stack -object revcomp { +object revcomp { val IUB = IUBCodeComplements @@ -16,7 +16,7 @@ object revcomp { val a: Array[Byte] = new Array( 'z'.toByte ) for (indexValue <- code zip comp) - indexValue match { case Pair(i,v) => a(i) = v } + indexValue match { case (i,v) => a(i) = v } a } @@ -49,18 +49,18 @@ object revcomp { if (desc.length > 0) complementReverseWrite(desc, lines, w) w.close - } + } - def complementReverseWrite(desc: String, lines: LineStack, + def complementReverseWrite(desc: String, lines: LineStack, w: BufferedOutputStream) = { def inplaceComplementReverse(b: Array[Byte]) = { - var i = 0 + var i = 0 var j = b.length - 1 while (i < j){ - val swap = b(i) - b(i) = IUB( b(j) ) + val swap = b(i) + b(i) = IUB( b(j) ) b(j) = IUB( swap ) i = i + 1 j = j - 1 @@ -79,11 +79,11 @@ object revcomp { while (!lines.isEmpty) { val line = lines.pop inplaceComplementReverse(line) - + if (isSplitLine){ if (isFirstLine){ w.write(line); isFirstLine = false } else { w.write(line,0,n-k); w.write(nl); w.write(line,n-k,k) } - } + } else { w.write(line); w.write(nl) } } if (isSplitLine && !isFirstLine) w.write(nl) diff --git a/test/pending/shootout/revcomp.scala-3.scala b/test/pending/shootout/revcomp.scala-3.scala index ae12f0499b..39a0409127 100644 --- a/test/pending/shootout/revcomp.scala-3.scala +++ b/test/pending/shootout/revcomp.scala-3.scala @@ -6,7 +6,7 @@ import java.io._ import scala.collection.mutable.Stack -object revcomp { +object revcomp { def main(args: Array[String]) = { val out = new FastaOutputStream(System.out) val in = new FastaInputStream(System.in) @@ -17,12 +17,12 @@ object revcomp { in.close out.close - } + } } trait FastaByteStream { - val nl = '\n'.toByte + val nl = '\n'.toByte type Line = Array[Byte] type LineStack = Stack[Line] @@ -31,13 +31,13 @@ trait FastaByteStream { // extend the Java BufferedInputStream class -final class FastaInputStream(in: InputStream) +final class FastaInputStream(in: InputStream) extends BufferedInputStream(in) with FastaByteStream { val gt = '>'.toByte val sc = ';'.toByte - def readSequenceStack(): Pair[Line,LineStack] = { + def readSequenceStack(): Tuple2[Line,LineStack] = { var header: Line = null val lines: LineStack = new Stack @@ -49,14 +49,14 @@ final class FastaInputStream(in: InputStream) header = line } else { pos = pos - line.length - 1 // reposition to start of line - return Pair(header,lines) + return (header,lines) } } else { if (c != sc) lines push line // ';' } line = readLine() } - return Pair(header,lines) + return (header,lines) } def readLine() = { @@ -65,7 +65,7 @@ final class FastaInputStream(in: InputStream) else { mark(128) // mark the start of the line if (count == 0) read() // fill buffer - + var i = markpos while (i < count && buf(i) != nl) i = i + 1 @@ -74,11 +74,11 @@ final class FastaInputStream(in: InputStream) while (i < count && buf(i) != nl) i = i + 1 } - if (i < count){ + if (i < count){ bytes = new Array(i - markpos) System.arraycopy(buf, markpos, bytes, 0, i - markpos); pos = i+1 - } + } } bytes } @@ -87,7 +87,7 @@ final class FastaInputStream(in: InputStream) // extend the Java BufferedOutputStream class -final class FastaOutputStream(in: OutputStream) +final class FastaOutputStream(in: OutputStream) extends BufferedOutputStream(in) with FastaByteStream { private val IUB = IUBCodeComplements @@ -98,19 +98,19 @@ final class FastaOutputStream(in: OutputStream) val iub: Array[Byte] = new Array( 'z'.toByte ) for (indexValue <- code zip comp) - indexValue match { case Pair(i,v) => iub(i) = v } + indexValue match { case (i,v) => iub(i) = v } iub } - def writeReverseComplement(sequence: Pair[Line,LineStack]) = { + def writeReverseComplement(sequence: Tuple2[Line,LineStack]) = { def inplaceComplementReverse(b: Array[Byte]) = { - var i = 0 + var i = 0 var j = b.length - 1 while (i < j){ - val swap = b(i) - b(i) = IUB( b(j) ) + val swap = b(i) + b(i) = IUB( b(j) ) b(j) = IUB( swap ) i = i + 1 j = j - 1 @@ -119,7 +119,7 @@ final class FastaOutputStream(in: OutputStream) } sequence match { - case Pair(header,lines) => { + case (header,lines) => { write(header); write(nl) @@ -131,11 +131,11 @@ final class FastaOutputStream(in: OutputStream) while (!lines.isEmpty) { val line = lines.pop inplaceComplementReverse(line) - + if (isSplitLine){ - if (isFirstLine){ write(line); isFirstLine = false } + if (isFirstLine){ write(line); isFirstLine = false } else { write(line,0,LineLength-k); write(nl); write(line,LineLength-k,k) } - } + } else { write(line); write(nl) } } diff --git a/test/pending/t7629-view-bounds-removal.check b/test/pending/t7629-view-bounds-removal.check new file mode 100644 index 0000000000..dc52105eaf --- /dev/null +++ b/test/pending/t7629-view-bounds-removal.check @@ -0,0 +1,9 @@ +t7629-view-bounds-removal.scala:2: error: View bounds have been removed. Use an implicit parameter instead. +Example: Instead of `def f[A <% Int](a: A)` use `def f[A](a: A)(implicit ev: A => Int)`. + def f[A <% Int](a: A) = null + ^ +t7629-view-bounds-removal.scala:3: error: View bounds have been removed. Use an implicit parameter instead. +Example: Instead of `def f[A <% Int](a: A)` use `def f[A](a: A)(implicit ev: A => Int)`. + def g[C, B <: C, A <% B : Numeric](a: A) = null + ^ +two errors found diff --git a/test/pending/t7629-view-bounds-removal.flags b/test/pending/t7629-view-bounds-removal.flags new file mode 100644 index 0000000000..29f4ede37a --- /dev/null +++ b/test/pending/t7629-view-bounds-removal.flags @@ -0,0 +1 @@ +-Xfuture diff --git a/test/pending/t7629-view-bounds-removal.scala b/test/pending/t7629-view-bounds-removal.scala new file mode 100644 index 0000000000..a6ede1fcc3 --- /dev/null +++ b/test/pending/t7629-view-bounds-removal.scala @@ -0,0 +1,4 @@ +object Test { + def f[A <% Int](a: A) = null + def g[C, B <: C, A <% B : Numeric](a: A) = null +} diff --git a/test/pending/typetags_typeof_x.check b/test/pending/typetags_typeof_x.check new file mode 100644 index 0000000000..832a8bc63c --- /dev/null +++ b/test/pending/typetags_typeof_x.check @@ -0,0 +1,8 @@ +List[T] +C +Int +List[Any] +AnyRef{def x: Int} +Null +Nothing +Null diff --git a/test/pending/typetags_typeof_x.scala b/test/pending/typetags_typeof_x.scala new file mode 100644 index 0000000000..08be6d4527 --- /dev/null +++ b/test/pending/typetags_typeof_x.scala @@ -0,0 +1,14 @@ +import scala.reflect.runtime.universe._ + +object Test extends App { + def foo[T](x: T) = weakTypeOf(List(x)) + println(foo(2)) + locally { class C; println(weakTypeOf(new C)) } + + println(typeOf(2)) + println(typeOf(List(1, "1"))) + println(typeOf(new { def x = 2 })) + println(typeOf[Null]) + println(typeOf[Nothing]) + println(typeOf(null)) +}
\ No newline at end of file |