diff options
54 files changed, 710 insertions, 276 deletions
diff --git a/src/compiler/scala/reflect/reify/phases/Reshape.scala b/src/compiler/scala/reflect/reify/phases/Reshape.scala index bc2dbeed3e..5f53f558b4 100644 --- a/src/compiler/scala/reflect/reify/phases/Reshape.scala +++ b/src/compiler/scala/reflect/reify/phases/Reshape.scala @@ -167,7 +167,7 @@ trait Reshape { // if this assumption fails, please, don't be quick to add postprocessing here (like I did before) // but rather try to fix this in Typer, so that it produces quality originals (like it's done for typedAnnotated) if (reifyDebug) println("TypeTree, essential: %s (%s)".format(tt.tpe, tt.tpe.kind)) - if (reifyDebug) println("verdict: rolled back to original %s".format(tt.original)) + if (reifyDebug) println("verdict: rolled back to original %s".format(tt.original.toString.replaceAll("\\s+", " "))) transform(tt.original) } else { // type is deemed to be non-essential diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 8b78ddd59d..d0b59b53cc 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -1105,7 +1105,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter) ("\n" + info1) :: info2 :: info3 mkString "\n\n" } - catch { case x: Exception => errorMessage } + catch { case _: Exception | _: TypeError => errorMessage } /** The id of the currently active run */ diff --git a/src/compiler/scala/tools/nsc/ast/TreeInfo.scala b/src/compiler/scala/tools/nsc/ast/TreeInfo.scala index 6a0f4407fc..0731d78a9b 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeInfo.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeInfo.scala @@ -87,12 +87,4 @@ abstract class TreeInfo extends scala.reflect.internal.TreeInfo { case DocDef(_, definition) => isPureDef(definition) case _ => super.isPureDef(tree) } - - /** Does list of trees start with a definition of - * a class of module with given name (ignoring imports) - */ - override def firstDefinesClassOrObject(trees: List[Tree], name: Name): Boolean = trees match { - case ClassDef(_, `name`, _, _) :: Nil => true - case _ => super.firstDefinesClassOrObject(trees, name) - } } diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index 8e008edde2..565dfde11a 100644 --- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -1008,27 +1008,25 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { if (overriding.isAbstractOverride) om.setFlag(ABSOVERRIDE) typeEnv(om) = env addConcreteSpecMethod(overriding) - info(om) = ( - if (overriding.isDeferred) { // abstract override - debuglog("abstract override " + overriding.fullName + " with specialized " + om.fullName) - Forward(overriding) - } - else { - // if the override is a normalized member, 'om' gets the - // implementation from its original target, and adds the - // environment of the normalized member (that is, any - // specialized /method/ type parameter bindings) - val impl = info get overriding match { - case Some(NormalizedMember(target)) => - typeEnv(om) = env ++ typeEnv(overriding) - target - case _ => - overriding - } - info(overriding) = Forward(om setPos overriding.pos) - SpecialOverride(impl) + if (overriding.isDeferred) { // abstract override + debuglog("abstract override " + overriding.fullName + " with specialized " + om.fullName) + info(om) = Forward(overriding) + } + else { + // if the override is a normalized member, 'om' gets the + // implementation from its original target, and adds the + // environment of the normalized member (that is, any + // specialized /method/ type parameter bindings) + info get overriding match { + case Some(NormalizedMember(target)) => + typeEnv(om) = env ++ typeEnv(overriding) + info(om) = Forward(target) + case _ => + info(om) = SpecialOverride(overriding) } - ) + info(overriding) = Forward(om setPos overriding.pos) + } + newOverload(overriding, om, env) ifDebug(exitingSpecialize(assert( overridden.owner.info.decl(om.name) != NoSymbol, @@ -1851,6 +1849,5 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { } resultTree - } - } + } } } diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index e89a860e0f..f135f7f6ae 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -81,7 +81,10 @@ trait Contexts { self: Analyzer => if (settings.noimports) Nil else if (unit.isJava) RootImports.javaList - else if (settings.nopredef || treeInfo.noPredefImportForUnit(unit.body)) RootImports.javaAndScalaList + else if (settings.nopredef || treeInfo.noPredefImportForUnit(unit.body)) { + debuglog("Omitted import of Predef._ for " + unit) + RootImports.javaAndScalaList + } else RootImports.completeList } diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 692c24fd20..a7b68ee6f8 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1737,14 +1737,16 @@ trait Typers extends Adaptations with Tags { if (psym.isFinal) pending += ParentFinalInheritanceError(parent, psym) - if (psym.hasDeprecatedInheritanceAnnotation) { + val sameSourceFile = context.unit.source.file == psym.sourceFile + + if (psym.hasDeprecatedInheritanceAnnotation && !sameSourceFile) { val suffix = psym.deprecatedInheritanceMessage map (": " + _) getOrElse "" val msg = s"inheritance from ${psym.fullLocationString} is deprecated$suffix" unit.deprecationWarning(parent.pos, msg) } if (psym.isSealed && !phase.erasedTypes) - if (context.unit.source.file == psym.sourceFile) + if (sameSourceFile) psym addChild context.owner else pending += ParentSealedInheritanceError(parent, psym) @@ -1856,6 +1858,9 @@ trait Typers extends Adaptations with Tags { } val impl2 = finishMethodSynthesis(impl1, clazz, context) + if (mdef.symbol == PredefModule) + ensurePredefParentsAreInSameSourceFile(impl2) + // SI-5954. On second compile of a companion class contained in a package object we end up // with some confusion of names which leads to having two symbols with the same name in the // same owner. Until that can be straightened out we will warn on companion objects in package @@ -1884,6 +1889,12 @@ trait Typers extends Adaptations with Tags { treeCopy.ModuleDef(mdef, typedMods, mdef.name, impl2) setType NoType } + + private def ensurePredefParentsAreInSameSourceFile(template: Template) = { + val parentSyms = template.parents map (_.symbol) filterNot (_ == AnyRefClass) + if (parentSyms exists (_.associatedFile != PredefModule.associatedFile)) + unit.error(template.pos, s"All parents of Predef must be defined in ${PredefModule.associatedFile}.") + } /** In order to override this in the TreeCheckers Typer so synthetics aren't re-added * all the time, it is exposed here the module/class typing methods go through it. * ...but it turns out it's also the ideal spot for namer/typer coordination for @@ -3799,8 +3810,16 @@ trait Typers extends Adaptations with Tags { if (vd.symbol.tpe.isVolatile) AbstractionFromVolatileTypeError(vd) val tpt1 = typedType(tree.tpt, mode) - existentialTransform(whereClauses1 map (_.symbol), tpt1.tpe)((tparams, tp) => - TypeTree(newExistentialType(tparams, tp)) setOriginal tree + existentialTransform(whereClauses1 map (_.symbol), tpt1.tpe)((tparams, tp) => { + val original = tpt1 match { + case tpt : TypeTree => atPos(tree.pos)(ExistentialTypeTree(tpt.original, tree.whereClauses)) + case _ => { + debuglog(s"cannot reconstruct the original for $tree, because $tpt1 is not a TypeTree") + tree + } + } + TypeTree(newExistentialType(tparams, tp)) setOriginal original + } ) } diff --git a/src/compiler/scala/tools/nsc/util/ClassPath.scala b/src/compiler/scala/tools/nsc/util/ClassPath.scala index aa4128f1a7..7f9b81e1ec 100644 --- a/src/compiler/scala/tools/nsc/util/ClassPath.scala +++ b/src/compiler/scala/tools/nsc/util/ClassPath.scala @@ -281,11 +281,24 @@ class DirectoryClassPath(val dir: AbstractFile, val context: ClassPathContext[Ab private def traverse() = { val classBuf = immutable.Vector.newBuilder[ClassRep] val packageBuf = immutable.Vector.newBuilder[DirectoryClassPath] - dir foreach { f => - if (!f.isDirectory && validClassFile(f.name)) - classBuf += ClassRep(Some(f), None) - else if (f.isDirectory && validPackage(f.name)) - packageBuf += new DirectoryClassPath(f, context) + dir foreach { + f => + // Optimization: We assume the file was not changed since `dir` called + // `Path.apply` and categorized existent files as `Directory` + // or `File`. + val isDirectory = f match { + case pf: io.PlainFile => pf.givenPath match { + case _: io.Directory => true + case _: io.File => false + case _ => f.isDirectory + } + case _ => + f.isDirectory + } + if (!isDirectory && validClassFile(f.name)) + classBuf += ClassRep(Some(f), None) + else if (isDirectory && validPackage(f.name)) + packageBuf += new DirectoryClassPath(f, context) } (packageBuf.result(), classBuf.result()) } diff --git a/src/library/scala/LowPriorityImplicits.scala b/src/library/scala/LowPriorityImplicits.scala deleted file mode 100644 index 535f1ac699..0000000000 --- a/src/library/scala/LowPriorityImplicits.scala +++ /dev/null @@ -1,95 +0,0 @@ -/* __ *\ -** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2002-2013, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** -** /____/\___/_/ |_/____/_/ | | ** -** |/ ** -\* */ - -package scala - -import scala.collection.{ mutable, immutable, generic } -import mutable.WrappedArray -import immutable.WrappedString -import generic.CanBuildFrom -import scala.language.implicitConversions - -/** The `LowPriorityImplicits` class provides implicit values that - * are valid in all Scala compilation units without explicit qualification, - * but that are partially overridden by higher-priority conversions in object - * `Predef`. - * - * @author Martin Odersky - * @since 2.8 - */ -private[scala] abstract class LowPriorityImplicits { - /** We prefer the java.lang.* boxed types to these wrappers in - * any potential conflicts. Conflicts do exist because the wrappers - * need to implement ScalaNumber in order to have a symmetric equals - * method, but that implies implementing java.lang.Number as well. - * - * Note - these are inlined because they are value classes, but - * the call to xxxWrapper is not eliminated even though it does nothing. - * Even inlined, every call site does a no-op retrieval of Predef's MODULE$ - * because maybe loading Predef has side effects! - */ - @inline implicit def byteWrapper(x: Byte) = new runtime.RichByte(x) - @inline implicit def shortWrapper(x: Short) = new runtime.RichShort(x) - @inline implicit def intWrapper(x: Int) = new runtime.RichInt(x) - @inline implicit def charWrapper(c: Char) = new runtime.RichChar(c) - @inline implicit def longWrapper(x: Long) = new runtime.RichLong(x) - @inline implicit def floatWrapper(x: Float) = new runtime.RichFloat(x) - @inline implicit def doubleWrapper(x: Double) = new runtime.RichDouble(x) - @inline implicit def booleanWrapper(x: Boolean) = new runtime.RichBoolean(x) - - // These eight implicits exist solely to exclude Null from the domain of - // the boxed types, so that e.g. "var x: Int = null" is a compile time - // error rather than a delayed null pointer exception by way of the - // conversion from java.lang.Integer. If defined in the same file as - // Integer2int, they would have higher priority because Null is a subtype - // of Integer. We balance that out and create conflict by moving the - // definition into the superclass. - // - // Caution: do not adjust tightrope tension without safety goggles in place. - implicit def Byte2byteNullConflict(x: Null): Byte = sys.error("value error") - implicit def Short2shortNullConflict(x: Null): Short = sys.error("value error") - implicit def Character2charNullConflict(x: Null): Char = sys.error("value error") - implicit def Integer2intNullConflict(x: Null): Int = sys.error("value error") - implicit def Long2longNullConflict(x: Null): Long = sys.error("value error") - implicit def Float2floatNullConflict(x: Null): Float = sys.error("value error") - implicit def Double2doubleNullConflict(x: Null): Double = sys.error("value error") - implicit def Boolean2booleanNullConflict(x: Null): Boolean = sys.error("value error") - - implicit def genericWrapArray[T](xs: Array[T]): WrappedArray[T] = - if (xs eq null) null - else WrappedArray.make(xs) - - // Since the JVM thinks arrays are covariant, one 0-length Array[AnyRef] - // is as good as another for all T <: AnyRef. Instead of creating 100,000,000 - // unique ones by way of this implicit, let's share one. - implicit def wrapRefArray[T <: AnyRef](xs: Array[T]): WrappedArray[T] = { - if (xs eq null) null - else if (xs.length == 0) WrappedArray.empty[T] - else new WrappedArray.ofRef[T](xs) - } - - implicit def wrapIntArray(xs: Array[Int]): WrappedArray[Int] = if (xs ne null) new WrappedArray.ofInt(xs) else null - implicit def wrapDoubleArray(xs: Array[Double]): WrappedArray[Double] = if (xs ne null) new WrappedArray.ofDouble(xs) else null - implicit def wrapLongArray(xs: Array[Long]): WrappedArray[Long] = if (xs ne null) new WrappedArray.ofLong(xs) else null - implicit def wrapFloatArray(xs: Array[Float]): WrappedArray[Float] = if (xs ne null) new WrappedArray.ofFloat(xs) else null - implicit def wrapCharArray(xs: Array[Char]): WrappedArray[Char] = if (xs ne null) new WrappedArray.ofChar(xs) else null - implicit def wrapByteArray(xs: Array[Byte]): WrappedArray[Byte] = if (xs ne null) new WrappedArray.ofByte(xs) else null - implicit def wrapShortArray(xs: Array[Short]): WrappedArray[Short] = if (xs ne null) new WrappedArray.ofShort(xs) else null - implicit def wrapBooleanArray(xs: Array[Boolean]): WrappedArray[Boolean] = if (xs ne null) new WrappedArray.ofBoolean(xs) else null - implicit def wrapUnitArray(xs: Array[Unit]): WrappedArray[Unit] = if (xs ne null) new WrappedArray.ofUnit(xs) else null - - implicit def wrapString(s: String): WrappedString = if (s ne null) new WrappedString(s) else null - implicit def unwrapString(ws: WrappedString): String = if (ws ne null) ws.self else null - - implicit def fallbackStringCanBuildFrom[T]: CanBuildFrom[String, T, immutable.IndexedSeq[T]] = - new CanBuildFrom[String, T, immutable.IndexedSeq[T]] { - def apply(from: String) = immutable.IndexedSeq.newBuilder[T] - def apply() = immutable.IndexedSeq.newBuilder[T] - } -} - diff --git a/src/library/scala/Predef.scala b/src/library/scala/Predef.scala index 9a468489a2..569157de20 100644 --- a/src/library/scala/Predef.scala +++ b/src/library/scala/Predef.scala @@ -446,3 +446,88 @@ private[scala] trait DeprecatedPredef { @deprecated("Use the method in `scala.io.ReadStdin`", "2.11.0") def readf2(format: String) = ReadStdin.readf2(format) @deprecated("Use the method in `scala.io.ReadStdin`", "2.11.0") def readf3(format: String) = ReadStdin.readf3(format) } + +/** The `LowPriorityImplicits` class provides implicit values that +* are valid in all Scala compilation units without explicit qualification, +* but that are partially overridden by higher-priority conversions in object +* `Predef`. +* +* @author Martin Odersky +* @since 2.8 +*/ +// SI-7335 Parents of Predef are defined in the same compilation unit to avoid +// cyclic reference errors compiling the standard library *without* a previously +// compiled copy on the classpath. +private[scala] abstract class LowPriorityImplicits { + import mutable.WrappedArray + import immutable.WrappedString + + /** We prefer the java.lang.* boxed types to these wrappers in + * any potential conflicts. Conflicts do exist because the wrappers + * need to implement ScalaNumber in order to have a symmetric equals + * method, but that implies implementing java.lang.Number as well. + * + * Note - these are inlined because they are value classes, but + * the call to xxxWrapper is not eliminated even though it does nothing. + * Even inlined, every call site does a no-op retrieval of Predef's MODULE$ + * because maybe loading Predef has side effects! + */ + @inline implicit def byteWrapper(x: Byte) = new runtime.RichByte(x) + @inline implicit def shortWrapper(x: Short) = new runtime.RichShort(x) + @inline implicit def intWrapper(x: Int) = new runtime.RichInt(x) + @inline implicit def charWrapper(c: Char) = new runtime.RichChar(c) + @inline implicit def longWrapper(x: Long) = new runtime.RichLong(x) + @inline implicit def floatWrapper(x: Float) = new runtime.RichFloat(x) + @inline implicit def doubleWrapper(x: Double) = new runtime.RichDouble(x) + @inline implicit def booleanWrapper(x: Boolean) = new runtime.RichBoolean(x) + + // These eight implicits exist solely to exclude Null from the domain of + // the boxed types, so that e.g. "var x: Int = null" is a compile time + // error rather than a delayed null pointer exception by way of the + // conversion from java.lang.Integer. If defined in the same template as + // Integer2int, they would have higher priority because Null is a subtype + // of Integer. We balance that out and create conflict by moving the + // definition into the superclass. + // + // Caution: do not adjust tightrope tension without safety goggles in place. + implicit def Byte2byteNullConflict(x: Null): Byte = sys.error("value error") + implicit def Short2shortNullConflict(x: Null): Short = sys.error("value error") + implicit def Character2charNullConflict(x: Null): Char = sys.error("value error") + implicit def Integer2intNullConflict(x: Null): Int = sys.error("value error") + implicit def Long2longNullConflict(x: Null): Long = sys.error("value error") + implicit def Float2floatNullConflict(x: Null): Float = sys.error("value error") + implicit def Double2doubleNullConflict(x: Null): Double = sys.error("value error") + implicit def Boolean2booleanNullConflict(x: Null): Boolean = sys.error("value error") + + implicit def genericWrapArray[T](xs: Array[T]): WrappedArray[T] = + if (xs eq null) null + else WrappedArray.make(xs) + + // Since the JVM thinks arrays are covariant, one 0-length Array[AnyRef] + // is as good as another for all T <: AnyRef. Instead of creating 100,000,000 + // unique ones by way of this implicit, let's share one. + implicit def wrapRefArray[T <: AnyRef](xs: Array[T]): WrappedArray[T] = { + if (xs eq null) null + else if (xs.length == 0) WrappedArray.empty[T] + else new WrappedArray.ofRef[T](xs) + } + + implicit def wrapIntArray(xs: Array[Int]): WrappedArray[Int] = if (xs ne null) new WrappedArray.ofInt(xs) else null + implicit def wrapDoubleArray(xs: Array[Double]): WrappedArray[Double] = if (xs ne null) new WrappedArray.ofDouble(xs) else null + implicit def wrapLongArray(xs: Array[Long]): WrappedArray[Long] = if (xs ne null) new WrappedArray.ofLong(xs) else null + implicit def wrapFloatArray(xs: Array[Float]): WrappedArray[Float] = if (xs ne null) new WrappedArray.ofFloat(xs) else null + implicit def wrapCharArray(xs: Array[Char]): WrappedArray[Char] = if (xs ne null) new WrappedArray.ofChar(xs) else null + implicit def wrapByteArray(xs: Array[Byte]): WrappedArray[Byte] = if (xs ne null) new WrappedArray.ofByte(xs) else null + implicit def wrapShortArray(xs: Array[Short]): WrappedArray[Short] = if (xs ne null) new WrappedArray.ofShort(xs) else null + implicit def wrapBooleanArray(xs: Array[Boolean]): WrappedArray[Boolean] = if (xs ne null) new WrappedArray.ofBoolean(xs) else null + implicit def wrapUnitArray(xs: Array[Unit]): WrappedArray[Unit] = if (xs ne null) new WrappedArray.ofUnit(xs) else null + + implicit def wrapString(s: String): WrappedString = if (s ne null) new WrappedString(s) else null + implicit def unwrapString(ws: WrappedString): String = if (ws ne null) ws.self else null + + implicit def fallbackStringCanBuildFrom[T]: CanBuildFrom[String, T, immutable.IndexedSeq[T]] = + new CanBuildFrom[String, T, immutable.IndexedSeq[T]] { + def apply(from: String) = immutable.IndexedSeq.newBuilder[T] + def apply() = immutable.IndexedSeq.newBuilder[T] + } +} diff --git a/src/library/scala/deprecatedInheritance.scala b/src/library/scala/deprecatedInheritance.scala index 70065560b1..7d20219d4d 100644 --- a/src/library/scala/deprecatedInheritance.scala +++ b/src/library/scala/deprecatedInheritance.scala @@ -11,7 +11,8 @@ package scala /** An annotation that designates that inheriting from a class is deprecated. * * This is usually done to warn about a non-final class being made final in a future version. - * Sub-classing such a class then generates a warning. + * Sub-classing such a class then generates a warning. No warnings are generated if the + * subclass is in the same compilation unit. * * @param message the message to print during compilation if the class was sub-classed * @param since a string identifying the first version in which inheritance was deprecated diff --git a/src/partest/scala/tools/partest/nest/PathSettings.scala b/src/partest/scala/tools/partest/nest/PathSettings.scala index 7c005b4f61..b1f868c9d2 100644 --- a/src/partest/scala/tools/partest/nest/PathSettings.scala +++ b/src/partest/scala/tools/partest/nest/PathSettings.scala @@ -8,6 +8,7 @@ package nest import scala.tools.nsc.Properties.{ setProp, propOrEmpty, propOrNone, propOrElse } import scala.tools.nsc.util.ClassPath import scala.tools.nsc.io +import scala.util.Properties.{ envOrElse, envOrNone, javaHome, jdkHome } import io.{ Path, File, Directory } object PathSettings { @@ -74,6 +75,35 @@ object PathSettings { lazy val diffUtils: File = findJar(buildPackLibDir.files, "diffutils") getOrElse sys.error(s"No diffutils.jar found in '$buildPackLibDir'.") + + /** The platform-specific support jar. + * Usually this is tools.jar in the jdk/lib directory of the platform distribution. + * The file location is determined by probing the lib directory under JDK_HOME or JAVA_HOME, + * if one of those environment variables is set, then the lib directory under java.home, + * and finally the lib directory under the parent of java.home. Or, as a last resort, + * search deeply under those locations (except for the parent of java.home, on the notion + * that if this is not a canonical installation, then that search would have litte + * chance of succeeding). + */ + lazy val platformTools: Option[File] = { + val jarName = "tools.jar" + def jarPath(path: Path) = (path / "lib" / jarName).toFile + def jarAt(path: Path) = { + val f = jarPath(path) + if (f.isFile) Some(f) else None + } + val jdkDir = { + val d = Directory(jdkHome) + if (d.isDirectory) Some(d) else None + } + def deeply(dir: Directory) = dir.deepFiles find (_.name == jarName) + + val home = envOrNone("JDK_HOME") orElse envOrNone("JAVA_HOME") map (p => Path(p)) + val install = Some(Path(javaHome)) + + (home flatMap jarAt) orElse (install flatMap jarAt) orElse (install map (_.parent) flatMap jarAt) orElse + (jdkDir flatMap deeply) + } } class PathSettings() { diff --git a/src/partest/scala/tools/partest/nest/RunnerManager.scala b/src/partest/scala/tools/partest/nest/RunnerManager.scala index 1c689714c7..fa2b5ea74b 100644 --- a/src/partest/scala/tools/partest/nest/RunnerManager.scala +++ b/src/partest/scala/tools/partest/nest/RunnerManager.scala @@ -74,8 +74,10 @@ object Output { class RunnerManager(kind: String, val fileManager: FileManager, params: TestRunParams) { import fileManager._ + fileManager.CLASSPATH += File.pathSeparator + PathSettings.scalaCheck fileManager.CLASSPATH += File.pathSeparator + PathSettings.diffUtils // needed to put diffutils on test/partest's classpath + PathSettings.platformTools foreach (fileManager.CLASSPATH += File.pathSeparator + _) def runTest(testFile: File): TestState = { val runner = new Runner(testFile, fileManager) { diff --git a/src/reflect/scala/reflect/api/TypeTags.scala b/src/reflect/scala/reflect/api/TypeTags.scala index e988971ace..7457910226 100644 --- a/src/reflect/scala/reflect/api/TypeTags.scala +++ b/src/reflect/scala/reflect/api/TypeTags.scala @@ -221,24 +221,7 @@ trait TypeTags { self: Universe => def apply[T](mirror1: scala.reflect.api.Mirror[self.type], tpec1: TypeCreator): WeakTypeTag[T] = - tpec1(mirror1) match { - case ByteTpe => WeakTypeTag.Byte.asInstanceOf[WeakTypeTag[T]] - case ShortTpe => WeakTypeTag.Short.asInstanceOf[WeakTypeTag[T]] - case CharTpe => WeakTypeTag.Char.asInstanceOf[WeakTypeTag[T]] - case IntTpe => WeakTypeTag.Int.asInstanceOf[WeakTypeTag[T]] - case LongTpe => WeakTypeTag.Long.asInstanceOf[WeakTypeTag[T]] - case FloatTpe => WeakTypeTag.Float.asInstanceOf[WeakTypeTag[T]] - case DoubleTpe => WeakTypeTag.Double.asInstanceOf[WeakTypeTag[T]] - case BooleanTpe => WeakTypeTag.Boolean.asInstanceOf[WeakTypeTag[T]] - case UnitTpe => WeakTypeTag.Unit.asInstanceOf[WeakTypeTag[T]] - case AnyTpe => WeakTypeTag.Any.asInstanceOf[WeakTypeTag[T]] - case AnyValTpe => WeakTypeTag.AnyVal.asInstanceOf[WeakTypeTag[T]] - case AnyRefTpe => WeakTypeTag.AnyRef.asInstanceOf[WeakTypeTag[T]] - case ObjectTpe => WeakTypeTag.Object.asInstanceOf[WeakTypeTag[T]] - case NothingTpe => WeakTypeTag.Nothing.asInstanceOf[WeakTypeTag[T]] - case NullTpe => WeakTypeTag.Null.asInstanceOf[WeakTypeTag[T]] - case _ => new WeakTypeTagImpl[T](mirror1.asInstanceOf[Mirror], tpec1) - } + new WeakTypeTagImpl[T](mirror1.asInstanceOf[Mirror], tpec1) def unapply[T](ttag: WeakTypeTag[T]): Option[Type] = Some(ttag.tpe) } @@ -299,24 +282,7 @@ trait TypeTags { self: Universe => val Null: TypeTag[scala.Null] = new PredefTypeTag[scala.Null] (NullTpe, _.TypeTag.Null) def apply[T](mirror1: scala.reflect.api.Mirror[self.type], tpec1: TypeCreator): TypeTag[T] = - tpec1(mirror1) match { - case ByteTpe => TypeTag.Byte.asInstanceOf[TypeTag[T]] - case ShortTpe => TypeTag.Short.asInstanceOf[TypeTag[T]] - case CharTpe => TypeTag.Char.asInstanceOf[TypeTag[T]] - case IntTpe => TypeTag.Int.asInstanceOf[TypeTag[T]] - case LongTpe => TypeTag.Long.asInstanceOf[TypeTag[T]] - case FloatTpe => TypeTag.Float.asInstanceOf[TypeTag[T]] - case DoubleTpe => TypeTag.Double.asInstanceOf[TypeTag[T]] - case BooleanTpe => TypeTag.Boolean.asInstanceOf[TypeTag[T]] - case UnitTpe => TypeTag.Unit.asInstanceOf[TypeTag[T]] - case AnyTpe => TypeTag.Any.asInstanceOf[TypeTag[T]] - case AnyValTpe => TypeTag.AnyVal.asInstanceOf[TypeTag[T]] - case AnyRefTpe => TypeTag.AnyRef.asInstanceOf[TypeTag[T]] - case ObjectTpe => TypeTag.Object.asInstanceOf[TypeTag[T]] - case NothingTpe => TypeTag.Nothing.asInstanceOf[TypeTag[T]] - case NullTpe => TypeTag.Null.asInstanceOf[TypeTag[T]] - case _ => new TypeTagImpl[T](mirror1.asInstanceOf[Mirror], tpec1) - } + new TypeTagImpl[T](mirror1.asInstanceOf[Mirror], tpec1) def unapply[T](ttag: TypeTag[T]): Option[Type] = Some(ttag.tpe) } diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index 8ef2805529..a87d002f25 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -887,9 +887,23 @@ trait Symbols extends api.Symbols { self: SymbolTable => supersym == NoSymbol || supersym.isIncompleteIn(base) } - // Does not always work if the rawInfo is a SourcefileLoader, see comment - // in "def coreClassesFirst" in Global. - def exists = !isTopLevel || { rawInfo.load(this); rawInfo != NoType } + def exists: Boolean = !isTopLevel || { + val isSourceLoader = rawInfo match { + case sl: SymLoader => sl.fromSource + case _ => false + } + def warnIfSourceLoader() { + if (isSourceLoader) + // Predef is completed early due to its autoimport; we used to get here when type checking its + // parent LowPriorityImplicits. See comment in c5441dc for more elaboration. + // Since the fix for SI-7335 Predef parents must be defined in Predef.scala, and we should not + // get here anymore. + devWarning(s"calling Symbol#exists with sourcefile based symbol loader may give incorrect results."); + } + + rawInfo load this + rawInfo != NoType || { warnIfSourceLoader(); false } + } final def isInitialized: Boolean = validTo != NoPeriod @@ -2621,32 +2635,20 @@ trait Symbols extends api.Symbols { self: SymbolTable => } /** change name by appending $$<fully-qualified-name-of-class `base`> - * Do the same for any accessed symbols or setters/getters. - * If the accessor to be renamed is overriding a base symbol, enter - * a cloned symbol with the original name but without ACCESSOR flag. + * Do the same for any accessed symbols or setters/getters */ override def expandName(base: Symbol) { - def expand(sym: Symbol) { - if ((sym eq NoSymbol) || (sym hasFlag EXPANDEDNAME)) () // skip - else sym setFlag EXPANDEDNAME setName nme.expandedName(sym.name.toTermName, base) - } - def cloneAndExpand(accessor: Symbol) { - val clone = accessor.cloneSymbol(accessor.owner, (accessor.flags | ARTIFACT) & ~ACCESSOR) - expand(accessor) - log(s"Expanded overriding accessor to $accessor, but cloned $clone to preserve override") - accessor.owner.info.decls enter clone - } - def expandAccessor(accessor: Symbol) { - if (accessor.isOverridingSymbol) cloneAndExpand(accessor) else expand(accessor) - } - if (hasAccessorFlag && !isDeferred) { - expand(accessed) - } - else if (hasGetter) { - expandAccessor(getter(owner)) - expandAccessor(setter(owner)) + if (!hasFlag(EXPANDEDNAME)) { + setFlag(EXPANDEDNAME) + if (hasAccessorFlag && !isDeferred) { + accessed.expandName(base) + } + else if (hasGetter) { + getter(owner).expandName(base) + setter(owner).expandName(base) + } + name = nme.expandedName(name.toTermName, base) } - expand(this) } } implicit val TermSymbolTag = ClassTag[TermSymbol](classOf[TermSymbol]) diff --git a/src/reflect/scala/reflect/internal/TreeInfo.scala b/src/reflect/scala/reflect/internal/TreeInfo.scala index b1f58814c7..3296353b6b 100644 --- a/src/reflect/scala/reflect/internal/TreeInfo.scala +++ b/src/reflect/scala/reflect/internal/TreeInfo.scala @@ -663,20 +663,9 @@ abstract class TreeInfo { unapply(dissectApplied(tree)) } - /** Does list of trees start with a definition of - * a class of module with given name (ignoring imports) - */ - def firstDefinesClassOrObject(trees: List[Tree], name: Name): Boolean = trees match { - case Import(_, _) :: xs => firstDefinesClassOrObject(xs, name) - case Annotated(_, tree1) :: Nil => firstDefinesClassOrObject(List(tree1), name) - case ModuleDef(_, `name`, _) :: Nil => true - case ClassDef(_, `name`, _, _) :: Nil => true - case _ => false - } - - /** Is this file the body of a compilation unit which should not - * have Predef imported? + * have Predef imported? This is the case iff the first import in the + * unit explicitly refers to Predef. */ def noPredefImportForUnit(body: Tree) = { // Top-level definition whose leading imports include Predef. @@ -685,13 +674,7 @@ abstract class TreeInfo { case Import(expr, _) => isReferenceToPredef(expr) case _ => false } - // Compilation unit is class or object 'name' in package 'scala' - def isUnitInScala(tree: Tree, name: Name) = tree match { - case PackageDef(Ident(nme.scala_), defs) => firstDefinesClassOrObject(defs, name) - case _ => false - } - - isUnitInScala(body, nme.Predef) || isLeadingPredefImport(body) + isLeadingPredefImport(body) } def isAbsTypeDef(tree: Tree) = tree match { diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala index 25b05ae6b3..60d9e1c3cd 100644 --- a/src/reflect/scala/reflect/internal/Types.scala +++ b/src/reflect/scala/reflect/internal/Types.scala @@ -2956,12 +2956,14 @@ trait Types /** The variable's skolemization level */ val level = skolemizationLevel - /** Two occurrences of a higher-kinded typevar, e.g. `?CC[Int]` and `?CC[String]`, correspond to - * ''two instances'' of `TypeVar` that share the ''same'' `TypeConstraint`. + /** Applies this TypeVar to type arguments, if arity matches. * - * `constr` for `?CC` only tracks type constructors anyway, - * so when `?CC[Int] <:< List[Int]` and `?CC[String] <:< Iterable[String]` - * `?CC's` hibounds contains List and Iterable. + * Different applications of the same type constructor variable `?CC`, + * e.g. `?CC[Int]` and `?CC[String]`, are modeled as distinct instances of `TypeVar` + * that share a `TypeConstraint`, so that the comparisons `?CC[Int] <:< List[Int]` + * and `?CC[String] <:< Iterable[String]` result in `?CC` being upper-bounded by `List` and `Iterable`. + * + * Applying the wrong number of type args results in a TypeVar whose instance is set to `ErrorType`. */ def applyArgs(newArgs: List[Type]): TypeVar = ( if (newArgs.isEmpty && typeArgs.isEmpty) @@ -2971,7 +2973,7 @@ trait Types TypeVar.trace("applyArgs", "In " + originLocation + ", apply args " + newArgs.mkString(", ") + " to " + originName)(tv) } else - throw new Error("Invalid type application in TypeVar: " + params + ", " + newArgs) + TypeVar(typeSymbol).setInst(ErrorType) ) // newArgs.length may differ from args.length (could've been empty before) // @@ -3001,16 +3003,17 @@ trait Types // <region name="constraint mutators + undoLog"> // invariant: before mutating constr, save old state in undoLog // (undoLog is used to reset constraints to avoid piling up unrelated ones) - def setInst(tp: Type) { + def setInst(tp: Type): this.type = { if (tp eq this) { log(s"TypeVar cycle: called setInst passing $this to itself.") - return + return this } undoLog record this // if we were compared against later typeskolems, repack the existential, // because skolems are only compatible if they were created at the same level val res = if (shouldRepackType) repackExistential(tp) else tp constr.inst = TypeVar.trace("setInst", "In " + originLocation + ", " + originName + "=" + res)(res) + this } def addLoBound(tp: Type, isNumericBound: Boolean = false) { diff --git a/src/reflect/scala/reflect/internal/util/Position.scala b/src/reflect/scala/reflect/internal/util/Position.scala index bb8c9e9b26..fe6c7db989 100644 --- a/src/reflect/scala/reflect/internal/util/Position.scala +++ b/src/reflect/scala/reflect/internal/util/Position.scala @@ -20,18 +20,12 @@ object Position { else if (posIn.isDefined) posIn.inUltimateSource(posIn.source) else posIn ) - def file = pos.source.file - def prefix = if (shortenFile) file.name else file.path + val prefix = if (shortenFile) pos.sourceName else pos.sourcePath pos match { case FakePos(fmsg) => fmsg+" "+msg case NoPosition => msg - case _ => - List( - "%s:%s: %s".format(prefix, pos.line, msg), - pos.lineContent.stripLineEnd, - " " * (pos.column - 1) + "^" - ) mkString "\n" + case _ => "%s:%s: %s\n%s\n%s".format(prefix, pos.line, msg, pos.lineContent, pos.lineCarat) } } } @@ -206,12 +200,39 @@ abstract class Position extends scala.reflect.api.Position { self => def column: Int = throw new UnsupportedOperationException("Position.column") + /** A line with a ^ padded with the right number of spaces. + */ + def lineCarat: String = " " * (column - 1) + "^" + + /** The line of code and the corresponding carat pointing line, trimmed + * to the maximum specified width, with the trimmed versions oriented + * around the point to give maximum context. + */ + def lineWithCarat(maxWidth: Int): (String, String) = { + val radius = maxWidth / 2 + var start = math.max(column - radius, 0) + var result = lineContent drop start take maxWidth + + if (result.length < maxWidth) { + result = lineContent takeRight maxWidth + start = lineContent.length - result.length + } + + (result, lineCarat drop start take maxWidth) + } + /** Convert this to a position around `point` that spans a single source line */ def toSingleLine: Position = this - def lineContent: String = - if (isDefined) source.lineToString(line - 1) - else "NO_LINE" + /** The source code corresponding to the range, if this is a range position. + * Otherwise the empty string. + */ + def sourceCode = "" + def sourceName = "<none>" + def sourcePath = "<none>" + def lineContent = "<none>" + def lengthInChars = 0 + def lengthInLines = 0 /** Map this position to a position in an original source * file. If the SourceFile is a normal SourceFile, simply @@ -240,7 +261,10 @@ class OffsetPosition(override val source: SourceFile, override val point: Int) e override def withPoint(off: Int) = new OffsetPosition(source, off) override def withSource(source: SourceFile, shift: Int) = new OffsetPosition(source, point + shift) - override def line: Int = source.offsetToLine(point) + 1 + override def line = source.offsetToLine(point) + 1 + override def sourceName = source.file.name + override def sourcePath = source.file.path + override def lineContent = source.lineToString(line - 1) override def column: Int = { var idx = source.lineToOffset(source.offsetToLine(point)) diff --git a/src/reflect/scala/reflect/io/AbstractFile.scala b/src/reflect/scala/reflect/io/AbstractFile.scala index 8b69efc749..4ac56da628 100644 --- a/src/reflect/scala/reflect/io/AbstractFile.scala +++ b/src/reflect/scala/reflect/io/AbstractFile.scala @@ -11,6 +11,7 @@ import java.io.{ FileOutputStream, IOException, InputStream, OutputStream, Buffe import java.io.{ File => JFile } import java.net.URL import scala.collection.mutable.ArrayBuffer +import scala.reflect.internal.util.Statistics /** * An abstraction over files for use in the reflection/compiler libraries. @@ -112,7 +113,10 @@ abstract class AbstractFile extends Iterable[AbstractFile] { def underlyingSource: Option[AbstractFile] = None /** Does this abstract file denote an existing file? */ - def exists: Boolean = (file eq null) || file.exists + def exists: Boolean = { + if (Statistics.canEnable) Statistics.incCounter(IOStats.fileExistsCount) + (file eq null) || file.exists + } /** Does this abstract file represent something which can contain classfiles? */ def isClassContainer = isDirectory || (file != null && (extension == "jar" || extension == "zip")) diff --git a/src/reflect/scala/reflect/io/IOStats.scala b/src/reflect/scala/reflect/io/IOStats.scala new file mode 100644 index 0000000000..64e1e952cd --- /dev/null +++ b/src/reflect/scala/reflect/io/IOStats.scala @@ -0,0 +1,31 @@ +package scala.reflect.io + +import scala.reflect.internal.util.Statistics + +// Due to limitations in the Statistics machinery, these are only +// reported if this patch is applied. +// +// --- a/src/reflect/scala/reflect/internal/util/Statistics.scala +// +++ b/src/reflect/scala/reflect/internal/util/Statistics.scala +// @@ -109,7 +109,7 @@ quant) +// * Quantities with non-empty prefix are printed in the statistics info. +// */ +// trait Quantity { +// - if (enabled && prefix.nonEmpty) { +// + if (prefix.nonEmpty) { +// val key = s"${if (underlying != this) underlying.prefix else ""}/$prefix" +// qs(key) = this +// } +// @@ -243,7 +243,7 @@ quant) +// * +// * to remove all Statistics code from build +// */ +// - final val canEnable = _enabled +// + final val canEnable = true // _enabled +// +// We can commit this change as the first diff reverts a fix for an IDE memory leak. +private[io] object IOStats { + val fileExistsCount = Statistics.newCounter("# File.exists calls") + val fileIsDirectoryCount = Statistics.newCounter("# File.isDirectory calls") + val fileIsFileCount = Statistics.newCounter("# File.isFile calls") +} diff --git a/src/reflect/scala/reflect/io/Path.scala b/src/reflect/scala/reflect/io/Path.scala index 44fb41a1cd..56d4faed99 100644 --- a/src/reflect/scala/reflect/io/Path.scala +++ b/src/reflect/scala/reflect/io/Path.scala @@ -13,6 +13,7 @@ import java.io.{ File => JFile } import java.net.{ URI, URL } import scala.util.Random.alphanumeric import scala.language.implicitConversions +import scala.reflect.internal.util.Statistics /** An abstraction for filesystem paths. The differences between * Path, File, and Directory are primarily to communicate intent. @@ -57,8 +58,18 @@ object Path { def apply(path: String): Path = apply(new JFile(path)) def apply(jfile: JFile): Path = try { - if (jfile.isFile) new File(jfile) - else if (jfile.isDirectory) new Directory(jfile) + def isFile = { + if (Statistics.canEnable) Statistics.incCounter(IOStats.fileIsFileCount) + jfile.isFile + } + + def isDirectory = { + if (Statistics.canEnable) Statistics.incCounter(IOStats.fileIsDirectoryCount) + jfile.isDirectory + } + + if (isFile) new File(jfile) + else if (isDirectory) new Directory(jfile) else new Path(jfile) } catch { case ex: SecurityException => new Path(jfile) } @@ -187,10 +198,19 @@ class Path private[io] (val jfile: JFile) { // Boolean tests def canRead = jfile.canRead() def canWrite = jfile.canWrite() - def exists = try jfile.exists() catch { case ex: SecurityException => false } + def exists = { + if (Statistics.canEnable) Statistics.incCounter(IOStats.fileExistsCount) + try jfile.exists() catch { case ex: SecurityException => false } + } - def isFile = try jfile.isFile() catch { case ex: SecurityException => false } - def isDirectory = try jfile.isDirectory() catch { case ex: SecurityException => false } + def isFile = { + if (Statistics.canEnable) Statistics.incCounter(IOStats.fileIsFileCount) + try jfile.isFile() catch { case ex: SecurityException => false } + } + def isDirectory = { + if (Statistics.canEnable) Statistics.incCounter(IOStats.fileIsDirectoryCount) + try jfile.isDirectory() catch { case ex: SecurityException => false } + } def isAbsolute = jfile.isAbsolute() def isEmpty = path.length == 0 diff --git a/src/reflect/scala/reflect/io/PlainFile.scala b/src/reflect/scala/reflect/io/PlainFile.scala index 31df78f995..b892fe7cef 100644 --- a/src/reflect/scala/reflect/io/PlainFile.scala +++ b/src/reflect/scala/reflect/io/PlainFile.scala @@ -56,8 +56,14 @@ class PlainFile(val givenPath: Path) extends AbstractFile { /** Returns all abstract subfiles of this abstract directory. */ def iterator: Iterator[AbstractFile] = { + // Optimization: Assume that the file was not deleted and did not have permissions changed + // between the call to `list` and the iteration. This saves a call to `exists`. + def existsFast(path: Path) = path match { + case (_: Directory | _: io.File) => true + case _ => path.exists + } if (!isDirectory) Iterator.empty - else givenPath.toDirectory.list filter (_.exists) map (new PlainFile(_)) + else givenPath.toDirectory.list filter existsFast map (new PlainFile(_)) } /** diff --git a/test/files/neg/t6162-inheritance.check b/test/files/neg/t6162-inheritance.check index e98fa79eb7..13c78030d9 100644 --- a/test/files/neg/t6162-inheritance.check +++ b/test/files/neg/t6162-inheritance.check @@ -1,16 +1,16 @@ -t6162-inheritance.scala:6: warning: inheritance from class Foo in package t6126 is deprecated: `Foo` will be made final in a future version. +usage.scala:3: warning: inheritance from class Foo in package t6126 is deprecated: `Foo` will be made final in a future version. class SubFoo extends Foo ^ -t6162-inheritance.scala:11: warning: inheritance from trait T in package t6126 is deprecated +usage.scala:5: warning: inheritance from trait T in package t6126 is deprecated object SubT extends T ^ -t6162-inheritance.scala:17: warning: inheritance from trait S in package t6126 is deprecated +usage.scala:8: warning: inheritance from trait S in package t6126 is deprecated new S { ^ -t6162-inheritance.scala:6: warning: inheritance from class Foo in package t6126 is deprecated: `Foo` will be made final in a future version. +usage.scala:3: warning: inheritance from class Foo in package t6126 is deprecated: `Foo` will be made final in a future version. class SubFoo extends Foo ^ -t6162-inheritance.scala:11: warning: inheritance from trait T in package t6126 is deprecated +usage.scala:5: warning: inheritance from trait T in package t6126 is deprecated object SubT extends T ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t6162-inheritance/defn.scala b/test/files/neg/t6162-inheritance/defn.scala new file mode 100644 index 0000000000..bb582d27b0 --- /dev/null +++ b/test/files/neg/t6162-inheritance/defn.scala @@ -0,0 +1,10 @@ +package scala.t6126 + +@deprecatedInheritance("`Foo` will be made final in a future version.", "2.10.0") +class Foo + +@deprecatedInheritance() +trait T + +@deprecatedInheritance() +trait S diff --git a/test/files/neg/t6162-inheritance/usage.scala b/test/files/neg/t6162-inheritance/usage.scala new file mode 100644 index 0000000000..097e4f5903 --- /dev/null +++ b/test/files/neg/t6162-inheritance/usage.scala @@ -0,0 +1,10 @@ +package scala.t6126 + +class SubFoo extends Foo + +object SubT extends T + +object O { + new S { + } +} diff --git a/test/files/neg/t7289.check b/test/files/neg/t7289.check new file mode 100644 index 0000000000..e4aeebbc6c --- /dev/null +++ b/test/files/neg/t7289.check @@ -0,0 +1,4 @@ +t7289.scala:8: error: could not find implicit value for parameter e: Test.Schtroumpf[scala.collection.immutable.Nil.type] + implicitly[Schtroumpf[Nil.type]] + ^ +one error found diff --git a/test/files/neg/t7289.scala b/test/files/neg/t7289.scala new file mode 100644 index 0000000000..f4ed3daf76 --- /dev/null +++ b/test/files/neg/t7289.scala @@ -0,0 +1,39 @@ +object Test extends App { + trait Schtroumpf[T] + + implicit def schtroumpf[T, U <: Coll[T], Coll[X] <: Traversable[X]] + (implicit minorSchtroumpf: Schtroumpf[T]): Schtroumpf[U] = ??? + + implicit val qoo: Schtroumpf[Int] = new Schtroumpf[Int]{} + implicitly[Schtroumpf[Nil.type]] +} + +/* +info1 = {scala.tools.nsc.typechecker.Implicits$ImplicitInfo@3468}"qoo: => Test.Schtroumpf[Int]" +info2 = {scala.tools.nsc.typechecker.Implicits$ImplicitInfo@3469}"schtroumpf: [T, U <: Coll[T], Coll[_] <: Traversable[_]](implicit minorSchtroumpf: Test.Schtroumpf[T])Test.Schtroumpf[U]" +isStrictlyMoreSpecific(info1, info2) + isSubType(Test.Schtroumpf[Int], Test.Schtroumpf[U] forSome { T; U <: Coll[T]; Coll[_] <: Traversable[_] }) + isAsSpecificValueType(Test.Schtroumpf[Int], Test.Schtroumpf[U], undef2 = List(type T, type U, type Coll)) + + val et: ExistentialType = Test.Schtroumpf[U] forSome { T; U <: Coll[T]; Coll[_] <: Traversable[_] } + val tp1 = Test.Schtroumpf[Int] + et.withTypeVars(isSubType(tp1, _, depth)) + solve() + tvars = tList(=?Nothing, =?Int, =?=?Int) + + +[ create] ?T ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] ) +[ create] ?U ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] ) +[ create] ?Coll ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] ) +[ setInst] Nothing ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], T=Nothing ) +[ setInst] scala.collection.immutable.Nil.type( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], U=scala.collection.immutable.Nil.type ) +[ setInst] =?scala.collection.immutable.Nil.type( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], Coll==?scala.collection.immutable.Nil.type ) +[ create] ?T ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] ) +[ setInst] Int ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], T=Int ) +[ create] ?T ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] ) +[ create] ?U ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] ) +[ create] ?Coll ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] ) +[ setInst] Nothing ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], T=Nothing ) +[ setInst] Int ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], U=Int ) +[ setInst] =?Int ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], Coll==?Int ) +*/
\ No newline at end of file diff --git a/test/files/neg/t7289_status_quo.check b/test/files/neg/t7289_status_quo.check new file mode 100644 index 0000000000..31c072e969 --- /dev/null +++ b/test/files/neg/t7289_status_quo.check @@ -0,0 +1,22 @@ +t7289_status_quo.scala:9: error: could not find implicit value for parameter e: Test1.Ext[List[Int]] + implicitly[Ext[List[Int]]] // fails - not found + ^ +t7289_status_quo.scala:11: error: could not find implicit value for parameter e: Test1.Ext[List[List[List[Int]]]] + implicitly[Ext[List[List[List[Int]]]]] // fails - not found + ^ +t7289_status_quo.scala:15: error: ambiguous implicit values: + both method f in object Test1 of type [A, Coll <: CC[A], CC[X] <: Traversable[X]](implicit xi: Test1.Ext[A])Test1.Ext[Coll] + and value m in object Test1 of type => Test1.Ext[List[List[Int]]] + match expected type Test1.Ext[_ <: List[List[Int]]] + implicitly[Ext[_ <: List[List[Int]]]] // fails - ambiguous + ^ +t7289_status_quo.scala:20: error: could not find implicit value for parameter e: Test1.ExtCov[List[Int]] + implicitly[ExtCov[List[Int]]] // fails - not found + ^ +t7289_status_quo.scala:21: error: could not find implicit value for parameter e: Test1.ExtCov[List[List[Int]]] + implicitly[ExtCov[List[List[Int]]]] // fails - not found + ^ +t7289_status_quo.scala:22: error: could not find implicit value for parameter e: Test1.ExtCov[List[List[List[Int]]]] + implicitly[ExtCov[List[List[List[Int]]]]] // fails - not found + ^ +6 errors found diff --git a/test/files/neg/t7289_status_quo.scala b/test/files/neg/t7289_status_quo.scala new file mode 100644 index 0000000000..39621429a1 --- /dev/null +++ b/test/files/neg/t7289_status_quo.scala @@ -0,0 +1,23 @@ +// record the status quo after this fix +// not clear to @adriaanm why an upper-bounded existential in an invariant position +// is different from putting that upper bound in a covariant position +object Test1 { + trait Ext[T] + implicit def f[A, Coll <: CC[A], CC[X] <: Traversable[X]](implicit xi: Ext[A]): Ext[Coll] = ??? + implicit val m: Ext[List[List[Int]]] = new Ext[List[List[Int]]]{} + + implicitly[Ext[List[Int]]] // fails - not found + implicitly[Ext[List[List[Int]]]] // compiles + implicitly[Ext[List[List[List[Int]]]]] // fails - not found + + // Making Ext[+T] should incur the same behavior as these. (so says @paulp) + implicitly[Ext[_ <: List[Int]]] // compiles + implicitly[Ext[_ <: List[List[Int]]]] // fails - ambiguous + implicitly[Ext[_ <: List[List[List[Int]]]]] // compiles + + // But, we currently get: + trait ExtCov[+T] + implicitly[ExtCov[List[Int]]] // fails - not found + implicitly[ExtCov[List[List[Int]]]] // fails - not found + implicitly[ExtCov[List[List[List[Int]]]]] // fails - not found +}
\ No newline at end of file diff --git a/test/files/pos/spec-t6286.scala b/test/files/pos/spec-t6286.scala new file mode 100755 index 0000000000..4d87998ec6 --- /dev/null +++ b/test/files/pos/spec-t6286.scala @@ -0,0 +1,10 @@ +trait Foo[@specialized(Int) A] { + def fun[@specialized(Int) B](init: B)(f: (B, A) => B): B +} + +class Bar(values: Array[Int]) extends Foo[Int] { + def fun[@specialized(Int) C](init: C)(f: (C, Int) => C): C = { + val arr = values + f(init, arr(0)) + } +} diff --git a/test/files/pos/t6162-inheritance.flags b/test/files/pos/t6162-inheritance.flags new file mode 100644 index 0000000000..c6bfaf1f64 --- /dev/null +++ b/test/files/pos/t6162-inheritance.flags @@ -0,0 +1 @@ +-deprecation -Xfatal-warnings diff --git a/test/files/neg/t6162-inheritance.scala b/test/files/pos/t6162-inheritance.scala index 7b47b9285a..fca751edab 100644 --- a/test/files/neg/t6162-inheritance.scala +++ b/test/files/pos/t6162-inheritance.scala @@ -1,5 +1,8 @@ package scala.t6126 +// Don't warn about inheritance in the same file. +// We might use that as a prelude to sealing a class. + @deprecatedInheritance("`Foo` will be made final in a future version.", "2.10.0") class Foo diff --git a/test/files/pos/t6386.scala b/test/files/pos/t6386.scala new file mode 100644 index 0000000000..85098a78f0 --- /dev/null +++ b/test/files/pos/t6386.scala @@ -0,0 +1,5 @@ +import scala.reflect.runtime.universe._ + +object Test extends App { + reify(manifest[Some[_]]) +}
\ No newline at end of file diff --git a/test/files/pos/t7315.flags b/test/files/pos/t7315.flags new file mode 100644 index 0000000000..d1b831ea87 --- /dev/null +++ b/test/files/pos/t7315.flags @@ -0,0 +1 @@ +-deprecation -Xfatal-warnings
\ No newline at end of file diff --git a/test/files/pos/t7315.scala b/test/files/pos/t7315.scala new file mode 100644 index 0000000000..0abcea2451 --- /dev/null +++ b/test/files/pos/t7315.scala @@ -0,0 +1,4 @@ +package scala.pack + +@deprecatedInheritance +class C[@specialized A]
\ No newline at end of file diff --git a/test/files/run/macro-expand-nullary-generic.check b/test/files/run/macro-expand-nullary-generic.check index 133840c469..42976f4baf 100644 --- a/test/files/run/macro-expand-nullary-generic.check +++ b/test/files/run/macro-expand-nullary-generic.check @@ -1,6 +1,6 @@ -it works TypeTag[Int] -it works TypeTag[Int] -it works TypeTag[Int] -it works TypeTag[Int] -it works TypeTag[Int] +it works WeakTypeTag[Int] +it works WeakTypeTag[Int] +it works WeakTypeTag[Int] +it works WeakTypeTag[Int] +it works WeakTypeTag[Int] kkthxbai diff --git a/test/files/run/macro-expand-tparams-explicit.check b/test/files/run/macro-expand-tparams-explicit.check index e7e6718406..b6b4f6fa3a 100644 --- a/test/files/run/macro-expand-tparams-explicit.check +++ b/test/files/run/macro-expand-tparams-explicit.check @@ -1 +1 @@ -TypeTag[Int] +WeakTypeTag[Int] diff --git a/test/files/run/macro-expand-tparams-implicit.check b/test/files/run/macro-expand-tparams-implicit.check index fa6b335afb..a9bf55423e 100644 --- a/test/files/run/macro-expand-tparams-implicit.check +++ b/test/files/run/macro-expand-tparams-implicit.check @@ -1,2 +1,2 @@ -TypeTag[Int] +WeakTypeTag[Int] WeakTypeTag[String] diff --git a/test/files/run/macro-expand-tparams-prefix-a.check b/test/files/run/macro-expand-tparams-prefix-a.check index 0bf3c55bbe..ca44a4f652 100644 --- a/test/files/run/macro-expand-tparams-prefix-a.check +++ b/test/files/run/macro-expand-tparams-prefix-a.check @@ -1,4 +1,4 @@ -TypeTag[Int] -TypeTag[Int] +WeakTypeTag[Int] +WeakTypeTag[Int] WeakTypeTag[String] -TypeTag[Boolean] +WeakTypeTag[Boolean] diff --git a/test/files/run/macro-expand-tparams-prefix-b.check b/test/files/run/macro-expand-tparams-prefix-b.check index 77c2ee9051..2ff2ce435d 100644 --- a/test/files/run/macro-expand-tparams-prefix-b.check +++ b/test/files/run/macro-expand-tparams-prefix-b.check @@ -1,2 +1,2 @@ -TypeTag[Boolean] TypeTag[Int] -TypeTag[Boolean] WeakTypeTag[String] +WeakTypeTag[Boolean] WeakTypeTag[Int] +WeakTypeTag[Boolean] WeakTypeTag[String] diff --git a/test/files/run/macro-expand-tparams-prefix-c1.check b/test/files/run/macro-expand-tparams-prefix-c1.check index f0dd5b9cd8..0f24f74db1 100644 --- a/test/files/run/macro-expand-tparams-prefix-c1.check +++ b/test/files/run/macro-expand-tparams-prefix-c1.check @@ -1,3 +1,3 @@ -TypeTag[Int] +WeakTypeTag[Int] WeakTypeTag[String] -TypeTag[Boolean] +WeakTypeTag[Boolean] diff --git a/test/files/run/macro-expand-tparams-prefix-c2.check b/test/files/run/macro-expand-tparams-prefix-c2.check index f0dd5b9cd8..0f24f74db1 100644 --- a/test/files/run/macro-expand-tparams-prefix-c2.check +++ b/test/files/run/macro-expand-tparams-prefix-c2.check @@ -1,3 +1,3 @@ -TypeTag[Int] +WeakTypeTag[Int] WeakTypeTag[String] -TypeTag[Boolean] +WeakTypeTag[Boolean] diff --git a/test/files/run/macro-expand-tparams-prefix-d1.check b/test/files/run/macro-expand-tparams-prefix-d1.check index c5aaaf5a09..7832503256 100644 --- a/test/files/run/macro-expand-tparams-prefix-d1.check +++ b/test/files/run/macro-expand-tparams-prefix-d1.check @@ -1,3 +1,3 @@ WeakTypeTag[T] WeakTypeTag[U] -TypeTag[Boolean] +WeakTypeTag[Boolean] diff --git a/test/files/run/macro-undetparams-consfromsls.check b/test/files/run/macro-undetparams-consfromsls.check index b10a90043e..3fee58d9c1 100644 --- a/test/files/run/macro-undetparams-consfromsls.check +++ b/test/files/run/macro-undetparams-consfromsls.check @@ -1,5 +1,5 @@ -A = TypeTag[Int] -B = TypeTag[Nothing] +A = WeakTypeTag[Int] +B = WeakTypeTag[Nothing] List(1) -A = TypeTag[Any] +A = WeakTypeTag[Any] List(abc, 1) diff --git a/test/files/run/macro-undetparams-macroitself.check b/test/files/run/macro-undetparams-macroitself.check index fa6b335afb..a9bf55423e 100644 --- a/test/files/run/macro-undetparams-macroitself.check +++ b/test/files/run/macro-undetparams-macroitself.check @@ -1,2 +1,2 @@ -TypeTag[Int] +WeakTypeTag[Int] WeakTypeTag[String] diff --git a/test/files/run/reify-each-node-type.check b/test/files/run/reify-each-node-type.check new file mode 100644 index 0000000000..af6fd13a7b --- /dev/null +++ b/test/files/run/reify-each-node-type.check @@ -0,0 +1,35 @@ + 1 s Ident + 2 r.List Select + 3 r.List.apply() Apply + 4 r.List.apply(1) Literal + 5 r.List.apply[Int]() TypeApply + 6 (1: Int) Typed + 7 (null: r.List[Int]) AppliedTypeTree + 8 { (); () } Block + 9 { val x: Int = 0; () } ValDef +10 { val x = 0; () } TypeTree +11 if (true) () else () If +12 { def f: Unit = (); () } DefDef +13 { def m = NN.super.q; () } Super +14 { abstract trait A extends AnyRef; () } ClassDef Template +15 { def f(x: Any): Unit = (); () } EmptyTree +16 (null: r.D with r.E) CompoundTypeTree +17 { type T = Int; () } TypeDef +18 { type CC[T >: Nothing <: r.D] = r.C[T]; () } TypeBoundsTree +19 try { 0 } finally Predef.println("") Try +20 ((x: Int) => x) Function +21 { var v = 1; v = 2 } Assign +22 { class A extends AnyRef { def <init>() = { super.<init>(); This +23 new r.List[Int]() New +24 0: @unchecked Annotated +25 (null: r.Outer#Inner) SelectFromTypeTree +26 (null: Nil.type) SingletonTypeTree +27 (null: T forSome { type T >: Nothing <: Any }) ExistentialTypeTree +28 { import r.{A, B=>C}; () } Import +29 { def f: Int = return 0; () } Return +30 { object x extends AnyRef { def <init>() = { super.<init>(); ModuleDef +31 throw new Exception() Throw +32 0 match { case _ => 0 } Match CaseDef +33 0 match { case (1| 2) => 0 } Alternative +34 NN.q match { case (x @ r.List) => 0 } Bind +35 NN.q match { case r.UnSeq(1, (_)*) => 0 } Star diff --git a/test/files/run/reify-each-node-type.scala b/test/files/run/reify-each-node-type.scala new file mode 100644 index 0000000000..a827da766d --- /dev/null +++ b/test/files/run/reify-each-node-type.scala @@ -0,0 +1,108 @@ +import scala.reflect.runtime.universe._ + +object r { + class A + class B + class List[+A] + object List { def apply[A](xs: A*): List[A] = new List[A] } + object Nil extends List[Nothing] + + trait OuterP[A] { + trait Inner + trait InnerP[B] + } + trait Outer { + trait Inner + trait InnerP[B] + } + object Un { def unapply(x: Any) = Some(5) } + object UnSeq { def unapplySeq(x: Any) = Some(Seq(5)) } + class C[T] + class D + trait E + + trait SN { + def q: Any = null + } +} + +object s { + import r._ + + trait NN extends SN { + def act[T](expr: Expr[T]): Unit + + act(reify { s /* Ident */ }) + act(reify { r.List /* Select */ }) + act(reify { List() /* Apply */ }) + act(reify { List(1) /* Literal */ }) + act(reify { List[Int]() /* TypeApply */ }) + act(reify { 1: Int /* Typed */ }) + act(reify { null: List[Int] /* AppliedTypeTree */ }) + act(reify { () ; () /* Block */ }) + act(reify { val x: Int = 0 /* ValDef */ }) + act(reify { val x = 0 /* TypeTree */ }) + act(reify { if (true) () /* If */ }) + act(reify { def f { } /* DefDef */ }) + act(reify { def m = super.q /* Super */ }) + act(reify { trait A /* ClassDef Template */ }) + act(reify { def f(x: Any) { } /* EmptyTree */ }) + act(reify { null: D with E /* CompoundTypeTree */ }) + act(reify { type T = Int /* TypeDef */ }) + act(reify { type CC[T <: D] = C[T] /* TypeBoundsTree */ }) + act(reify { try 0 finally println("") /* Try */ }) + act(reify { (x: Int) => x /* Function */ }) + act(reify { var v = 1 ; v = 2 /* Assign */ }) + act(reify { class A() { def this(x: A) = this() } /* This */ }) + act(reify { new List[Int] /* New */ }) + act(reify { 0: @unchecked /* Annotated */ }) + act(reify { null: Outer#Inner /* SelectFromTypeTree */ }) + act(reify { null: Nil.type /* SingletonTypeTree */ }) + act(reify { null: (T forSome { type T }) /* ExistentialTypeTree */ }) + act(reify { import r.{ A, B => C }; /* Import */ }) + act(reify { def f: Int = return 0 /* Return */ }) + act(reify { object x /* ModuleDef */ }) + act(reify { throw new java.lang.Exception /* Throw */ }) + act(reify { 0 match { case _ => 0 } /* Match CaseDef */ }) + act(reify { 0 match { case 1 | 2 => 0 } /* Alternative */ }) + act(reify { q match { case x @ List => 0 } /* Bind */ }) + act(reify { q match { case UnSeq(1, _*) => 0 } /* Star */ }) + + // ``unexpected: bound type that doesn't have a tpe: Ident(newTypeName("Int"))'' + // act(reify { r.List[T forSome { type T <: Int }]() }) // Was crashing , no longer + // + // error: exception during macro expansion: + // scala.MatchError: collection.this.Seq.unapplySeq[A] (of class scala.reflect.internal.Trees$TypeApply) + // at scala.reflect.reify.phases.Reshape$$anon$1.extractExtractor$1(Reshape.scala:73) + // at scala.reflect.reify.phases.Reshape$$anon$1.transform(Reshape.scala:82) + // at scala.reflect.reify.phases.Reshape$$anon$1.transform(Reshape.scala:24) + // at scala.reflect.internal.Trees$class.itransform(Trees.scala:1290) + // + // act(reify { r.List[Any]() match { case Seq(1, _*) => 1 } } ) + + // act(reify { List[OuterP[Int]#InnerP[Byte]]() }) + // + // SI-7243 + // + // test/files/run/reify-each-node-type.scala:85: error: Cannot materialize r.List.apply[r.OuterP[Int]#InnerP[Byte]]() as { ... } because: + // scala.reflect.macros.TypecheckException: value TypeTreeWithDeferredRefCheck is not a member of type parameter U + // act(reify { List[OuterP[Int]#InnerP[Byte]]() }) + // ^ + // one error found + } +} + +object Test { + var idx = 0 + val seen = scala.collection.mutable.Set[String]() + + object N extends s.NN { + def act[T](expr: Expr[T]): Unit = { + idx += 1 + val ts = expr.tree filter (_ => true) map (_.getClass.getName split "[.$]" last) filterNot seen distinct; + println("%2d %60s %s".format(idx, expr.tree.toString.replaceAll("""\s+""", " ").take(60), ts mkString " ")) + seen ++= ts + } + } + def main(args: Array[String]): Unit = N +} diff --git a/test/files/run/t6937.check b/test/files/run/t6937.check new file mode 100644 index 0000000000..9a1fa4cfaf --- /dev/null +++ b/test/files/run/t6937.check @@ -0,0 +1,26 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> + +scala> import scala.reflect.runtime.{universe => ru} +import scala.reflect.runtime.{universe=>ru} + +scala> import scala.reflect.runtime.{currentMirror => cm} +import scala.reflect.runtime.{currentMirror=>cm} + +scala> import scala.reflect.api.{Universe => ApiUniverse} +import scala.reflect.api.{Universe=>ApiUniverse} + +scala> class A +defined class A + +scala> lazy val apiru = ru: ApiUniverse +apiru: scala.reflect.api.Universe = <lazy> + +scala> apiru.typeTag[A].in(cm) +res0: reflect.runtime.universe.TypeTag[A] = TypeTag[A] + +scala> + +scala> diff --git a/test/files/run/t6937.scala b/test/files/run/t6937.scala new file mode 100644 index 0000000000..4b30894bf3 --- /dev/null +++ b/test/files/run/t6937.scala @@ -0,0 +1,12 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + import scala.reflect.runtime.{universe => ru} + import scala.reflect.runtime.{currentMirror => cm} + import scala.reflect.api.{Universe => ApiUniverse} + class A + lazy val apiru = ru: ApiUniverse + apiru.typeTag[A].in(cm) + """ +}
\ No newline at end of file diff --git a/test/files/run/t7341.check b/test/files/run/t7341.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/files/run/t7341.check diff --git a/test/files/run/t7341.flags b/test/files/run/t7341.flags new file mode 100755 index 0000000000..ae08446055 --- /dev/null +++ b/test/files/run/t7341.flags @@ -0,0 +1 @@ +-Xcheckinit
\ No newline at end of file diff --git a/test/files/run/t7341.scala b/test/files/run/t7341.scala new file mode 100755 index 0000000000..dc526c6c19 --- /dev/null +++ b/test/files/run/t7341.scala @@ -0,0 +1,15 @@ +object Obj { + private var cache: Any = () + def returning(f: () => Unit) = () + def foo { + returning(() => cache = ()) + } + + def apply(): Any = { + cache + } +} + +object Test extends App { + Obj() +} diff --git a/test/partest b/test/partest index 8243316cca..e3270f8eaa 100755 --- a/test/partest +++ b/test/partest @@ -75,6 +75,22 @@ if [ -z "$EXT_CLASSPATH" ] ; then fi fi +# Locate a javac command +# Try: JAVA_HOME, sibling to specific JAVACMD, or PATH +# Don't fail if there is no javac, since not all tests require it. +if [ -z "$JAVAC_CMD" ] ; then + if [ -n "${JAVA_HOME}" ] && [ -f "${JAVA_HOME}/bin/javac" ] ; then + JAVAC_CMD="${JAVA_HOME}/bin/javac" + fi + if [ -z "$JAVAC_CMD" ] && [ -n "$JAVACMD" ] ; then + JDIR=`dirname "${JAVACMD}"` + JAVAC_CMD="${JDIR}/javac" + fi + if [ -z "$JAVAC_CMD" ] ; then + JAVAC_CMD=`type -p javac` + fi +fi + if $cygwin; then if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then format=mixed @@ -87,6 +103,9 @@ if $cygwin; then if [ -n "${JAVACMD}" ] ; then JAVACMD=`cygpath --$format "$JAVACMD"` fi + if [ -n "${JAVAC_CMD}" ] ; then + JAVAC_CMD=`cygpath --$format "$JAVAC_CMD"` + fi SCALA_HOME=`cygpath --$format "$SCALA_HOME"` EXT_CLASSPATH=`cygpath --path --$format "$EXT_CLASSPATH"` fi @@ -97,8 +116,8 @@ fi JAVA_OPTS="-Xmx1024M -Xms64M -XX:MaxPermSize=128M $JAVA_OPTS" # the ant task doesn't supply any options by default, -# so don't to that here either -- note that you may want to pass -optimise -# to mimic what happens during nightlies +# so don't do that here either -- note that you may want to pass -optimise +# to mimic what happens during nightlies. # [ -n "$SCALAC_OPTS" ] || SCALAC_OPTS="-deprecation" partestDebugStr="" @@ -114,5 +133,5 @@ fi -Dpartest.javacmd="${JAVACMD}" \ -Dpartest.java_opts="${JAVA_OPTS}" \ -Dpartest.scalac_opts="${SCALAC_OPTS}" \ - -Dpartest.javac_cmd="${JAVA_HOME}/bin/javac" \ + -Dpartest.javac_cmd="${JAVAC_CMD}" \ scala.tools.partest.nest.NestRunner "$@" diff --git a/test/files/run/t6387.check b/test/pending/run/t6387.check index 83b33d238d..83b33d238d 100644 --- a/test/files/run/t6387.check +++ b/test/pending/run/t6387.check diff --git a/test/files/run/t6387.scala b/test/pending/run/t6387.scala index bbebb5f511..bbebb5f511 100644 --- a/test/files/run/t6387.scala +++ b/test/pending/run/t6387.scala |