From bce614f1bb242c480a005f44ee742a02af60da78 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Tue, 25 Feb 2020 16:09:32 +1000 Subject: [PATCH 01/46] Heed warning about cache invalidation after making object Serializable Compiling the enclosed test case with `-Xdev` told me: ``` warning: !!! base trait Serializable not found in basetypes of object Person. This might indicate incorrect caching of TypeRef#parents. ``` Indeed, the `ModuleTypeRef` associated with the newly seralizable module class had cached the base type sequence prior to the addition of `Serializable`. A more serious examination of how we add this parent would be worthwhile, but for now I'll just do a bandaid job by invalidating internal caches of the `ModuleTypeRef`. --- src/reflect/scala/reflect/internal/Symbols.scala | 1 + test/files/pos/case-object-add-serializable.flags | 1 + test/files/pos/case-object-add-serializable.scala | 10 ++++++++++ 3 files changed, 12 insertions(+) create mode 100644 test/files/pos/case-object-add-serializable.flags create mode 100644 test/files/pos/case-object-add-serializable.scala diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index ce0b975f7c0e..7d59b45b2f03 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -1840,6 +1840,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => info match { case ci @ ClassInfoType(_, _, _) => setInfo(ci.copy(parents = ci.parents :+ SerializableTpe)) + invalidateCaches(ci.typeSymbol.typeOfThis.underlying, ci.typeSymbol :: Nil) case i => abort("Only ClassInfoTypes can be made serializable: "+ i) } diff --git a/test/files/pos/case-object-add-serializable.flags b/test/files/pos/case-object-add-serializable.flags new file mode 100644 index 000000000000..1134633fd40a --- /dev/null +++ b/test/files/pos/case-object-add-serializable.flags @@ -0,0 +1 @@ +-Xdev -Xfatal-warnings diff --git a/test/files/pos/case-object-add-serializable.scala b/test/files/pos/case-object-add-serializable.scala new file mode 100644 index 000000000000..dae3e9ab922d --- /dev/null +++ b/test/files/pos/case-object-add-serializable.scala @@ -0,0 +1,10 @@ +// Was: "warning: !!! base trait Serializable not found in basetypes of object Person. This might indicate incorrect caching of TypeRef#parents." +// under -Xdev +class Test { + def apply = { + case class Person(name: String) + val x = Person("") + Person.getClass + x.name + } +} From 181eb8191a7031b69eccbeda5a0cafc2fcc664ac Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Tue, 23 Jun 2020 18:55:30 +1000 Subject: [PATCH 02/46] [backport] Rework recent, buggy change to immutable.TreeMap We need to favour keys from the left that equivalent (but ne), while favouring values from the right. (cherry picked from commit abd82a2f120f66c0303791768e806b7fb82db7c2) --- .../collection/immutable/RedBlackTree.scala | 34 +++++++++---------- .../collection/immutable/TreeMapTest.scala | 9 +++++ 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/library/scala/collection/immutable/RedBlackTree.scala b/src/library/scala/collection/immutable/RedBlackTree.scala index 92ade8ee1d92..86e4ec9079a1 100644 --- a/src/library/scala/collection/immutable/RedBlackTree.scala +++ b/src/library/scala/collection/immutable/RedBlackTree.scala @@ -820,17 +820,17 @@ private[collection] object RedBlackTree { } else mkTree(isRedTree(tl) || isRedTree(tr), k, v, tl, tr) } - private[this] def split[A, B](t: Tree[A, B], k: A)(implicit ordering: Ordering[A]): (Tree[A, B], Tree[A, B], Tree[A, B]) = - if(t eq null) (null, null, null) + private[this] def split[A, B](t: Tree[A, B], k2: A)(implicit ordering: Ordering[A]): (Tree[A, B], Tree[A, B], Tree[A, B], A) = + if(t eq null) (null, null, null, k2) else { - val cmp = ordering.compare(k, t.key) - if(cmp == 0) (t.left, t, t.right) + val cmp = ordering.compare(k2, t.key) + if(cmp == 0) (t.left, t, t.right, t.key) else if(cmp < 0) { - val (ll, b, lr) = split(t.left, k) - (ll, b, join(lr, t.key, t.value, t.right)) + val (ll, b, lr, k1) = split(t.left, k2) + (ll, b, join(lr, t.key, t.value, t.right), k1) } else { - val (rl, b, rr) = split(t.right, k) - (join(t.left, t.key, t.value, rl), b, rr) + val (rl, b, rr, k1) = split(t.right, k2) + (join(t.left, t.key, t.value, rl), b, rr, k1) } } @@ -853,20 +853,20 @@ private[collection] object RedBlackTree { if((t1 eq null) || (t1 eq t2)) t2 else if(t2 eq null) t1 else { - val (l2, _, r2) = split(t2, t1.key) - val tl = _union(t1.left, l2) - val tr = _union(t1.right, r2) - join(tl, t1.key, t1.value, tr) + val (l1, _, r1, k1) = split(t1, t2.key) + val tl = _union(l1, t2.left) + val tr = _union(r1, t2.right) + join(tl, k1, t2.value, tr) } private[this] def _intersect[A, B](t1: Tree[A, B], t2: Tree[A, B])(implicit ordering: Ordering[A]): Tree[A, B] = if((t1 eq null) || (t2 eq null)) null else if (t1 eq t2) t1 else { - val (l2, b, r2) = split(t2, t1.key) - val tl = _intersect(t1.left, l2) - val tr = _intersect(t1.right, r2) - if(b ne null) join(tl, t1.key, t1.value, tr) + val (l1, b, r1, k1) = split(t1, t2.key) + val tl = _intersect(l1, t2.left) + val tr = _intersect(r1, t2.right) + if(b ne null) join(tl, k1, t2.value, tr) else join2(tl, tr) } @@ -874,7 +874,7 @@ private[collection] object RedBlackTree { if((t1 eq null) || (t2 eq null)) t1 else if (t1 eq t2) null else { - val (l1, _, r1) = split(t1, t2.key) + val (l1, _, r1, k1) = split(t1, t2.key) val tl = _difference(l1, t2.left) val tr = _difference(r1, t2.right) join2(tl, tr) diff --git a/test/junit/scala/collection/immutable/TreeMapTest.scala b/test/junit/scala/collection/immutable/TreeMapTest.scala index 3f6a3952f622..f89e061dd42b 100644 --- a/test/junit/scala/collection/immutable/TreeMapTest.scala +++ b/test/junit/scala/collection/immutable/TreeMapTest.scala @@ -200,4 +200,13 @@ class TreeMapTest extends AllocationTest { assertIdenticalKeys(Map((c0l, ())), TreeMap.newBuilder[C, Unit].++=(TreeMap((c0l, ()))).++=(HashMap((c0r, ()))).result()) assertIdenticalKeys(Map((c0l, ())), TreeMap.newBuilder[C, Unit].++=(TreeMap((c0l, ()))).++=(TreeMap((c0r, ()))).result()) } + + @Test + def overwriteEntryRegression(): Unit = { + val x = TreeMap(1 -> "herring", 2 -> "cod", 3 -> "salmon") + val y = TreeMap(3 -> "wish") + val r1 = x ++ y + val r2 = (x.toSeq ++ y.toSeq).toMap + assertEquals(r1, r2) + } } From 69d55a620e2071a5ea958549a3d1e85e208fdb97 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 24 Jun 2020 10:49:08 +1000 Subject: [PATCH 03/46] [backport] Disable all reusable instances in runtime reflection Cherry pick of e5c4820098afebfef8ac9c0e272a72eb82447298 --- src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala | 2 +- src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 2 +- src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 2 +- src/reflect/scala/reflect/internal/Variances.scala | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala index 98c91bb3967a..9bd91fa3d94e 100644 --- a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala +++ b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala @@ -304,7 +304,7 @@ abstract class SymbolLoaders { } } } - private val classFileDataReader: ReusableInstance[ReusableDataReader] = new ReusableInstance[ReusableDataReader](() => new ReusableDataReader(), enabled = true) + private lazy val classFileDataReader: ReusableInstance[ReusableDataReader] = new ReusableInstance[ReusableDataReader](() => new ReusableDataReader(), enabled = isCompilerUniverse) class ClassfileLoader(val classfile: AbstractFile, clazz: ClassSymbol, module: ModuleSymbol) extends SymbolLoader with FlagAssigningCompleter { private object classfileParser extends { val symbolTable: SymbolLoaders.this.symbolTable.type = SymbolLoaders.this.symbolTable diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index 442739e56dc9..0159d261f1e7 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -1119,7 +1119,7 @@ trait Contexts { self: Analyzer => * the search continuing as long as no qualifying name is found. */ // OPT: moved this into a (cached) object to avoid costly and non-eliminated {Object,Int}Ref allocations - private[Contexts] final val symbolLookupCache = ReusableInstance[SymbolLookup](new SymbolLookup, enabled = true) + private[Contexts] final val symbolLookupCache = ReusableInstance[SymbolLookup](new SymbolLookup, enabled = isCompilerUniverse) private[Contexts] final class SymbolLookup { private[this] var lookupError: NameLookup = _ // set to non-null if a definite error is encountered private[this] var inaccessible: NameLookup = _ // records inaccessible symbol for error reporting in case none is found diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index c2322dc5cb7c..4683e0824550 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -1737,7 +1737,7 @@ trait Implicits { def isShadowed(name: Name): Boolean } object Shadower { - private[this] val localShadowerCache = new ReusableInstance[LocalShadower](() => new LocalShadower, enabled = true) + private[this] val localShadowerCache = new ReusableInstance[LocalShadower](() => new LocalShadower, enabled = isCompilerUniverse) def using[T](local: Boolean)(f: Shadower => T): T = if (local) localShadowerCache.using { shadower => diff --git a/src/reflect/scala/reflect/internal/Variances.scala b/src/reflect/scala/reflect/internal/Variances.scala index 7057429bf023..20294270e263 100644 --- a/src/reflect/scala/reflect/internal/Variances.scala +++ b/src/reflect/scala/reflect/internal/Variances.scala @@ -213,7 +213,7 @@ trait Variances { final def varianceInType(tp: Type)(tparam: Symbol): Variance = { varianceInTypeCache.using(_.apply(tp, tparam)) } - private[this] val varianceInTypeCache = new ReusableInstance[varianceInType](() => new varianceInType, enabled = true) + private[this] val varianceInTypeCache = new ReusableInstance[varianceInType](() => new varianceInType, enabled = isCompilerUniverse) private final class varianceInType { private[this] var tp: Type = _ From e675917e22face2874193175bfa6fa567563a13e Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 24 Jun 2020 11:59:41 +0200 Subject: [PATCH 04/46] [nomerge] small cleanups --- src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 2 +- src/library/scala/collection/immutable/HashMap.scala | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 57f7fc83c7da..40049c90a07c 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -1292,7 +1292,7 @@ abstract class RefChecks extends Transform { |it should have been processed and eliminated during expansion of an enclosing macro.""" // The getOrElse part should never happen, it's just here as a backstop. val msg = sym.compileTimeOnlyMessage getOrElse defaultMsg - reporter.error(pos, sym.compileTimeOnlyMessage getOrElse defaultMsg) + reporter.error(pos, msg) } } } diff --git a/src/library/scala/collection/immutable/HashMap.scala b/src/library/scala/collection/immutable/HashMap.scala index c2cabf13102e..b6b0d0545f23 100644 --- a/src/library/scala/collection/immutable/HashMap.scala +++ b/src/library/scala/collection/immutable/HashMap.scala @@ -187,7 +187,7 @@ sealed class HashMap[A, +B] extends AbstractMap[A, B] this.merge0(thatHash, 0, concatMerger[A, B]) case that => var result: HashMap[A, B] = this - that.asInstanceOf[GenTraversableOnce[(A, B)]] foreach { case kv: (_, _) => result = result + kv } + that.asInstanceOf[GenTraversableOnce[(A, B)]].foreach(result += _) result } castToThat(result) @@ -212,9 +212,9 @@ sealed class HashMap[A, +B] extends AbstractMap[A, B] val merger = HashMap.concatMerger[A, B].invert val result: HashMap[A, B] = that match { case thatHash: HashMap[A, B] => - this.merge0(thatHash, 0, HashMap.concatMerger[A, B].invert) + this.merge0(thatHash, 0, merger) - case that:HasForeachEntry[A, B] => + case that: HasForeachEntry[A, B] => object adder extends Function2[A, B, Unit] { var result: HashMap[A, B] = HashMap.this override def apply(key: A, value: B): Unit = { @@ -231,7 +231,7 @@ sealed class HashMap[A, +B] extends AbstractMap[A, B] result = result.updated0(key, computeHash(key), 0, kv._2, kv, merger) } } - that.asInstanceOf[scala.Traversable[(A,B)]] foreach adder + that.asInstanceOf[GenTraversableOnce[(A,B)]] foreach adder adder.result } castToThat(result) From 5ba248e8190ec71070e95ebd307fe30e69d64f23 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 25 Jun 2020 11:21:42 +1000 Subject: [PATCH 05/46] Add a comment to HashMap.castToThat --- src/library/scala/collection/immutable/HashMap.scala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/library/scala/collection/immutable/HashMap.scala b/src/library/scala/collection/immutable/HashMap.scala index b6b0d0545f23..1997f1e6908d 100644 --- a/src/library/scala/collection/immutable/HashMap.scala +++ b/src/library/scala/collection/immutable/HashMap.scala @@ -237,6 +237,9 @@ sealed class HashMap[A, +B] extends AbstractMap[A, B] castToThat(result) } } + + // These methods exist to encapsulate the `.asInstanceOf[That]` in a slightly safer way -- only suitable values can + // be cast and the type of the `CanBuildFrom` guides type inference. private[this] def castToThat[C, That](m: HashMap[A, B])(implicit bf: CanBuildFrom[HashMap[A, B], C, That]): That = { m.asInstanceOf[That] } From 559f6fbdaed89474721e815e27f08f64001e42f7 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 1 Jul 2020 14:23:00 +1000 Subject: [PATCH 06/46] Refactor prior fix to module class symbol cache invalidation --- src/reflect/scala/reflect/internal/Symbols.scala | 2 +- src/reflect/scala/reflect/internal/Types.scala | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index 7d59b45b2f03..413559c4c073 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -1840,7 +1840,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => info match { case ci @ ClassInfoType(_, _, _) => setInfo(ci.copy(parents = ci.parents :+ SerializableTpe)) - invalidateCaches(ci.typeSymbol.typeOfThis.underlying, ci.typeSymbol :: Nil) + invalidateCaches(ci.typeSymbol.typeOfThis, ci.typeSymbol :: Nil) case i => abort("Only ClassInfoTypes can be made serializable: "+ i) } diff --git a/src/reflect/scala/reflect/internal/Types.scala b/src/reflect/scala/reflect/internal/Types.scala index 94a7eeca12c3..7034d15f4826 100644 --- a/src/reflect/scala/reflect/internal/Types.scala +++ b/src/reflect/scala/reflect/internal/Types.scala @@ -4744,11 +4744,15 @@ trait Types invalidateCaches(tp, updatedSyms) } - def invalidateCaches(t: Type, updatedSyms: List[Symbol]) = + def invalidateCaches(t: Type, updatedSyms: List[Symbol]): Unit = t match { - case st: SingleType if updatedSyms.contains(st.sym) => st.invalidateSingleTypeCaches() case tr: TypeRef if updatedSyms.contains(tr.sym) => tr.invalidateTypeRefCaches() case ct: CompoundType if ct.baseClasses.exists(updatedSyms.contains) => ct.invalidatedCompoundTypeCaches() + case st: SingleType => + if (updatedSyms.contains(st.sym)) st.invalidateSingleTypeCaches() + val underlying = st.underlying + if (underlying ne st) + invalidateCaches(underlying, updatedSyms) case _ => } From 1fb249c635d5748d5de5c96b9c7eb93a2c29f830 Mon Sep 17 00:00:00 2001 From: mkeskells Date: Sun, 28 Jun 2020 16:27:36 +0100 Subject: [PATCH 07/46] Use java.util.Arrays.copyOf to extend or contract arrays, when the content of the previous array is to be copied into the new Array Use clone when the array is not changing length Maintain empty Arrays in the Array object, and use them where possible Maintain empty WrappedArrays in WrappedArrays object and use where possible --- build.sbt | 5 +- .../tools/nsc/backend/jvm/BCodeHelpers.scala | 2 +- .../backend/jvm/analysis/AliasingFrame.scala | 4 +- .../backend/jvm/analysis/BackendUtils.scala | 7 +- .../tools/nsc/backend/jvm/opt/LocalOpt.scala | 7 +- src/library/scala/Array.scala | 32 +++++--- .../scala/collection/concurrent/TrieMap.scala | 4 +- .../collection/mutable/ArrayBuilder.scala | 58 ++++++++------- .../scala/collection/mutable/BitSet.scala | 20 ++--- .../mutable/WrappedArrayBuilder.scala | 74 +++++++++++++++---- .../collection/parallel/mutable/package.scala | 7 +- .../internal/pickling/PickleBuffer.scala | 6 +- .../interpreter/jline/JLineDelimiter.scala | 2 +- 13 files changed, 130 insertions(+), 98 deletions(-) diff --git a/build.sbt b/build.sbt index 44d3252991af..e897778cf230 100644 --- a/build.sbt +++ b/build.sbt @@ -352,7 +352,10 @@ val mimaFilterSettings = Seq { ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.generic.SortedSetFactory#SortedSetCanBuildFrom.factory"), ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.generic.SortedSetFactory#SortedSetCanBuildFrom.ordering"), - // + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.Array.emptyUnitArray"), + ProblemFilters.exclude[MissingClassProblem]("scala.collection.mutable.WrappedArrayBuilder$"), + + // // scala-reflect // ProblemFilters.exclude[Problem]("scala.reflect.internal.*"), diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala index ad92b21b2967..ab5dbcb841ff 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeHelpers.scala @@ -385,7 +385,7 @@ abstract class BCodeHelpers extends BCodeIdiomatic { * can-multi-thread */ def pickleMarkerForeign = { - createJAttribute(tpnme.ScalaATTR.toString, new Array[Byte](0), 0, 0) + createJAttribute(tpnme.ScalaATTR.toString, Array.emptyByteArray, 0, 0) } /* Returns a ScalaSignature annotation if it must be added to this class, none otherwise. diff --git a/src/compiler/scala/tools/nsc/backend/jvm/analysis/AliasingFrame.scala b/src/compiler/scala/tools/nsc/backend/jvm/analysis/AliasingFrame.scala index 6eb12e107afe..fd616da13af4 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/analysis/AliasingFrame.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/analysis/AliasingFrame.scala @@ -502,9 +502,7 @@ object AliasSet { else { var newLength = set.length while (index >= newLength) newLength *= 2 - val newSet = new Array[Long](newLength) - Array.copy(set, 0, newSet, 0, set.length) - newSet + java.util.Arrays.copyOf(set, newLength) } } diff --git a/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala b/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala index 06173a72d135..44c948800f66 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala @@ -466,11 +466,8 @@ abstract class BackendUtils extends PerRunInit { var queue = new Array[Int](8) var top = -1 def enq(i: Int): Unit = { - if (top == queue.length - 1) { - val nq = new Array[Int](queue.length * 2) - Array.copy(queue, 0, nq, 0, queue.length) - queue = nq - } + if (top == queue.length - 1) + queue = java.util.Arrays.copyOf(queue, queue.length * 2) top += 1 queue(top) = i } diff --git a/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala b/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala index cf7fd62f48d2..b77b24416446 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/opt/LocalOpt.scala @@ -510,11 +510,8 @@ abstract class LocalOpt { var queue = new Array[Int](8) var top = -1 def enq(i: Int): Unit = { - if (top == queue.length - 1) { - val nq = new Array[Int](queue.length * 2) - Array.copy(queue, 0, nq, 0, queue.length) - queue = nq - } + if (top == queue.length - 1) + queue = java.util.Arrays.copyOf(queue, queue.length * 2) top += 1 queue(top) = i } diff --git a/src/library/scala/Array.scala b/src/library/scala/Array.scala index a4afc3495bf2..71cd7b302223 100644 --- a/src/library/scala/Array.scala +++ b/src/library/scala/Array.scala @@ -51,15 +51,23 @@ class FallbackArrayBuilding { * @since 1.0 */ object Array extends FallbackArrayBuilding { - val emptyBooleanArray = new Array[Boolean](0) - val emptyByteArray = new Array[Byte](0) - val emptyCharArray = new Array[Char](0) - val emptyDoubleArray = new Array[Double](0) - val emptyFloatArray = new Array[Float](0) - val emptyIntArray = new Array[Int](0) - val emptyLongArray = new Array[Long](0) - val emptyShortArray = new Array[Short](0) - val emptyObjectArray = new Array[Object](0) + private val emptyArrays = new ClassValue[AnyRef] { + override def computeValue(cls: Class[_]): AnyRef = + java.lang.reflect.Array.newInstance(cls, 0) + } + + val emptyBooleanArray = empty[Boolean] + val emptyByteArray = empty[Byte] + val emptyCharArray = empty[Char] + val emptyDoubleArray = empty[Double] + val emptyFloatArray = empty[Float] + val emptyIntArray = empty[Int] + val emptyLongArray = empty[Long] + val emptyShortArray = empty[Short] + + private[scala] //this is only private because of binary compatability + val emptyUnitArray = empty[scala.runtime.BoxedUnit].asInstanceOf[Array[Unit]] + val emptyObjectArray = empty[Object] implicit def canBuildFrom[T](implicit tag: ClassTag[T]): CanBuildFrom[Array[_], T, Array[T]] = { val cls = tag.runtimeClass @@ -179,8 +187,10 @@ object Array extends FallbackArrayBuilding { } /** Returns an array of length 0 */ - def empty[T: ClassTag]: Array[T] = new Array[T](0) - + def empty[T: ClassTag]: Array[T] = { + val cls = implicitly[ClassTag[T]].runtimeClass.asInstanceOf[Class[T]] + emptyArrays.get(cls).asInstanceOf[Array[T]] + } /** Creates an array with given elements. * * @param xs the elements to put in the array diff --git a/src/library/scala/collection/concurrent/TrieMap.scala b/src/library/scala/collection/concurrent/TrieMap.scala index 4f319accd2d9..4e449514d2c8 100644 --- a/src/library/scala/collection/concurrent/TrieMap.scala +++ b/src/library/scala/collection/concurrent/TrieMap.scala @@ -487,9 +487,7 @@ private[collection] final class CNode[K, V](val bitmap: Int, val array: Array[Ba } def updatedAt(pos: Int, nn: BasicNode, gen: Gen) = { - val len = array.length - val narr = new Array[BasicNode](len) - Array.copy(array, 0, narr, 0, len) + val narr = java.util.Arrays.copyOf(array, array.length) narr(pos) = nn new CNode[K, V](bitmap, narr, gen) } diff --git a/src/library/scala/collection/mutable/ArrayBuilder.scala b/src/library/scala/collection/mutable/ArrayBuilder.scala index 0103da7cab0c..397a9d9eb2fd 100644 --- a/src/library/scala/collection/mutable/ArrayBuilder.scala +++ b/src/library/scala/collection/mutable/ArrayBuilder.scala @@ -133,9 +133,9 @@ object ArrayBuilder { private var size: Int = 0 private def mkArray(size: Int): Array[Byte] = { - val newelems = new Array[Byte](size) - if (this.size > 0) Array.copy(elems, 0, newelems, 0, this.size) - newelems + if (size == 0) Array.emptyByteArray + else if (elems eq null) new Array(size) + else java.util.Arrays.copyOf(elems, size) } private def resize(size: Int) { @@ -198,9 +198,9 @@ object ArrayBuilder { private var size: Int = 0 private def mkArray(size: Int): Array[Short] = { - val newelems = new Array[Short](size) - if (this.size > 0) Array.copy(elems, 0, newelems, 0, this.size) - newelems + if (size == 0) Array.emptyShortArray + else if (elems eq null) new Array(size) + else java.util.Arrays.copyOf(elems, size) } private def resize(size: Int) { @@ -263,9 +263,9 @@ object ArrayBuilder { private var size: Int = 0 private def mkArray(size: Int): Array[Char] = { - val newelems = new Array[Char](size) - if (this.size > 0) Array.copy(elems, 0, newelems, 0, this.size) - newelems + if (size == 0) Array.emptyCharArray + else if (elems eq null) new Array(size) + else java.util.Arrays.copyOf(elems, size) } private def resize(size: Int) { @@ -328,9 +328,9 @@ object ArrayBuilder { private var size: Int = 0 private def mkArray(size: Int): Array[Int] = { - val newelems = new Array[Int](size) - if (this.size > 0) Array.copy(elems, 0, newelems, 0, this.size) - newelems + if (size == 0) Array.emptyIntArray + else if (elems eq null) new Array(size) + else java.util.Arrays.copyOf(elems, size) } private def resize(size: Int) { @@ -393,9 +393,9 @@ object ArrayBuilder { private var size: Int = 0 private def mkArray(size: Int): Array[Long] = { - val newelems = new Array[Long](size) - if (this.size > 0) Array.copy(elems, 0, newelems, 0, this.size) - newelems + if (size == 0) Array.emptyLongArray + else if (elems eq null) new Array(size) + else java.util.Arrays.copyOf(elems, size) } private def resize(size: Int) { @@ -458,9 +458,9 @@ object ArrayBuilder { private var size: Int = 0 private def mkArray(size: Int): Array[Float] = { - val newelems = new Array[Float](size) - if (this.size > 0) Array.copy(elems, 0, newelems, 0, this.size) - newelems + if (size == 0) Array.emptyFloatArray + else if (elems eq null) new Array(size) + else java.util.Arrays.copyOf(elems, size) } private def resize(size: Int) { @@ -523,9 +523,9 @@ object ArrayBuilder { private var size: Int = 0 private def mkArray(size: Int): Array[Double] = { - val newelems = new Array[Double](size) - if (this.size > 0) Array.copy(elems, 0, newelems, 0, this.size) - newelems + if (size == 0) Array.emptyDoubleArray + else if (elems eq null) new Array(size) + else java.util.Arrays.copyOf(elems, size) } private def resize(size: Int) { @@ -588,9 +588,9 @@ object ArrayBuilder { private var size: Int = 0 private def mkArray(size: Int): Array[Boolean] = { - val newelems = new Array[Boolean](size) - if (this.size > 0) Array.copy(elems, 0, newelems, 0, this.size) - newelems + if (size == 0) Array.emptyBooleanArray + else if (elems eq null) new Array(size) + else java.util.Arrays.copyOf(elems, size) } private def resize(size: Int) { @@ -663,10 +663,12 @@ object ArrayBuilder { def clear() { size = 0 } def result() = { - val ans = new Array[Unit](size) - var i = 0 - while (i < size) { ans(i) = (); i += 1 } - ans + if (size == 0) Array.emptyUnitArray + else { + val ans = new Array[Unit](size) + java.util.Arrays.fill(ans.asInstanceOf[Array[AnyRef]], ()) + ans + } } override def equals(other: Any): Boolean = other match { diff --git a/src/library/scala/collection/mutable/BitSet.scala b/src/library/scala/collection/mutable/BitSet.scala index b4099ea4b308..db49cbd55ba9 100644 --- a/src/library/scala/collection/mutable/BitSet.scala +++ b/src/library/scala/collection/mutable/BitSet.scala @@ -73,9 +73,7 @@ class BitSet(protected final var elems: Array[Long]) extends AbstractSet[Int] if (idx >= nwords) { var newlen = nwords while (idx >= newlen) newlen = (newlen * 2) min MaxSize - val elems1 = new Array[Long](newlen) - Array.copy(elems, 0, elems1, 0, nwords) - elems = elems1 + elems = java.util.Arrays.copyOf(elems, newlen) } } @@ -175,11 +173,8 @@ class BitSet(protected final var elems: Array[Long]) extends AbstractSet[Int] "immutability of the result.", "2.12.0") def toImmutable = immutable.BitSet.fromBitMaskNoCopy(elems) - override def clone(): BitSet = { - val elems1 = new Array[Long](elems.length) - Array.copy(elems, 0, elems1, 0, elems.length) - new BitSet(elems1) - } + override def clone(): BitSet = + new BitSet(elems.clone) } /** $factoryInfo @@ -198,13 +193,8 @@ object BitSet extends BitSetFactory[BitSet] { /** A bitset containing all the bits in an array */ def fromBitMask(elems: Array[Long]): BitSet = { val len = elems.length - if (len == 0) { - empty - } else { - val a = new Array[Long](len) - Array.copy(elems, 0, a, 0, len) - new BitSet(a) - } + if (len == 0) empty + else new BitSet(elems.clone) } /** A bitset containing all the bits in an array, wrapping the existing diff --git a/src/library/scala/collection/mutable/WrappedArrayBuilder.scala b/src/library/scala/collection/mutable/WrappedArrayBuilder.scala index 83b7a1c6a35e..aaa80648a985 100644 --- a/src/library/scala/collection/mutable/WrappedArrayBuilder.scala +++ b/src/library/scala/collection/mutable/WrappedArrayBuilder.scala @@ -35,24 +35,45 @@ class WrappedArrayBuilder[A](tag: ClassTag[A]) extends ReusableBuilder[A, Wrappe private var size: Int = 0 private def mkArray(size: Int): WrappedArray[A] = { - val runtimeClass = tag.runtimeClass - val newelems = if (runtimeClass.isPrimitive) { - runtimeClass match { - case java.lang.Integer.TYPE => new WrappedArray.ofInt(new Array[Int](size)).asInstanceOf[WrappedArray[A]] - case java.lang.Double.TYPE => new WrappedArray.ofDouble(new Array[Double](size)).asInstanceOf[WrappedArray[A]] - case java.lang.Long.TYPE => new WrappedArray.ofLong(new Array[Long](size)).asInstanceOf[WrappedArray[A]] - case java.lang.Float.TYPE => new WrappedArray.ofFloat(new Array[Float](size)).asInstanceOf[WrappedArray[A]] - case java.lang.Character.TYPE => new WrappedArray.ofChar(new Array[Char](size)).asInstanceOf[WrappedArray[A]] - case java.lang.Byte.TYPE => new WrappedArray.ofByte(new Array[Byte](size)).asInstanceOf[WrappedArray[A]] - case java.lang.Short.TYPE => new WrappedArray.ofShort(new Array[Short](size)).asInstanceOf[WrappedArray[A]] - case java.lang.Boolean.TYPE => new WrappedArray.ofBoolean(new Array[Boolean](size)).asInstanceOf[WrappedArray[A]] - case java.lang.Void.TYPE => new WrappedArray.ofUnit(new Array[Unit](size)).asInstanceOf[WrappedArray[A]] + if (size == 0) WrappedArrayBuilder.emptyWrappedArray(tag) + else { + import java.util.Arrays.copyOf + val runtimeClass = tag.runtimeClass + if (runtimeClass.isPrimitive) + runtimeClass match { + case java.lang.Integer.TYPE => + val array = if (elems eq null) new Array[Int](size) else copyOf(elems.array.asInstanceOf[Array[Int]], size) + new WrappedArray.ofInt(array).asInstanceOf[WrappedArray[A]] + case java.lang.Double.TYPE => + val array = if (elems eq null) new Array[Double](size) else copyOf(elems.array.asInstanceOf[Array[Double]], size) + new WrappedArray.ofDouble(array).asInstanceOf[WrappedArray[A]] + case java.lang.Long.TYPE => + val array = if (elems eq null) new Array[Long](size) else copyOf(elems.array.asInstanceOf[Array[Long]], size) + new WrappedArray.ofLong(array).asInstanceOf[WrappedArray[A]] + case java.lang.Float.TYPE => + val array = if (elems eq null) new Array[Float](size) else copyOf(elems.array.asInstanceOf[Array[Float]], size) + new WrappedArray.ofFloat(array).asInstanceOf[WrappedArray[A]] + case java.lang.Character.TYPE => + val array = if (elems eq null) new Array[Char](size) else copyOf(elems.array.asInstanceOf[Array[Char]], size) + new WrappedArray.ofChar(array).asInstanceOf[WrappedArray[A]] + case java.lang.Byte.TYPE => + val array = if (elems eq null) new Array[Byte](size) else copyOf(elems.array.asInstanceOf[Array[Byte]], size) + new WrappedArray.ofByte(array).asInstanceOf[WrappedArray[A]] + case java.lang.Short.TYPE => + val array = if (elems eq null) new Array[Short](size) else copyOf(elems.array.asInstanceOf[Array[Short]], size) + new WrappedArray.ofShort(array).asInstanceOf[WrappedArray[A]] + case java.lang.Boolean.TYPE => + val array = if (elems eq null) new Array[Boolean](size) else copyOf(elems.array.asInstanceOf[Array[Boolean]], size) + new WrappedArray.ofBoolean(array).asInstanceOf[WrappedArray[A]] + case java.lang.Void.TYPE => + val array = if (elems eq null) new Array[Unit](size) else copyOf(elems.array.asInstanceOf[Array[AnyRef]], size).asInstanceOf[Array[Unit]] + new WrappedArray.ofUnit(array).asInstanceOf[WrappedArray[A]] + } + else { + val array = if (elems eq null) new Array[A with AnyRef](size) else copyOf(elems.array.asInstanceOf[Array[A with AnyRef]], size) + new WrappedArray.ofRef(array).asInstanceOf[WrappedArray[A]] } - } else { - new WrappedArray.ofRef[A with AnyRef](tag.newArray(size).asInstanceOf[Array[A with AnyRef]]).asInstanceOf[WrappedArray[A]] } - if (this.size > 0) Array.copy(elems.array, 0, newelems.array, 0, this.size) - newelems } private def resize(size: Int) { @@ -91,3 +112,24 @@ class WrappedArrayBuilder[A](tag: ClassTag[A]) extends ReusableBuilder[A, Wrappe // todo: add ++= } +private [mutable] object WrappedArrayBuilder { + private def emptyWrappedArray[T](tag: ClassTag[T]): mutable.WrappedArray[T] = + emptyClass.get(tag.runtimeClass).asInstanceOf[WrappedArray[T]] + private[this] val emptyClass = new ClassValue[WrappedArray[_]] { + override def computeValue(cls: Class[_]): WrappedArray[_] = { + if (cls.isPrimitive) + cls match { + case java.lang.Integer.TYPE => new WrappedArray.ofInt(Array.emptyIntArray) + case java.lang.Double.TYPE => new WrappedArray.ofDouble(Array.emptyDoubleArray) + case java.lang.Long.TYPE => new WrappedArray.ofLong(Array.emptyLongArray) + case java.lang.Float.TYPE => new WrappedArray.ofFloat(Array.emptyFloatArray) + case java.lang.Character.TYPE => new WrappedArray.ofChar(Array.emptyCharArray) + case java.lang.Byte.TYPE => new WrappedArray.ofByte(Array.emptyByteArray) + case java.lang.Short.TYPE => new WrappedArray.ofShort(Array.emptyShortArray) + case java.lang.Boolean.TYPE => new WrappedArray.ofBoolean(Array.emptyBooleanArray) + case java.lang.Void.TYPE => new WrappedArray.ofUnit(Array.emptyUnitArray) + } + else new WrappedArray.ofRef(Array.empty.asInstanceOf[Array[_ <: AnyRef]]) + } + } +} diff --git a/src/library/scala/collection/parallel/mutable/package.scala b/src/library/scala/collection/parallel/mutable/package.scala index 0094bfd0be74..c594b61caf3e 100644 --- a/src/library/scala/collection/parallel/mutable/package.scala +++ b/src/library/scala/collection/parallel/mutable/package.scala @@ -65,11 +65,8 @@ package mutable { def internalArray = array def setInternalSize(s: Int) = size0 = s override def sizeHint(len: Int) = { - if (len > size && len >= 1) { - val newarray = new Array[AnyRef](len) - Array.copy(array, 0, newarray, 0, size0) - array = newarray - } + if (len > size && len >= 1) + java.util.Arrays.copyOf(array, len) } } diff --git a/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala b/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala index 3a633ab84bf8..35d9f40d777b 100644 --- a/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala +++ b/src/reflect/scala/reflect/internal/pickling/PickleBuffer.scala @@ -28,10 +28,8 @@ class PickleBuffer(data: Array[Byte], from: Int, to: Int) { var writeIndex = to /** Double bytes array */ - private def dble() { - val bytes1 = new Array[Byte](bytes.length * 2) - Array.copy(bytes, 0, bytes1, 0, writeIndex) - bytes = bytes1 + private def dble(): Unit = { + bytes = java.util.Arrays.copyOf(bytes, bytes.length * 2) } def ensureCapacity(capacity: Int) = diff --git a/src/repl-jline/scala/tools/nsc/interpreter/jline/JLineDelimiter.scala b/src/repl-jline/scala/tools/nsc/interpreter/jline/JLineDelimiter.scala index 27f68bc111fa..46aab3bfba80 100644 --- a/src/repl-jline/scala/tools/nsc/interpreter/jline/JLineDelimiter.scala +++ b/src/repl-jline/scala/tools/nsc/interpreter/jline/JLineDelimiter.scala @@ -19,7 +19,7 @@ import _root_.jline.console.completer.ArgumentCompleter.{ ArgumentDelimiter, Arg // implements a jline interface class JLineDelimiter extends ArgumentDelimiter { def toJLine(args: List[String], cursor: Int): ArgumentList = args match { - case Nil => new ArgumentList(new Array[String](0), 0, 0, cursor) + case Nil => new ArgumentList(Array.empty[String], 0, 0, cursor) case xs => new ArgumentList(xs.toArray, xs.size - 1, xs.last.length, cursor) } From b3c0fc09c1f65ed999dd49c686debf6791afaf42 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 9 Jul 2020 16:32:30 +0200 Subject: [PATCH 08/46] [backport] bring AssertUtil fixes to 2.12 Backport of PR 9106. IteratorTest.`flatMap is memory efficient in previous element` was copied from 2.13, as the 2.12 version was wrong (started failing with the fixed `assertThrows`). The change in AssertThrowsTest is backported from 4eab5e0679. --- .../junit/scala/collection/IteratorTest.scala | 40 ++++++--- .../tools/testing/AssertThrowsTest.scala | 9 +- .../scala/tools/testing/AssertUtil.scala | 90 ++++++++++++------- .../scala/tools/testing/AssertUtilTest.scala | 24 ++++- 4 files changed, 115 insertions(+), 48 deletions(-) diff --git a/test/junit/scala/collection/IteratorTest.scala b/test/junit/scala/collection/IteratorTest.scala index 4b47aca21291..5b18dde1f64e 100644 --- a/test/junit/scala/collection/IteratorTest.scala +++ b/test/junit/scala/collection/IteratorTest.scala @@ -358,30 +358,48 @@ class IteratorTest { assertTrue(hi.hasNext) } @Test def `flatMap is memory efficient in previous element`(): Unit = { + import java.lang.ref._ // Array.iterator holds onto array reference; by contrast, iterating over List walks tail. - // Avoid reaching seq1 through test class. - var seq1 = Array("first", "second") // captured, need to set to null - var seq11: String = null + // Avoid reaching seq1 through test class. Avoid testing Array.iterator. + class C extends Iterable[String] { + val ss = Array("first", "second") + + def iterator = new Iterator[String] { + var i = 0 + + def hasNext = i < ss.length + + def next() = if (hasNext) { i += 1; ss(i-1) } else Iterator.empty.next() + } + + def apply(i: Int) = ss(i) + } + val seq1 = new WeakReference(new C) val seq2 = List("third") val it0: Iterator[Int] = Iterator(1, 2) lazy val it: Iterator[String] = it0.flatMap { - case 1 => val r = seq1; seq1 = null; seq11 = r(1); r - case _ => check() ; seq2 + case 1 => Option(seq1.get).getOrElse(Nil) + case 2 => check(); seq2 + case _ => ??? } - def check() = assertNotReachable(seq1, it)(()) - def checkHasElement() = assertNotReachable(seq11, it)(()) + + def noop = () + + def check() = assertNotReachable(seq1.get, it)(noop) + + def checkHasElement() = assertNotReachable(Option(seq1.get).map(_.apply(1)).orNull, it)(noop) + assert(it.hasNext) assertEquals("first", it.next()) // verify that we're in the middle of seq1 - assertThrows[AssertionError](checkHasElement()) - seq11 = null - assertThrows[AssertionError](check()) + assertThrows[AssertionError](checkHasElement(), _.contains("held reference")) + assertThrows[AssertionError](check(), _.contains("held reference")) assert(it.hasNext) assertEquals("second", it.next()) assert(it.hasNext) - assertNotReachable(seq1, it) { + assertNotReachable(seq1.get, it) { assertEquals("third", it.next()) } assert(!it.hasNext) diff --git a/test/junit/scala/tools/testing/AssertThrowsTest.scala b/test/junit/scala/tools/testing/AssertThrowsTest.scala index 76758f51d2be..918f33c4170d 100644 --- a/test/junit/scala/tools/testing/AssertThrowsTest.scala +++ b/test/junit/scala/tools/testing/AssertThrowsTest.scala @@ -20,14 +20,15 @@ class AssertThrowsTest { def catchSubclass = assertThrows[Foo] { throw new SubFoo } @Test - def rethrowBar = - assertTrue("exception wasn't rethrown", { + def wrongThrow = + assertTrue("Wrong exception thrown", { try { assertThrows[Foo] { throw new Bar } false } catch { - case bar: Bar => true - case e: Throwable => fail(s"expected Bar but got $e"); false + case _: Bar => fail("Bar shouldn't have been rethrown"); false + case _: AssertionError => true + case t: Throwable => fail(s"expected AssertionError but got $t"); false } }) diff --git a/test/junit/scala/tools/testing/AssertUtil.scala b/test/junit/scala/tools/testing/AssertUtil.scala index c9b2fb8e4da2..069c9695c004 100644 --- a/test/junit/scala/tools/testing/AssertUtil.scala +++ b/test/junit/scala/tools/testing/AssertUtil.scala @@ -1,35 +1,41 @@ package scala.tools package testing -import org.junit.Assert -import Assert._ -import scala.reflect.ClassTag -import scala.runtime.ScalaRunTime.stringOf -import scala.collection.{ GenIterable, IterableLike } -import scala.collection.JavaConverters._ -import scala.collection.mutable import java.lang.ref._ -import java.lang.reflect._ +import java.lang.reflect.{Array => _, _} import java.util.IdentityHashMap +import org.junit.Assert.assertTrue + +import scala.collection.{GenIterable, IterableLike} +import scala.reflect.ClassTag +import scala.runtime.ScalaRunTime.stringOf +import scala.util.control.{ControlThrowable, NonFatal} + /** This module contains additional higher-level assert statements * that are ultimately based on junit.Assert primitives. */ object AssertUtil { - private final val timeout = 60 * 1000L // wait a minute + // junit fail is Unit + def fail(message: String): Nothing = throw new AssertionError(message) + + private final val timeout = 60 * 1000L // wait a minute private implicit class `ref helper`[A](val r: Reference[A]) extends AnyVal { - def isEmpty: Boolean = r.get == null + def isEmpty: Boolean = r.get == null def nonEmpty: Boolean = !isEmpty } + private implicit class `class helper`(val clazz: Class[_]) extends AnyVal { def allFields: List[Field] = { def loop(k: Class[_]): List[Field] = if (k == null) Nil else k.getDeclaredFields.toList ::: loop(k.getSuperclass) + loop(clazz) } } + private implicit class `field helper`(val f: Field) extends AnyVal { def follow(o: AnyRef): AnyRef = { f setAccessible true @@ -38,26 +44,40 @@ object AssertUtil { } /** Check that throwable T (or a subclass) was thrown during evaluation of `body`, - * and that its message satisfies the `checkMessage` predicate. - * Any other exception is propagated. + * and that its message satisfies the `checkMessage` predicate. + * Any other exception is propagated. */ - def assertThrows[T <: Throwable: ClassTag](body: => Any, - checkMessage: String => Boolean = s => true): Unit = { + def assertThrows[T <: Throwable : ClassTag](body: => Any, + checkMessage: String => Boolean = _ => true): Unit = { + assertThrown[T](t => checkMessage(t.getMessage))(body) + } + + private val Unthrown = new ControlThrowable {} + + def assertThrown[T <: Throwable : ClassTag](checker: T => Boolean)(body: => Any): Unit = try { body - fail("Expression did not throw!") + throw Unthrown } catch { - case e: T if checkMessage(e.getMessage) => + case Unthrown => fail("Expression did not throw!") + case e: T if checker(e) => () + case failed: T => + val ae = new AssertionError(s"Exception failed check: $failed") + ae.addSuppressed(failed) + throw ae + case NonFatal(other) => + val ae = new AssertionError(s"Wrong exception: expected ${implicitly[ClassTag[T]]} but was ${other.getClass.getName}") + ae.addSuppressed(other) + throw ae } - } /** JUnit-style assertion for `IterableLike.sameElements`. */ def assertSameElements[A, B >: A](expected: IterableLike[A, _], actual: GenIterable[B], message: String = ""): Unit = - if (!(expected sameElements actual)) + if (!expected.sameElements(actual)) fail( - f"${ if (message.nonEmpty) s"$message " else "" }expected:<${ stringOf(expected) }> but was:<${ stringOf(actual) }>" - ) + f"${if (message.nonEmpty) s"$message " else ""}expected:<${stringOf(expected)}> but was:<${stringOf(actual)}>" + ) /** Convenient for testing iterators. */ @@ -68,24 +88,32 @@ object AssertUtil { */ def assertNotReachable[A <: AnyRef](a: => A, roots: AnyRef*)(body: => Unit): Unit = { val wkref = new WeakReference(a) - def refs(root: AnyRef): mutable.Set[AnyRef] = { + + // fail if following strong references from root discovers referent. Quit if ref is empty. + def assertNoRef(root: AnyRef): Unit = { val seen = new IdentityHashMap[AnyRef, Unit] + def loop(o: AnyRef): Unit = if (wkref.nonEmpty && o != null && !seen.containsKey(o)) { seen.put(o, ()) - for { - f <- o.getClass.allFields - if !Modifier.isStatic(f.getModifiers) - if !f.getType.isPrimitive - if !classOf[Reference[_]].isAssignableFrom(f.getType) - } loop(f follow o) + assertTrue(s"Root $root held reference $o", o ne wkref.get) + o match { + case a: Array[AnyRef] => + a.foreach(e => if (!e.isInstanceOf[Reference[_]]) loop(e)) + case _ => + for { + f <- o.getClass.allFields + if !Modifier.isStatic(f.getModifiers) + if !f.getType.isPrimitive + if !classOf[Reference[_]].isAssignableFrom(f.getType) + } loop(f.follow(o)) + } } + loop(root) - seen.keySet.asScala } + body - for (r <- roots if wkref.nonEmpty) { - assertFalse(s"Root $r held reference", refs(r) contains wkref.get) - } + roots.foreach(assertNoRef) } } diff --git a/test/junit/scala/tools/testing/AssertUtilTest.scala b/test/junit/scala/tools/testing/AssertUtilTest.scala index 24e28600d126..4f72e8c83803 100644 --- a/test/junit/scala/tools/testing/AssertUtilTest.scala +++ b/test/junit/scala/tools/testing/AssertUtilTest.scala @@ -1,15 +1,25 @@ package scala.tools package testing +import java.lang.ref._ + import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 -import AssertUtil._ -import java.lang.ref._ +import scala.tools.testing.AssertUtil._ @RunWith(classOf[JUnit4]) class AssertUtilTest { + @Test def assertThrowsAssertion(): Unit = { + assertThrows[AssertionError](throw new AssertionError("meme"), _ == "meme") + try { + assertThrows[AssertionError](()) + assert(false, "should have thrown!") + } catch { + case e: AssertionError if e.getMessage == "Expression did not throw!" => + } + } @Test def reachableIgnoresReferences(): Unit = { class Holder[A](val ref: SoftReference[A]) @@ -17,4 +27,14 @@ class AssertUtilTest { val r = new SoftReference(o) assertNotReachable(o, new Holder(r)) { } } + + @Test def reachableFollowArrays(): Unit = { + class Holder[A](val ref: SoftReference[A]) + val o = new Object + val r = new SoftReference(o) + assertNotReachable(o, Array(new Holder(r))) { } + assertNotReachable(o, Array(Array(r))) { } + assertThrows[AssertionError](assertNotReachable(o, Array(Array(o))) { }) + assertThrows[AssertionError](assertNotReachable(o, new Object { val f = Array(o) }) { }) + } } From 71114c87df7d3ea17d88b368dbcccd2a154cbec5 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Tue, 14 Jul 2020 11:32:08 +1000 Subject: [PATCH 09/46] Bump to Scala 2.12.12 --- build.sbt | 2 +- versions.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 44d3252991af..e6e4e0800432 100644 --- a/build.sbt +++ b/build.sbt @@ -91,7 +91,7 @@ lazy val publishSettings : Seq[Setting[_]] = Seq( // should not be set directly. It is the same as the Maven version and derived automatically from `baseVersion` and // `baseVersionSuffix`. globalVersionSettings -baseVersion in Global := "2.12.12" +baseVersion in Global := "2.12.13" baseVersionSuffix in Global := "SNAPSHOT" organization in ThisBuild := "org.scala-lang" homepage in ThisBuild := Some(url("https://www.scala-lang.org")) diff --git a/versions.properties b/versions.properties index c206b0f4169b..df5517f29279 100644 --- a/versions.properties +++ b/versions.properties @@ -1,5 +1,5 @@ # Scala version used for bootstrapping (see README.md) -starr.version=2.12.11 +starr.version=2.12.12 # The scala.binary.version determines how modules are resolved. It is set as follows: # - After 2.x.0 is released, the binary version is 2.x From 604fc090892e9bc077600a408d63efffe5c8afba Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Thu, 30 Jan 2020 10:58:22 +1000 Subject: [PATCH 10/46] Stabilize order of synthetic modules in enclosing class decls (cherry picked from commit 6acc8ff58d81ac88d6db4e99cd498b75ae0443e5) --- .../scala/tools/nsc/typechecker/Namers.scala | 9 ++++++- .../scala/reflect/internal/Scopes.scala | 21 ++++++++++++++- .../scala/tools/nsc/DeterminismTest.scala | 27 +++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index 50895fa76b30..a4f5867d0402 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -258,7 +258,14 @@ trait Namers extends MethodSynthesis { // line it comments unlinks one of them. What does it intend? } } - scope enter sym + if (sym.isModule && sym.isSynthetic && sym.owner.isClass && !sym.isTopLevel) { + val entry = scope.lookupEntry(sym.name.toTypeName) + if (entry eq null) + scope enter sym + else + scope.enterBefore(sym, entry) + } else + scope enter sym } /** Logic to handle name conflicts of synthetically generated symbols diff --git a/src/reflect/scala/reflect/internal/Scopes.scala b/src/reflect/scala/reflect/internal/Scopes.scala index d3bd58e0ee8f..8c2b206e92cb 100644 --- a/src/reflect/scala/reflect/internal/Scopes.scala +++ b/src/reflect/scala/reflect/internal/Scopes.scala @@ -35,7 +35,7 @@ trait Scopes extends api.Scopes { self: SymbolTable => case class LookupInaccessible(symbol: Symbol, msg: String) extends NameLookup case object LookupNotFound extends NameLookup { def symbol = NoSymbol } - class ScopeEntry(val sym: Symbol, val owner: Scope) { + class ScopeEntry(var sym: Symbol, val owner: Scope) { /** the next entry in the hash bucket */ var tail: ScopeEntry = null @@ -144,6 +144,25 @@ trait Scopes extends api.Scopes { self: SymbolTable => sym } + final def enterBefore(sym: Symbol, next: ScopeEntry): Symbol = { + assert(this != EmptyScope) + require(sym.name.hashCode() == next.sym.name.hashCode(), (sym, next.sym)) + require(sym != next.sym, (sym, next.sym)) + + val newNext = new ScopeEntry(next.sym, this) + val hasHashTable = hashtable ne null + + newNext.next = next.next + if (hasHashTable) newNext.tail = next.tail + next.sym = sym + next.next = newNext + if (hasHashTable) next.tail = newNext + flushElemsCache() + assert(lookupSymbolEntry(sym) != null) + assert(lookupSymbolEntry(newNext.sym) != null) + sym + } + /** enter a symbol, asserting that no symbol with same name exists in scope */ def enterUnique(sym: Symbol) { diff --git a/test/junit/scala/tools/nsc/DeterminismTest.scala b/test/junit/scala/tools/nsc/DeterminismTest.scala index 628c6c562f39..2fda91ccfbeb 100644 --- a/test/junit/scala/tools/nsc/DeterminismTest.scala +++ b/test/junit/scala/tools/nsc/DeterminismTest.scala @@ -273,6 +273,33 @@ class DeterminismTest { test(List(code)) } + @Test def testSyntheticModuleLocationInDecls(): Unit = { + def code = List[SourceFile]( + source("a.scala", + """ + | object A { + | class C(val a: Any) extends AnyVal + | implicit class I1(a: String) + | implicit class IV(val a: String) extends AnyVal + | case class CC() + | } + | + """.stripMargin), + source("b.scala", + """ + | object B { + | // Order here reversed from definition order in A + | A.CC() + | A.IV("") + | A.I1("") + | new A.C("") + | } + | + """.stripMargin) + ) + test(List(code)) + } + def source(name: String, code: String): SourceFile = new BatchSourceFile(name, code) private def test(groups: List[List[SourceFile]]): Unit = { val referenceOutput = Files.createTempDirectory("reference") From 598bac4e441c79021e917811a21e1dcaf20e4ebd Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 8 Apr 2020 16:44:00 +1000 Subject: [PATCH 11/46] Remove exploratory assertions Too slow to leave around. (cherry picked from commit 9b2638136d846350f73ff6f6820c91cdfe891575) --- src/reflect/scala/reflect/internal/Scopes.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/reflect/scala/reflect/internal/Scopes.scala b/src/reflect/scala/reflect/internal/Scopes.scala index 8c2b206e92cb..cd8e6b49bbca 100644 --- a/src/reflect/scala/reflect/internal/Scopes.scala +++ b/src/reflect/scala/reflect/internal/Scopes.scala @@ -145,7 +145,7 @@ trait Scopes extends api.Scopes { self: SymbolTable => } final def enterBefore(sym: Symbol, next: ScopeEntry): Symbol = { - assert(this != EmptyScope) + assert(this != EmptyScope, sym) require(sym.name.hashCode() == next.sym.name.hashCode(), (sym, next.sym)) require(sym != next.sym, (sym, next.sym)) @@ -158,8 +158,6 @@ trait Scopes extends api.Scopes { self: SymbolTable => next.next = newNext if (hasHashTable) next.tail = newNext flushElemsCache() - assert(lookupSymbolEntry(sym) != null) - assert(lookupSymbolEntry(newNext.sym) != null) sym } From 0160f27ef6aab8201ac46f6c5b6d237dbbe53bc2 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Fri, 10 Jul 2020 13:57:45 -0700 Subject: [PATCH 12/46] [backport] Avoid race in test for firstCompletedOf Previous version ought to have awaited the first completed of, but using the parasitic context should suffice; we check that with an assertion. --- test/junit/scala/concurrent/FutureTest.scala | 27 +++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/test/junit/scala/concurrent/FutureTest.scala b/test/junit/scala/concurrent/FutureTest.scala index 9e5adcd2f29a..2ecec9f7b2b0 100644 --- a/test/junit/scala/concurrent/FutureTest.scala +++ b/test/junit/scala/concurrent/FutureTest.scala @@ -1,6 +1,7 @@ package scala.concurrent +import org.junit.Assert.assertTrue import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.JUnit4 @@ -12,14 +13,28 @@ import scala.util.Try @RunWith(classOf[JUnit4]) class FutureTest { @Test - def `bug/issues#10513 firstCompletedOf must not leak references`: Unit = { - import ExecutionContext.Implicits._ - val unfulfilled = Promise[AnyRef] - val quick = Promise[AnyRef] - val result = new AnyRef - val first = Future.firstCompletedOf(List(quick.future, unfulfilled.future)) + def `bug/issues#10513 firstCompletedOf must not leak references`(): Unit = { + val unfulfilled = Promise[AnyRef]() + val quick = Promise[AnyRef]() + val result = new AnyRef + // all callbacks will be registered + val first = Future.firstCompletedOf(List(quick.future, unfulfilled.future))(Future.InternalCallbackExecutor) + // callbacks run parasitically to avoid race or waiting for first future; + // normally we have no guarantee that firstCompletedOf completed, so we assert that this assumption held assertNotReachable(result, unfulfilled) { quick.complete(Try(result)) + assertTrue("First must complete", first.isCompleted) } + /* The test has this structure under the hood: + val p = Promise[String] + val q = Promise[String] + val res = Promise[String] + val s = "hi" + p.future.onComplete(t => res.complete(t)) + q.future.onComplete(t => res.complete(t)) // previously, uncompleted promise held reference to promise completed with value + assertNotReachable(s, q) { + p.complete(Try(s)) + } + */ } } From eee6c24f47d05da0b4533126b5b00d5ec5f760bd Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Fri, 10 Jul 2020 18:52:11 -0700 Subject: [PATCH 13/46] [backport] Exchange stack for Stack in assertNotReachable --- .../scala/tools/testing/AssertUtil.scala | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/test/junit/scala/tools/testing/AssertUtil.scala b/test/junit/scala/tools/testing/AssertUtil.scala index 069c9695c004..e59b70523d53 100644 --- a/test/junit/scala/tools/testing/AssertUtil.scala +++ b/test/junit/scala/tools/testing/AssertUtil.scala @@ -2,12 +2,12 @@ package scala.tools package testing import java.lang.ref._ -import java.lang.reflect.{Array => _, _} +import java.lang.reflect.{Field, Modifier} import java.util.IdentityHashMap -import org.junit.Assert.assertTrue +import org.junit.Assert._ -import scala.collection.{GenIterable, IterableLike} +import scala.collection.{GenIterable, IterableLike, mutable} import scala.reflect.ClassTag import scala.runtime.ScalaRunTime.stringOf import scala.util.control.{ControlThrowable, NonFatal} @@ -88,31 +88,29 @@ object AssertUtil { */ def assertNotReachable[A <: AnyRef](a: => A, roots: AnyRef*)(body: => Unit): Unit = { val wkref = new WeakReference(a) - // fail if following strong references from root discovers referent. Quit if ref is empty. def assertNoRef(root: AnyRef): Unit = { - val seen = new IdentityHashMap[AnyRef, Unit] - - def loop(o: AnyRef): Unit = - if (wkref.nonEmpty && o != null && !seen.containsKey(o)) { + val seen = new IdentityHashMap[AnyRef, Unit] + val stack = new mutable.Stack[AnyRef]() + def loop(): Unit = if (wkref.nonEmpty && stack.nonEmpty) { + val o: AnyRef = stack.pop() + if (o != null && !seen.containsKey(o)) { seen.put(o, ()) - assertTrue(s"Root $root held reference $o", o ne wkref.get) + assertFalse(s"Root $root held reference $o", o eq wkref.get) o match { case a: Array[AnyRef] => - a.foreach(e => if (!e.isInstanceOf[Reference[_]]) loop(e)) - case _ => - for { - f <- o.getClass.allFields - if !Modifier.isStatic(f.getModifiers) - if !f.getType.isPrimitive - if !classOf[Reference[_]].isAssignableFrom(f.getType) - } loop(f.follow(o)) + a.foreach(e => if (!e.isInstanceOf[Reference[_]]) stack.push(e)) + case _ => + for (f <- o.getClass.allFields) + if (!Modifier.isStatic(f.getModifiers) && !f.getType.isPrimitive && !classOf[Reference[_]].isAssignableFrom(f.getType)) + stack.push(f.follow(o)) } } - - loop(root) + loop() + } + stack.push(root) + loop() } - body roots.foreach(assertNoRef) } From e5175d1e70ad87e1a339f42031a1cf8b72f1e92f Mon Sep 17 00:00:00 2001 From: Ivano Pagano Date: Thu, 16 Jul 2020 10:27:34 +0200 Subject: [PATCH 14/46] Add same changes from the PR #7178 * copy the bugfix for scala/bug#10035 to the 2.12.x branch, as-is --- .../scala/tools/nsc/transform/ExplicitOuter.scala | 6 +++++- test/files/pos/t10035.scala | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 test/files/pos/t10035.scala diff --git a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala index 0114897f56ec..e8928a0a8e55 100644 --- a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala +++ b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala @@ -272,7 +272,11 @@ abstract class ExplicitOuter extends InfoTransform protected def outerPath(base: Tree, from: Symbol, to: Symbol): Tree = { //Console.println("outerPath from "+from+" to "+to+" at "+base+":"+base.tpe) if (from == to) base - else outerPath(outerSelect(base), from.outerClass, to) + else { + val outerSel = outerSelect(base) + if (outerSel.isEmpty) EmptyTree + else outerPath(outerSel, from.outerClass, to) + } } override def transform(tree: Tree): Tree = { diff --git a/test/files/pos/t10035.scala b/test/files/pos/t10035.scala new file mode 100644 index 000000000000..00ad9797e6f2 --- /dev/null +++ b/test/files/pos/t10035.scala @@ -0,0 +1,11 @@ +trait Inner { + def f(): Outer +} + +class Outer(o: Set[Inner]) { + def this() = this(Set(1).map{ + case k => new Inner{ + def f(): Outer = Outer.this + } + }) +} From 7ec7251eedb13fb07e928410b0714c61e8a6b558 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Thu, 28 May 2020 16:41:25 +0100 Subject: [PATCH 15/46] Emit method reference lambdas without helper method Under -Ydelambdafy:method-ref, when a lambda is just invoking a method (i.e. is "just a method reference"), such as `foo()` or `x => bar(x)`, then rather than emit an `invokedynamic` to a helper method that invokes the target method, emit an `invokedynamic` to the target method directly. --- .../nsc/backend/jvm/BCodeBodyBuilder.scala | 19 ++- .../nsc/backend/jvm/BCodeSkelBuilder.scala | 1 + .../tools/nsc/settings/ScalaSettings.scala | 2 +- .../tools/nsc/transform/Delambdafy.scala | 28 +++- .../tools/nsc/transform/LambdaLift.scala | 2 +- .../reflect/internal/StdAttachments.scala | 2 + .../reflect/runtime/JavaUniverseForce.scala | 1 + test/files/run/indy-meth-refs-b.flags | 1 + test/files/run/indy-meth-refs-b.scala | 7 + test/files/run/indy-meth-refs-c.flags | 1 + test/files/run/indy-meth-refs-c.scala | 11 ++ test/files/run/indy-meth-refs-d.flags | 1 + test/files/run/indy-meth-refs-d.scala | 5 + test/files/run/indy-meth-refs-e.flags | 1 + test/files/run/indy-meth-refs-e.scala | 5 + test/files/run/indy-meth-refs-f.flags | 1 + test/files/run/indy-meth-refs-f.scala | 121 ++++++++++++++++++ test/files/run/indy-meth-refs-g.flags | 1 + test/files/run/indy-meth-refs-g.scala | 15 +++ test/files/run/indy-meth-refs-h.flags | 1 + test/files/run/indy-meth-refs-h.scala | 12 ++ test/files/run/indy-meth-refs-i.flags | 1 + test/files/run/indy-meth-refs-i.scala | 16 +++ test/files/run/indy-meth-refs.flags | 1 + test/files/run/indy-meth-refs.scala | 9 ++ .../run/lambda-serialization-meth-ref.flags | 1 + .../run/lambda-serialization-meth-ref.scala | 36 ++++++ test/files/run/lambda-serialization.scala | 14 +- .../backend/jvm/IndyLambdaDirectTest.scala | 23 ++++ .../nsc/backend/jvm/opt/InlinerTest.scala | 21 ++- 30 files changed, 344 insertions(+), 16 deletions(-) create mode 100644 test/files/run/indy-meth-refs-b.flags create mode 100644 test/files/run/indy-meth-refs-b.scala create mode 100644 test/files/run/indy-meth-refs-c.flags create mode 100644 test/files/run/indy-meth-refs-c.scala create mode 100644 test/files/run/indy-meth-refs-d.flags create mode 100644 test/files/run/indy-meth-refs-d.scala create mode 100644 test/files/run/indy-meth-refs-e.flags create mode 100644 test/files/run/indy-meth-refs-e.scala create mode 100644 test/files/run/indy-meth-refs-f.flags create mode 100644 test/files/run/indy-meth-refs-f.scala create mode 100644 test/files/run/indy-meth-refs-g.flags create mode 100644 test/files/run/indy-meth-refs-g.scala create mode 100644 test/files/run/indy-meth-refs-h.flags create mode 100644 test/files/run/indy-meth-refs-h.scala create mode 100644 test/files/run/indy-meth-refs-i.flags create mode 100644 test/files/run/indy-meth-refs-i.scala create mode 100644 test/files/run/indy-meth-refs.flags create mode 100644 test/files/run/indy-meth-refs.scala create mode 100644 test/files/run/lambda-serialization-meth-ref.flags create mode 100644 test/files/run/lambda-serialization-meth-ref.scala create mode 100644 test/junit/scala/tools/nsc/backend/jvm/IndyLambdaDirectTest.scala diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala index f9a2ed24b8f2..1653e14860a1 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala @@ -15,7 +15,6 @@ package backend.jvm import scala.annotation.switch import scala.collection.mutable.ListBuffer -import scala.reflect.internal.Flags import scala.tools.asm import scala.tools.asm.Opcodes import scala.tools.asm.tree.{MethodInsnNode, MethodNode} @@ -1361,21 +1360,27 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { def genLoadTry(tree: Try): BType def genInvokeDynamicLambda(canLMF: delambdafy.LambdaMetaFactoryCapable) = { - import canLMF._ + import canLMF.{ lambdaTarget => originalTarget, _ } - val isStaticMethod = lambdaTarget.hasFlag(Flags.STATIC) + val lambdaTarget = originalTarget.attachments.get[JustMethodReference].map(_.lambdaTarget).getOrElse(originalTarget) def asmType(sym: Symbol) = classBTypeFromSymbol(sym).toASMType val isInterface = lambdaTarget.owner.isTrait + val tag = + if (lambdaTarget.isStaticMember) Opcodes.H_INVOKESTATIC + else if (lambdaTarget.isPrivate) Opcodes.H_INVOKESPECIAL + //else if (lambdaTarget.isClassConstructor) Opcodes.H_NEWINVOKESPECIAL // to invoke Foo::new directly + else if (isInterface) Opcodes.H_INVOKEINTERFACE + else Opcodes.H_INVOKEVIRTUAL val implMethodHandle = - new asm.Handle(if (lambdaTarget.hasFlag(Flags.STATIC)) asm.Opcodes.H_INVOKESTATIC else if (isInterface) asm.Opcodes.H_INVOKEINTERFACE else asm.Opcodes.H_INVOKEVIRTUAL, + new asm.Handle( + tag, classBTypeFromSymbol(lambdaTarget.owner).internalName, lambdaTarget.name.toString, methodBTypeFromSymbol(lambdaTarget).descriptor, /* itf = */ isInterface) - val receiver = if (isStaticMethod) Nil else lambdaTarget.owner :: Nil - val (capturedParams, lambdaParams) = lambdaTarget.paramss.head.splitAt(lambdaTarget.paramss.head.length - arity) - val invokedType = asm.Type.getMethodDescriptor(asmType(functionalInterface), (receiver ::: capturedParams).map(sym => typeToBType(sym.info).toASMType): _*) + val (capturedParams, lambdaParams) = originalTarget.paramss.head.splitAt(originalTarget.paramss.head.length - arity) + val invokedType = asm.Type.getMethodDescriptor(asmType(functionalInterface), capturedParams.map(sym => typeToBType(sym.info).toASMType): _*) val constrainedType = MethodBType(lambdaParams.map(p => typeToBType(p.tpe)), typeToBType(lambdaTarget.tpe.resultType)).toASMType val samMethodType = methodBTypeFromSymbol(sam).toASMType val markers = if (addScalaSerializableMarker) classBTypeFromSymbol(definitions.SerializableClass).toASMType :: Nil else Nil diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala index 029ed325417f..a4eeb800505e 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeSkelBuilder.scala @@ -553,6 +553,7 @@ abstract class BCodeSkelBuilder extends BCodeHelpers { def genDefDef(dd: DefDef) { // the only method whose implementation is not emitted: getClass() if (definitions.isGetClass(dd.symbol)) { return } + if (dd.symbol.hasAttachment[JustMethodReference]) { return } assert(mnode == null, "GenBCode detected nested method.") methSymbol = dd.symbol diff --git a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala index b23be84b803e..5ad14948c0a8 100644 --- a/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala +++ b/src/compiler/scala/tools/nsc/settings/ScalaSettings.scala @@ -250,7 +250,7 @@ trait ScalaSettings extends AbsScalaSettings val Youtline = BooleanSetting ("-Youtline", "Don't compile method bodies. Use together with `-Ystop-afer:pickler to generate the pickled signatures for all source files.").internalOnly() val exposeEmptyPackage = BooleanSetting ("-Yexpose-empty-package", "Internal only: expose the empty package.").internalOnly() - val Ydelambdafy = ChoiceSetting ("-Ydelambdafy", "strategy", "Strategy used for translating lambdas into JVM code.", List("inline", "method"), "method") + val Ydelambdafy = ChoiceSetting ("-Ydelambdafy", "strategy", "Strategy used for translating lambdas into JVM code.", List("inline", "method", "method-ref"), "method") val YmacroClasspath = PathSetting ("-Ymacro-classpath", "The classpath used to reflectively load macro implementations, default is the compilation classpath.", "") // Allows a specialised jar to be written. For instance one that provides stable hashing of content, or customisation of the file storage diff --git a/src/compiler/scala/tools/nsc/transform/Delambdafy.scala b/src/compiler/scala/tools/nsc/transform/Delambdafy.scala index 0bdec33cb6b3..0711718facc9 100644 --- a/src/compiler/scala/tools/nsc/transform/Delambdafy.scala +++ b/src/compiler/scala/tools/nsc/transform/Delambdafy.scala @@ -54,7 +54,7 @@ abstract class Delambdafy extends Transform with TypingTransformers with ast.Tre } override def newPhase(prev: scala.tools.nsc.Phase): StdPhase = { - if (settings.Ydelambdafy.value == "method") new Phase(prev) + if (settings.Ydelambdafy.value != "inline") new Phase(prev) else new SkipPhase(prev) } @@ -131,6 +131,12 @@ abstract class Delambdafy extends Transform with TypingTransformers with ast.Tre // samMethodType is derived from samOf(functionalInterface)'s signature apply.updateAttachment(LambdaMetaFactoryCapable(lambdaTarget, fun.vparams.length, functionalInterface, sam, samBridges, isSerializable, addScalaSerializableMarker)) + if (lambdaTarget != target) { + // A boxing bridge is needed, so the lambda isn't just a method reference :( + // Drop the annotation added in "pretransform" so that the backend doesn't drop it! + target.removeAttachment[JustMethodReference] + } + apply } @@ -294,12 +300,30 @@ abstract class Delambdafy extends Transform with TypingTransformers with ast.Tre case Template(_, _, _) => def pretransform(tree: Tree): Tree = tree match { case dd: DefDef if dd.symbol.isDelambdafyTarget => - if (!dd.symbol.hasFlag(STATIC) && methodReferencesThis(dd.symbol)) { + val ddef = if (!dd.symbol.hasFlag(STATIC) && methodReferencesThis(dd.symbol)) { gen.mkStatic(dd, dd.symbol.name, sym => sym) } else { dd.symbol.setFlag(STATIC) dd } + if (settings.Ydelambdafy.value == "method-ref") { + // e.g. `def $anonfun$f$1(x$1: Foo): Unit = x$1.bar()` + // x$1.bar() is the Select, with x$1 as both the arg and the select.qualifier + def justMethRef(arg: ValDef, sel: Select) = ( + sel.symbol.isMethod // must be a method + && sel.qualifier.symbol == arg.symbol // the method must be on the first arg + && !sel.symbol.owner.isPrimitiveValueClass // can't involve primitives (boxing/specialisation) + && sel.symbol.owner != ArrayClass // ... or arrays + ) + ddef match { + case DefDef(_, _, _, List(arg :: Nil), _, Apply(sel @ Select(_: Ident, _), Nil)) if justMethRef(arg, sel) => + // Store the lambdaTarget while we still have access to the def's body (tree) + // (and now that we're post erasure, so we don't store a reference to un-erased Any) + ddef.symbol.updateAttachment(JustMethodReference(sel.symbol)) + case _ => + } + } + ddef case t => t } try { diff --git a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala index 6420b40d08bf..bd03f917ede0 100644 --- a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala +++ b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala @@ -586,7 +586,7 @@ abstract class LambdaLift extends InfoTransform { private def addFree[A](sym: Symbol, free: List[A], original: List[A]): List[A] = { val prependFree = ( !sym.isConstructor // this condition is redundant for now. It will be needed if we remove the second condition in 2.12.x - && (settings.Ydelambdafy.value == "method" && sym.isDelambdafyTarget) // scala/bug#8359 Makes the lambda body a viable as the target MethodHandle for a call to LambdaMetafactory + && (settings.Ydelambdafy.value != "inline" && sym.isDelambdafyTarget) // scala/bug#8359 Makes the lambda body a viable as the target MethodHandle for a call to LambdaMetafactory ) if (prependFree) free ::: original else original ::: free diff --git a/src/reflect/scala/reflect/internal/StdAttachments.scala b/src/reflect/scala/reflect/internal/StdAttachments.scala index 8384b12e96d8..cc00ea275344 100644 --- a/src/reflect/scala/reflect/internal/StdAttachments.scala +++ b/src/reflect/scala/reflect/internal/StdAttachments.scala @@ -71,6 +71,8 @@ trait StdAttachments { case object DelambdafyTarget extends PlainAttachment + case class JustMethodReference(lambdaTarget: Symbol) extends PlainAttachment + /** When present, indicates that the host `Ident` has been created from a backquoted identifier. */ case object BackquotedIdentifierAttachment extends PlainAttachment diff --git a/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala b/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala index 3d7821b253f2..9b94de41e26f 100644 --- a/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala +++ b/src/reflect/scala/reflect/runtime/JavaUniverseForce.scala @@ -51,6 +51,7 @@ trait JavaUniverseForce { self: runtime.JavaUniverse => this.CompoundTypeTreeOriginalAttachment this.SAMFunction this.DelambdafyTarget + this.JustMethodReference this.BackquotedIdentifierAttachment this.NoWarnAttachment this.PatVarDefAttachment diff --git a/test/files/run/indy-meth-refs-b.flags b/test/files/run/indy-meth-refs-b.flags new file mode 100644 index 000000000000..4b6111ee1708 --- /dev/null +++ b/test/files/run/indy-meth-refs-b.flags @@ -0,0 +1 @@ +-Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-b.scala b/test/files/run/indy-meth-refs-b.scala new file mode 100644 index 000000000000..93036e907b63 --- /dev/null +++ b/test/files/run/indy-meth-refs-b.scala @@ -0,0 +1,7 @@ +object Test { + def min0[A](less: (A, A) => Boolean, xs: List[A]): Option[A] = None + + def min(xs: List[Int]) = min0((x: Int, y: Int) => x < y, xs) + + def main(args: Array[String]): Unit = min(List()) +} diff --git a/test/files/run/indy-meth-refs-c.flags b/test/files/run/indy-meth-refs-c.flags new file mode 100644 index 000000000000..4b6111ee1708 --- /dev/null +++ b/test/files/run/indy-meth-refs-c.flags @@ -0,0 +1 @@ +-Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-c.scala b/test/files/run/indy-meth-refs-c.scala new file mode 100644 index 000000000000..d2077b7c2eaf --- /dev/null +++ b/test/files/run/indy-meth-refs-c.scala @@ -0,0 +1,11 @@ +object Test { + def main(args: Array[String]): Unit = { + val str = "" + val foo = new Foo() + use(foo.bar(str)) + } + + class Foo { def bar(x: Object) = Symbol("ok") } + + def use(x: => Any) = () +} diff --git a/test/files/run/indy-meth-refs-d.flags b/test/files/run/indy-meth-refs-d.flags new file mode 100644 index 000000000000..4b6111ee1708 --- /dev/null +++ b/test/files/run/indy-meth-refs-d.flags @@ -0,0 +1 @@ +-Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-d.scala b/test/files/run/indy-meth-refs-d.scala new file mode 100644 index 000000000000..81d7bd779abb --- /dev/null +++ b/test/files/run/indy-meth-refs-d.scala @@ -0,0 +1,5 @@ +object Test { + class Foo { def bar() = () } + def main(args: Array[String]): Unit = + Option(new Foo()).foreach(_.bar()) +} diff --git a/test/files/run/indy-meth-refs-e.flags b/test/files/run/indy-meth-refs-e.flags new file mode 100644 index 000000000000..4b6111ee1708 --- /dev/null +++ b/test/files/run/indy-meth-refs-e.flags @@ -0,0 +1 @@ +-Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-e.scala b/test/files/run/indy-meth-refs-e.scala new file mode 100644 index 000000000000..94bd79b12625 --- /dev/null +++ b/test/files/run/indy-meth-refs-e.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + List(Option("a")).map(_.map(_.toUpperCase)) + } +} diff --git a/test/files/run/indy-meth-refs-f.flags b/test/files/run/indy-meth-refs-f.flags new file mode 100644 index 000000000000..4b6111ee1708 --- /dev/null +++ b/test/files/run/indy-meth-refs-f.flags @@ -0,0 +1 @@ +-Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-f.scala b/test/files/run/indy-meth-refs-f.scala new file mode 100644 index 000000000000..1e69936d4d46 --- /dev/null +++ b/test/files/run/indy-meth-refs-f.scala @@ -0,0 +1,121 @@ +object Test { + def anyA(f: Any => Any) = () + def anyB(f: Any => Boolean) = () + def anyI(f: Any => Int) = () + + def objA(f: Object => Any) = () + def objB(f: Object => Boolean) = () + def objI(f: Object => Int) = () + + def strS(f: String => String) = () + + def arrII(f: Array[Int] => Int) = () + def arrSI(f: Array[String] => Int) = () + def arrSS(f: Array[String] => String) = () + + def boolB(f: Boolean => Boolean) = () + + def intI(f: Int => Int) = () + def intB(f: Int => Boolean) = () + + class StrVC(val x: String) extends AnyVal { + def unwrap = x + def bang = new StrVC(x + "!") + } + class BoolVC(val x: Boolean) extends AnyVal { + def unwrap = x + def not = new BoolVC(!x) + } + class IntVC(val x: Int) extends AnyVal { + def unwrap = x + def inc = new IntVC(x + 1) + def isZero = x == 0 + def isZeroVC = new BoolVC(x == 0) + } + + def mkStrVC(x: String): StrVC = new StrVC(x) + def mkBoolVC(x: Boolean): BoolVC = new BoolVC(x) + def mkIntVC(x: Int): IntVC = new IntVC(x) + + def strVC1(f: StrVC => String) = () + def strVC2(f: StrVC => StrVC) = () + def strVC3(f: String => StrVC) = () + + def boolVC1(f: BoolVC => Boolean) = () + def boolVC2(f: BoolVC => BoolVC) = () + def boolVC3(f: Boolean => BoolVC) = () + + def intVC1(f: IntVC => Int) = () + def intVC2(f: IntVC => IntVC) = () + def intVC3(f: Int => IntVC) = () + def intVC4(f: IntVC => Boolean) = () + + def vcs1(f: IntVC => BoolVC) = () + + def main(args: Array[String]): Unit = { + anyB("" == _) + anyB("" != _) + anyB(_.isInstanceOf[String]) + anyA(_.asInstanceOf[String]) + anyI(_.##) + + objB("" eq _) + objB("" ne _) + objB("" == _) + objB("" != _) + objB(_.isInstanceOf[String]) + objA(_.asInstanceOf[String]) + objA("".synchronized(_)) + + strS("" + _) + + arrII(_.length) + arrII(xs => xs(0)) + arrSI(_.length) + arrSS(xs => xs(0)) + + //boolB(true eq _) // the result type of an implicit conversion must be more specific than AnyRef ¯\_(ツ)_/¯ + //boolB(true ne _) + boolB(!_) + boolB(true || _) + boolB(true && _) + boolB(true | _) + boolB(true & _) + boolB(true ^ _) + + //intB(1 eq _) + //intB(1 ne _) + intI(1 + _) + intI(1 - _) + intI(1 * _) + intI(1 / _) + intI(1 % _) + intB(1 < _) + intB(1 <= _) + intB(1 > _) + intB(1 >= _) + intI(1 ^ _) + intI(1 & _) + intI(1 << _) + intI(1 >>> _) + intI(1 >> _) + intI(_.toInt) + intI(i => -i) + intI(i => ~i) + + strVC1(_.unwrap) + strVC2(_.bang) + strVC3(mkStrVC(_)) + + boolVC1(_.unwrap) + boolVC2(_.not) + boolVC3(mkBoolVC(_)) + + intVC1(_.unwrap) + intVC2(_.inc) + intVC3(mkIntVC(_)) + intVC4(_.isZero) + + vcs1(_.isZeroVC) + } +} diff --git a/test/files/run/indy-meth-refs-g.flags b/test/files/run/indy-meth-refs-g.flags new file mode 100644 index 000000000000..4b6111ee1708 --- /dev/null +++ b/test/files/run/indy-meth-refs-g.flags @@ -0,0 +1 @@ +-Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-g.scala b/test/files/run/indy-meth-refs-g.scala new file mode 100644 index 000000000000..b4b82edde559 --- /dev/null +++ b/test/files/run/indy-meth-refs-g.scala @@ -0,0 +1,15 @@ +import java.io.File + +import scala.collection.mutable + +object Test { + val fqnsToFiles = mutable.HashMap[String, (File, Boolean)]() + + def main(args: Array[String]): Unit = test() + + def test() = { + val fqn = "bob" + val newResult = Option((new File("f"), true)) + newResult.foreach(res => fqnsToFiles.put(fqn, res)) + } +} diff --git a/test/files/run/indy-meth-refs-h.flags b/test/files/run/indy-meth-refs-h.flags new file mode 100644 index 000000000000..4b6111ee1708 --- /dev/null +++ b/test/files/run/indy-meth-refs-h.flags @@ -0,0 +1 @@ +-Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-h.scala b/test/files/run/indy-meth-refs-h.scala new file mode 100644 index 000000000000..0e53d4a6b3b6 --- /dev/null +++ b/test/files/run/indy-meth-refs-h.scala @@ -0,0 +1,12 @@ +trait Entity { + def name: String + def announce = { + def msg = s"I am $name" + None.getOrElse(msg) + } +} + +object Test extends Entity { + def name = "Test" + def main(args: Array[String]): Unit = assert(announce == "I am Test") +} diff --git a/test/files/run/indy-meth-refs-i.flags b/test/files/run/indy-meth-refs-i.flags new file mode 100644 index 000000000000..4b6111ee1708 --- /dev/null +++ b/test/files/run/indy-meth-refs-i.flags @@ -0,0 +1 @@ +-Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-i.scala b/test/files/run/indy-meth-refs-i.scala new file mode 100644 index 000000000000..21bcb22ff596 --- /dev/null +++ b/test/files/run/indy-meth-refs-i.scala @@ -0,0 +1,16 @@ +class C { + def foo = 0 +} + +class D extends C { + override def foo = 1 + def bar = () => super.foo +} + +object Test { + def main(args: Array[String]): Unit = { + val d = new D + val obtained = d.bar.apply() + assert(obtained == 0, obtained) + } +} diff --git a/test/files/run/indy-meth-refs.flags b/test/files/run/indy-meth-refs.flags new file mode 100644 index 000000000000..4b6111ee1708 --- /dev/null +++ b/test/files/run/indy-meth-refs.flags @@ -0,0 +1 @@ +-Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs.scala b/test/files/run/indy-meth-refs.scala new file mode 100644 index 000000000000..0cad83bd8cc0 --- /dev/null +++ b/test/files/run/indy-meth-refs.scala @@ -0,0 +1,9 @@ +case object Test { + def f0(f: Function0[String]) = () + def f1(f: Function1[Any, String]) = () + + def main(args: Array[String]): Unit = { + f0(() => toString()) + f1(_.toString()) + } +} diff --git a/test/files/run/lambda-serialization-meth-ref.flags b/test/files/run/lambda-serialization-meth-ref.flags new file mode 100644 index 000000000000..4b6111ee1708 --- /dev/null +++ b/test/files/run/lambda-serialization-meth-ref.flags @@ -0,0 +1 @@ +-Ydelambdafy:method-ref diff --git a/test/files/run/lambda-serialization-meth-ref.scala b/test/files/run/lambda-serialization-meth-ref.scala new file mode 100644 index 000000000000..a81efd465a7e --- /dev/null +++ b/test/files/run/lambda-serialization-meth-ref.scala @@ -0,0 +1,36 @@ +import java.io.{ByteArrayInputStream, ByteArrayOutputStream} +import java.io.{ObjectInputStream, ObjectOutputStream} + +object Test { + def main(args: Array[String]): Unit = { + roundTripMethRef() + roundTripMethRef_F0() + } + + // lambda targeting a method reference, not a SAM or FunctionN (should behave the same way) + def roundTripMethRef(): Unit = { + val lambda: String => String = (s: String) => s.toUpperCase + val reconstituted1 = serializeDeserialize(lambda).asInstanceOf[String => String] + val reconstituted2 = serializeDeserialize(reconstituted1).asInstanceOf[String => String] + assert(reconstituted1.apply("yo") == "YO") + assert(reconstituted1.getClass == reconstituted2.getClass) + } + + def name = "Test" + + def roundTripMethRef_F0(): Unit = { + val lambda: () => String = () => Test.name + val reconstituted1 = serializeDeserialize(lambda).asInstanceOf[() => String] + val reconstituted2 = serializeDeserialize(reconstituted1).asInstanceOf[() => String] + assert(reconstituted1.apply() == "Test") + assert(reconstituted1.getClass == reconstituted2.getClass) + } + + def serializeDeserialize[T <: AnyRef](obj: T) = { + val buffer = new ByteArrayOutputStream + val out = new ObjectOutputStream(buffer) + out.writeObject(obj) + val in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray)) + in.readObject.asInstanceOf[T] + } +} diff --git a/test/files/run/lambda-serialization.scala b/test/files/run/lambda-serialization.scala index 78b4c5d58b47..1134eb0aa95d 100644 --- a/test/files/run/lambda-serialization.scala +++ b/test/files/run/lambda-serialization.scala @@ -39,8 +39,18 @@ object Test { } def fakeLambdaFailsToDeserialize(): Unit = { - val fake = new SerializedLambda(classOf[C], classOf[FakeSam].getName, "apply", "()V", - MethodHandleInfo.REF_invokeVirtual, classOf[C].getName, "foo", "()V", "()V", Array(new C)) + val fake = new SerializedLambda( + /* capturingClass = */ classOf[C], + /* functionalInterfaceClass = */ classOf[FakeSam].getName, + /* functionalInterfaceMethodName = */ "apply", + /* functionalInterfaceMethodSignature = */ "()V", + /* implMethodKind = */ MethodHandleInfo.REF_invokeVirtual, + /* implClass = */ classOf[C].getName, + /* implMethodName = */ "foo", + /* implMethodSignature = */ "()V", + /* instantiatedMethodType = */ "()V", + /* capturedArgs = */ Array(new C), + ) try { serializeDeserialize(fake).asInstanceOf[FakeSam].apply() assert(false) diff --git a/test/junit/scala/tools/nsc/backend/jvm/IndyLambdaDirectTest.scala b/test/junit/scala/tools/nsc/backend/jvm/IndyLambdaDirectTest.scala new file mode 100644 index 000000000000..fa46c1505760 --- /dev/null +++ b/test/junit/scala/tools/nsc/backend/jvm/IndyLambdaDirectTest.scala @@ -0,0 +1,23 @@ +package scala.tools.nsc.backend.jvm + +import org.junit.Assert._ +import org.junit.Test + +import scala.tools.testing.BytecodeTesting + +class IndyLambdaDirectTest extends BytecodeTesting { + import compiler._ + override def compilerArgs = "-Ydelambdafy:method-ref" + + @Test def f0(): Unit = { + compileToBytes("object F0 { def f0(f: Function0[String]) = () }") + val meths = compileAsmMethods("def f() = F0.f0(() => toString())").map(_.name) + assertTrue(s"Expected no anonfuns: $meths", meths.forall(!_.contains("anonfun"))) + } + + @Test def f1(): Unit = { + compileToBytes("object F1 { def f1(f: Function1[Any, String]) = () }") + val meths = compileAsmMethods("def f() = F1.f1(_.toString())").map(_.name) + assertTrue(s"Expected no anonfuns: $meths", meths.forall(!_.contains("anonfun"))) + } +} diff --git a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala index 4eb55688340d..c9dcb52582af 100644 --- a/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala +++ b/test/junit/scala/tools/nsc/backend/jvm/opt/InlinerTest.scala @@ -932,11 +932,19 @@ class InlinerTest extends BytecodeTesting { val t1 = getMethod(c, "t1") assertNoIndy(t1) // the indy call is inlined into t, and the closure elimination rewrites the closure invocation to the body method - assertInvoke(t1, "C", "$anonfun$m$2") + try assertInvoke(t1, "C", "$anonfun$m$2") + catch { case e: AssertionError => + try assertInvoke(t1, "java/lang/String", "trim") // this is the new behaviour, after restarr'ing + catch { case _: AssertionError => throw e } + } val t2 = getMethod(c, "t2") assertNoIndy(t2) - assertInvoke(t2, "M$", "$anonfun$m$1") + try assertInvoke(t2, "M$", "$anonfun$m$1") + catch { case e: AssertionError => + try assertInvoke(t2, "java/lang/String", "trim") // this is the new behaviour, after restarr'ing + catch { case _: AssertionError => throw e } + } } @Test @@ -1435,10 +1443,17 @@ class InlinerTest extends BytecodeTesting { val c = compileClass(code) // box-unbox will clean it up - assertSameSummary(getMethod(c, "t"), List( + try assertSameSummary(getMethod(c, "t"), List( ALOAD, "$anonfun$t$1", IFEQ /*A*/, "$anonfun$t$2", IRETURN, -1 /*A*/, "$anonfun$t$3", IRETURN)) + catch { case e: AssertionError => + try assertSameSummary(getMethod(c, "t"), List( // this is the new behaviour, after restarr'ing + ALOAD, "debug", IFEQ /*A*/, + "$anonfun$t$2", IRETURN, + -1 /*A*/, "$anonfun$t$3", IRETURN)) + catch { case _: AssertionError => throw e } + } } @Test From 7bba932953f681c070809c73a44a13ab9e7aba17 Mon Sep 17 00:00:00 2001 From: mkeskells Date: Sun, 2 Aug 2020 16:29:01 +0100 Subject: [PATCH 16/46] simplify signature --- src/library/scala/collection/mutable/WrappedArrayBuilder.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/library/scala/collection/mutable/WrappedArrayBuilder.scala b/src/library/scala/collection/mutable/WrappedArrayBuilder.scala index aaa80648a985..3a1c6d9daa2c 100644 --- a/src/library/scala/collection/mutable/WrappedArrayBuilder.scala +++ b/src/library/scala/collection/mutable/WrappedArrayBuilder.scala @@ -129,7 +129,7 @@ private [mutable] object WrappedArrayBuilder { case java.lang.Boolean.TYPE => new WrappedArray.ofBoolean(Array.emptyBooleanArray) case java.lang.Void.TYPE => new WrappedArray.ofUnit(Array.emptyUnitArray) } - else new WrappedArray.ofRef(Array.empty.asInstanceOf[Array[_ <: AnyRef]]) + else new WrappedArray.ofRef(Array.empty[AnyRef]) } } } From ceda795656c17cc59cc2758652e30af86963d5de Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 19 Jun 2019 13:27:18 +1000 Subject: [PATCH 17/46] Improve IntelliJ project configuration Add a few missing exclusions, and edit some existing config that was out of date since the SBT 1.x upgrade. (cherry picked from commit 70918525fdf7d6a4144e950966605f0db32fd3d8) --- src/intellij/benchmarks.iml.SAMPLE | 3 ++- src/intellij/scala-build.iml.SAMPLE | 6 +++--- src/intellij/test.iml.SAMPLE | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/intellij/benchmarks.iml.SAMPLE b/src/intellij/benchmarks.iml.SAMPLE index 60beb65ec0f3..5fe3bdab1cb9 100644 --- a/src/intellij/benchmarks.iml.SAMPLE +++ b/src/intellij/benchmarks.iml.SAMPLE @@ -7,6 +7,7 @@ + @@ -17,4 +18,4 @@ - \ No newline at end of file + diff --git a/src/intellij/scala-build.iml.SAMPLE b/src/intellij/scala-build.iml.SAMPLE index 9bd319bacd53..2cad047e82da 100644 --- a/src/intellij/scala-build.iml.SAMPLE +++ b/src/intellij/scala-build.iml.SAMPLE @@ -4,13 +4,13 @@ - + - - + + diff --git a/src/intellij/test.iml.SAMPLE b/src/intellij/test.iml.SAMPLE index a74dcfa54310..046dfd7b888a 100644 --- a/src/intellij/test.iml.SAMPLE +++ b/src/intellij/test.iml.SAMPLE @@ -16,4 +16,4 @@ - \ No newline at end of file + From 67f9cb27a49202752d949b4c27990a29258df79f Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Wed, 5 Aug 2020 22:26:31 +0100 Subject: [PATCH 18/46] Add restarr/restarrFull custom commands * `restarr`: sets `scalaVersion` to the version in `/buildcharacter.properties` or the given arg. * `restarrFull`: publishes locally (without optimizing) & then sets the new `scalaVersion`. --- project/ScriptCommands.scala | 33 ++++++++++++++++++++++++++++++++- project/VersionUtil.scala | 15 +++++++++------ 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/project/ScriptCommands.scala b/project/ScriptCommands.scala index 080b0073ad34..0b51f3b91c31 100644 --- a/project/ScriptCommands.scala +++ b/project/ScriptCommands.scala @@ -4,8 +4,10 @@ import java.nio.file.Paths import sbt._ import Keys._ +import sbt.complete.Parsers._ import BuildSettings.autoImport._ +import VersionUtil._ /** Custom commands for use by the Jenkins scripts. This keeps the surface area and call syntax small. */ object ScriptCommands { @@ -16,7 +18,8 @@ object ScriptCommands { setupPublishCore, setupValidateTest, setupBootstrapStarr, setupBootstrapLocker, setupBootstrapQuick, setupBootstrapPublish, - enableOptimizerCommand + enableOptimizerCommand, + restarr, restarrFull, ) /** Set up the environment for `validate/publish-core`. @@ -110,6 +113,34 @@ object ScriptCommands { def enableOptimizerCommand = setup("enableOptimizer")(_ => enableOptimizer) + /** For local dev: sets `scalaVersion` to the version in `/buildcharacter.properties` or the given arg. + * Running `reload` will re-read the build files, resetting `scalaVersion`. */ + def restarr = Command("restarr")(_ => (Space ~> StringBasic).?) { (state, s) => + val newVersion = s.getOrElse(readVersionFromPropsFile(state)) + val x = Project.extract(state) + val sv = x.get(Global / scalaVersion) + state.log.info(s"Re-STARR'ing: setting scalaVersion from $sv to $newVersion (`reload` to undo)") + x.appendWithSession(Global / scalaVersion := newVersion, state) // don't use version.value or it'll be a wrong, new value + } + + /** For local dev: publishes locally (without optimizing) & then sets the new `scalaVersion`. + * Also it generates `/buildcharacter.properties` which is the default used by `restarr`. */ + def restarrFull = Command.command("restarrFull") { state => + setupPublishCoreNonOpt.nameOption.get :: + generateBuildCharacterPropertiesFile.key.label :: + publishLocal.key.label :: + restarr.nameOption.get :: + state + } + + private def readVersionFromPropsFile(state: State): String = { + val props = readProps(file("buildcharacter.properties")) + val newVersion = props("maven.version.number") + val fullVersion = props("version.number") + state.log.info(s"Read STARR version from buildcharacter.properties: $newVersion (full version: $fullVersion)") + newVersion + } + private[this] def setup(name: String)(f: Seq[String] => Seq[Setting[_]]) = Command.args(name, name) { case (state, seq) => Project.extract(state).appendWithSession(f(seq), state) } diff --git a/project/VersionUtil.scala b/project/VersionUtil.scala index 592a223f7f6e..85bafd2d51d3 100644 --- a/project/VersionUtil.scala +++ b/project/VersionUtil.scala @@ -183,15 +183,18 @@ object VersionUtil { propFile } - /** The global versions.properties data */ - lazy val versionProps: Map[String, String] = { + private[build] def readProps(f: File): Map[String, String] = { val props = new Properties() - val in = new FileInputStream(file("versions.properties")) + val in = new FileInputStream(f) try props.load(in) finally in.close() - props.asScala.toMap.map { - case (k, v) => (k, sys.props.getOrElse(k, v)) // allow system properties to override versions.properties - } + props.asScala.toMap + } + + /** The global versions.properties data */ + lazy val versionProps: Map[String, String] = { + val versionProps = readProps(file("versions.properties")) + versionProps.map { case (k, v) => (k, sys.props.getOrElse(k, v)) } // allow sys props to override versions.properties } /** Get a subproject version number from `versionProps` */ From 6c806e025acfb43b414aad8e045ef55f0b2b810a Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Sun, 9 Aug 2020 21:11:21 +0100 Subject: [PATCH 19/46] Add version/scalaVersion info to onLoadMessage Very handy if you re-STARR and un-STARR a lot, and/or if you're switching between the 2.12.x and 2.13.x branches, at the cost of extra output on every build load - a good trade, IMO. --- build.sbt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index e6e4e0800432..6c1560e9be04 100644 --- a/build.sbt +++ b/build.sbt @@ -1362,7 +1362,8 @@ lazy val root: Project = (project in file(".")) .aggregate(library, reflect, compiler, compilerOptionsExporter, interactive, repl, replJline, replJlineEmbedded, scaladoc, scalap, partestExtras, junit, libraryAll, scalaDist).settings( sources in Compile := Seq.empty, - onLoadMessage := """|*** Welcome to the sbt build definition for Scala! *** + onLoadMessage := s"""|*** Welcome to the sbt build definition for Scala! *** + |version=${(Global / version).value} scalaVersion=${(Global / scalaVersion).value} |Check README.md for more information.""".stripMargin ) From e5bda188e8114c2231b085ba20f6d79826fbd702 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Tue, 11 Aug 2020 17:29:51 +0100 Subject: [PATCH 20/46] Fix exhaustivity uncheckableType's logic for tuples As tuples (e.g. Tuple2) are case classes, for which `enumerateSubtypes` returns `List(List(tp))` therefore making it "checkable", any tuple type was accidentally always passing (or at least it has since that `isCase` branch was added to `enumerateSubtypes`). This was leading to false positives in the exhaustivity checking, as a tuple of non-sealed types was being deemed inexhaustive with a wildcard `(_, _)` counter-example. --- .../nsc/transform/patmat/MatchAnalysis.scala | 7 ++++--- test/files/pos/t10373.flags | 1 + test/files/pos/t10373.scala | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 test/files/pos/t10373.flags create mode 100644 test/files/pos/t10373.scala diff --git a/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala b/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala index 71432b8ed6f1..c67df2396f62 100644 --- a/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala +++ b/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala @@ -213,9 +213,10 @@ trait TreeAndTypeAnalysis extends Debugging { // a type is "uncheckable" (for exhaustivity) if we don't statically know its subtypes (i.e., it's unsealed) // we consider tuple types with at least one component of a checkable type as a checkable type def uncheckableType(tp: Type): Boolean = { - val checkable = ( - (isTupleType(tp) && tupleComponents(tp).exists(tp => !uncheckableType(tp))) - || enumerateSubtypes(tp, grouped = false).nonEmpty) + val checkable = { + if (isTupleType(tp)) tupleComponents(tp).exists(tp => !uncheckableType(tp)) + else enumerateSubtypes(tp, grouped = false).nonEmpty + } // if (!checkable) debug.patmat("deemed uncheckable: "+ tp) !checkable } diff --git a/test/files/pos/t10373.flags b/test/files/pos/t10373.flags new file mode 100644 index 000000000000..85d8eb2ba295 --- /dev/null +++ b/test/files/pos/t10373.flags @@ -0,0 +1 @@ +-Xfatal-warnings diff --git a/test/files/pos/t10373.scala b/test/files/pos/t10373.scala new file mode 100644 index 000000000000..c588607d3d41 --- /dev/null +++ b/test/files/pos/t10373.scala @@ -0,0 +1,15 @@ +abstract class Foo { + def bar(): Unit = this match { + case Foo_1() => //do something + case Foo_2() => //do something + // Works fine + } + + def baz(that: Foo): Unit = (this, that) match { + case (Foo_1(), _) => //do something + case (Foo_2(), _) => //do something + // match may not be exhaustive + } +} +case class Foo_1() extends Foo +case class Foo_2() extends Foo From 1b02a84e2e066453694e3e13b74c235d5ead2ad5 Mon Sep 17 00:00:00 2001 From: mkeskells Date: Wed, 12 Aug 2020 08:50:01 +0100 Subject: [PATCH 21/46] remove unused import --- src/library/scala/collection/immutable/Map.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/src/library/scala/collection/immutable/Map.scala b/src/library/scala/collection/immutable/Map.scala index b45d7eb05d8d..c89c77675bcf 100644 --- a/src/library/scala/collection/immutable/Map.scala +++ b/src/library/scala/collection/immutable/Map.scala @@ -15,7 +15,6 @@ package collection package immutable import generic._ -import scala.collection.immutable.Map.MapBuilderImpl import scala.util.hashing.MurmurHash3 /** From 9416cb9066817628a51030965c38f4bcec758feb Mon Sep 17 00:00:00 2001 From: mkeskells Date: Thu, 13 Aug 2020 09:16:27 +0100 Subject: [PATCH 22/46] remove unneeded conversion --- .../scala/tools/nsc/transform/Erasure.scala | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index 36ac2ab55330..d3cdab24d72b 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -1134,14 +1134,13 @@ abstract class Erasure extends InfoTransform } qual.tpe.typeSymbol match { - case UnitClass | NullClass => LIT(0) - case IntClass => qual - case s @ (ShortClass | ByteClass | CharClass) => numericConversion(qual, s) - case BooleanClass => If(qual, LIT(true.##), LIT(false.##)) - case LongClass => staticsCall(nme.longHash) - case FloatClass => staticsCall(nme.floatHash) - case DoubleClass => staticsCall(nme.doubleHash) - case _ => staticsCall(nme.anyHash) + case UnitClass | NullClass => LIT(0) + case IntClass | ShortClass | ByteClass | CharClass => qual + case BooleanClass => If(qual, LIT(true.##), LIT(false.##)) + case LongClass => staticsCall(nme.longHash) + case FloatClass => staticsCall(nme.floatHash) + case DoubleClass => staticsCall(nme.doubleHash) + case _ => staticsCall(nme.anyHash) } } else if (isPrimitiveValueClass(qual.tpe.typeSymbol)) { // Rewrite 5.getClass to ScalaRunTime.anyValClass(5) From 3c548a7647bfa6173fa5bf58477194327a1d5c37 Mon Sep 17 00:00:00 2001 From: mkeskells Date: Thu, 14 May 2020 23:31:32 +0100 Subject: [PATCH 23/46] Map ++ without CBF should use the same optimised path as ++ with CBF also optimise for small map addition --- build.sbt | 5 ++ .../scala/collection/immutable/Map.scala | 65 ++++++++++++++++++- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index adcee84f1d82..90707045a113 100644 --- a/build.sbt +++ b/build.sbt @@ -322,6 +322,11 @@ val mimaFilterSettings = Seq { ProblemFilters.exclude[MissingTypesProblem]("scala.collection.immutable.Map$Map4"), ProblemFilters.exclude[MissingTypesProblem]("scala.collection.immutable.Map$EmptyMap$"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Map#Map1.addTo"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Map#Map2.addTo"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Map#Map3.addTo"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Map#Map4.addTo"), + ProblemFilters.exclude[MissingClassProblem]("scala.collection.immutable.TreeSet$TreeSetBuilder"), ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.TreeSet.this"), ProblemFilters.exclude[MissingClassProblem]("scala.collection.immutable.TreeSet$TreeSetBuilder$adder$"), diff --git a/src/library/scala/collection/immutable/Map.scala b/src/library/scala/collection/immutable/Map.scala index b80eb38828cb..c5a66d711b23 100644 --- a/src/library/scala/collection/immutable/Map.scala +++ b/src/library/scala/collection/immutable/Map.scala @@ -15,7 +15,6 @@ package collection package immutable import generic._ -import scala.collection.immutable.Map.MapBuilderImpl import scala.util.hashing.MurmurHash3 /** @@ -116,7 +115,7 @@ object Map extends ImmutableMapFactory[Map] { if (isMapCBF(bf)) that match { case hm: HashMap[a, b] if hm.size > 4 => hm.asInstanceOf[That] - case EmptyMap => this.asInstanceOf[That] + case m: AnyRef if m eq EmptyMap => this.asInstanceOf[That] case m: Map1[_, _] => m.asInstanceOf[That] case m: Map2[_, _] => m.asInstanceOf[That] case m: Map3[_, _] => m.asInstanceOf[That] @@ -151,6 +150,20 @@ object Map extends ImmutableMapFactory[Map] { if (key == key1) new Map1(key1, value) else new Map2(key1, value1, key, value) def + [V1 >: V](kv: (K, V1)): Map[K, V1] = updated(kv._1, kv._2) + override def ++[V1 >: V](xs: GenTraversableOnce[(K, V1)]): Map[K, V1] = ++[(K, V1), Map[K, V1]](xs)(Map.canBuildFrom[K, V1]) + override def ++[B >: (K, V), That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Map[K, V], B, That]): That = { + if (isMapCBF(bf)) that match { + case m: AnyRef if m eq EmptyMap => this.asInstanceOf[That] + case m: Map1[K, V] => m.addTo(this).asInstanceOf[That] + case m: Map2[K, V] => m.addTo(this).asInstanceOf[That] + case m: Map3[K, V] => m.addTo(this).asInstanceOf[That] + case m: Map4[K, V] => m.addTo(this).asInstanceOf[That] + case _ => super.++(that)(bf) + } else super.++(that)(bf) + } + private[Map] def addTo[V1 >: V](m : Map[K,V1]): Map[K, V1] = { + m.updated(key1, value1) + } def - (key: K): Map[K, V] = if (key == key1) Map.empty else this override def foreach[U](f: ((K, V)) => U): Unit = { @@ -204,6 +217,21 @@ object Map extends ImmutableMapFactory[Map] { else if (key == key2) new Map2(key1, value1, key2, value) else new Map3(key1, value1, key2, value2, key, value) def + [V1 >: V](kv: (K, V1)): Map[K, V1] = updated(kv._1, kv._2) + override def ++[V1 >: V](xs: GenTraversableOnce[(K, V1)]): Map[K, V1] = ++[(K, V1), Map[K, V1]](xs)(Map.canBuildFrom[K, V1]) + override def ++[B >: (K, V), That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Map[K, V], B, That]): That = { + if (isMapCBF(bf)) that match { + case m: AnyRef if m eq EmptyMap => this.asInstanceOf[That] + case m: Map1[K, V] => m.addTo(this).asInstanceOf[That] + case m: Map2[K, V] => m.addTo(this).asInstanceOf[That] + case m: Map3[K, V] => m.addTo(this).asInstanceOf[That] + case m: Map4[K, V] => m.addTo(this).asInstanceOf[That] + case _ => super.++(that)(bf) + } else super.++(that)(bf) + } + private[Map] def addTo[V1 >: V](m : Map[K,V1]): Map[K, V1] = { + m.updated(key1, value1). + updated(key2, value2) + } def - (key: K): Map[K, V] = if (key == key1) new Map1(key2, value2) else if (key == key2) new Map1(key1, value1) @@ -280,6 +308,22 @@ object Map extends ImmutableMapFactory[Map] { else if (key == key3) new Map3(key1, value1, key2, value2, key3, value) else new Map4(key1, value1, key2, value2, key3, value3, key, value) def + [V1 >: V](kv: (K, V1)): Map[K, V1] = updated(kv._1, kv._2) + override def ++[V1 >: V](xs: GenTraversableOnce[(K, V1)]): Map[K, V1] = ++[(K, V1), Map[K, V1]](xs)(Map.canBuildFrom[K, V1]) + override def ++[B >: (K, V), That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Map[K, V], B, That]): That = { + if (isMapCBF(bf)) that match { + case m: AnyRef if m eq EmptyMap => this.asInstanceOf[That] + case m: Map1[K, V] => m.addTo(this).asInstanceOf[That] + case m: Map2[K, V] => m.addTo(this).asInstanceOf[That] + case m: Map3[K, V] => m.addTo(this).asInstanceOf[That] + case m: Map4[K, V] => m.addTo(this).asInstanceOf[That] + case _ => super.++(that)(bf) + } else super.++(that)(bf) + } + private[Map] def addTo[V1 >: V](m : Map[K,V1]): Map[K, V1] = { + m.updated(key1, value1). + updated(key2, value2). + updated(key3, value3) + } def - (key: K): Map[K, V] = if (key == key1) new Map2(key2, value2, key3, value3) else if (key == key2) new Map2(key1, value1, key3, value3) @@ -369,6 +413,23 @@ object Map extends ImmutableMapFactory[Map] { else if (key == key4) new Map4(key1, value1, key2, value2, key3, value3, key4, value) else (new HashMap).updated(key1,value1).updated(key2, value2).updated(key3, value3).updated(key4, value4).updated(key, value) def + [V1 >: V](kv: (K, V1)): Map[K, V1] = updated(kv._1, kv._2) + override def ++[V1 >: V](xs: GenTraversableOnce[(K, V1)]): Map[K, V1] = ++[(K, V1), Map[K, V1]](xs)(Map.canBuildFrom[K, V1]) + override def ++[B >: (K, V), That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Map[K, V], B, That]): That = { + if (isMapCBF(bf)) that match { + case m: AnyRef if m eq EmptyMap => this.asInstanceOf[That] + case m: Map1[K, V] => m.addTo(this).asInstanceOf[That] + case m: Map2[K, V] => m.addTo(this).asInstanceOf[That] + case m: Map3[K, V] => m.addTo(this).asInstanceOf[That] + case m: Map4[K, V] => m.addTo(this).asInstanceOf[That] + case _ => super.++(that)(bf) + } else super.++(that)(bf) + } + private[Map] def addTo[V1 >: V](m : Map[K,V1]): Map[K, V1] = { + m.updated(key1, value1). + updated(key2, value2). + updated(key3, value3). + updated(key4, value4) + } def - (key: K): Map[K, V] = if (key == key1) new Map3(key2, value2, key3, value3, key4, value4) else if (key == key2) new Map3(key1, value1, key3, value3, key4, value4) From 31d6481b8a1322bd1ecfa6d68c49f6c03ab42f19 Mon Sep 17 00:00:00 2001 From: mkeskells Date: Fri, 14 Aug 2020 14:56:47 +0100 Subject: [PATCH 24/46] review feedback - use the ClassTag to hold the empty Arrays and WrappedArray --- build.sbt | 21 ++++++++++++++++ src/library/scala/Array.scala | 7 +----- .../mutable/WrappedArrayBuilder.scala | 25 ++----------------- src/library/scala/reflect/ClassTag.scala | 15 ++++++++++- 4 files changed, 38 insertions(+), 30 deletions(-) diff --git a/build.sbt b/build.sbt index e897778cf230..5863281803f4 100644 --- a/build.sbt +++ b/build.sbt @@ -355,6 +355,27 @@ val mimaFilterSettings = Seq { ProblemFilters.exclude[DirectMissingMethodProblem]("scala.Array.emptyUnitArray"), ProblemFilters.exclude[MissingClassProblem]("scala.collection.mutable.WrappedArrayBuilder$"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassTag#GenericClassTag.emptyArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassTag#GenericClassTag.emptyWrappedArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#IntersectionTypeManifest.emptyArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#IntersectionTypeManifest.emptyWrappedArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#ClassTypeManifest.emptyArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#ClassTypeManifest.emptyWrappedArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.AnyValManifest.emptyArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.AnyValManifest.emptyWrappedArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassTag.emptyArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassTag.emptyWrappedArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#WildcardManifest.emptyArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#WildcardManifest.emptyWrappedArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#SingletonTypeManifest.emptyArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#SingletonTypeManifest.emptyWrappedArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassManifestFactory#AbstractTypeClassManifest.emptyArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassManifestFactory#AbstractTypeClassManifest.emptyWrappedArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#AbstractTypeManifest.emptyArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#AbstractTypeManifest.emptyWrappedArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassTypeManifest.emptyArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassTypeManifest.emptyWrappedArray"), + // // scala-reflect // diff --git a/src/library/scala/Array.scala b/src/library/scala/Array.scala index 71cd7b302223..b41a0d9c1349 100644 --- a/src/library/scala/Array.scala +++ b/src/library/scala/Array.scala @@ -51,10 +51,6 @@ class FallbackArrayBuilding { * @since 1.0 */ object Array extends FallbackArrayBuilding { - private val emptyArrays = new ClassValue[AnyRef] { - override def computeValue(cls: Class[_]): AnyRef = - java.lang.reflect.Array.newInstance(cls, 0) - } val emptyBooleanArray = empty[Boolean] val emptyByteArray = empty[Byte] @@ -188,8 +184,7 @@ object Array extends FallbackArrayBuilding { /** Returns an array of length 0 */ def empty[T: ClassTag]: Array[T] = { - val cls = implicitly[ClassTag[T]].runtimeClass.asInstanceOf[Class[T]] - emptyArrays.get(cls).asInstanceOf[Array[T]] + implicitly[ClassTag[T]].emptyArray } /** Creates an array with given elements. * diff --git a/src/library/scala/collection/mutable/WrappedArrayBuilder.scala b/src/library/scala/collection/mutable/WrappedArrayBuilder.scala index 3a1c6d9daa2c..a1705fc499af 100644 --- a/src/library/scala/collection/mutable/WrappedArrayBuilder.scala +++ b/src/library/scala/collection/mutable/WrappedArrayBuilder.scala @@ -35,7 +35,7 @@ class WrappedArrayBuilder[A](tag: ClassTag[A]) extends ReusableBuilder[A, Wrappe private var size: Int = 0 private def mkArray(size: Int): WrappedArray[A] = { - if (size == 0) WrappedArrayBuilder.emptyWrappedArray(tag) + if (size == 0) tag.emptyWrappedArray else { import java.util.Arrays.copyOf val runtimeClass = tag.runtimeClass @@ -111,25 +111,4 @@ class WrappedArrayBuilder[A](tag: ClassTag[A]) extends ReusableBuilder[A, Wrappe } // todo: add ++= -} -private [mutable] object WrappedArrayBuilder { - private def emptyWrappedArray[T](tag: ClassTag[T]): mutable.WrappedArray[T] = - emptyClass.get(tag.runtimeClass).asInstanceOf[WrappedArray[T]] - private[this] val emptyClass = new ClassValue[WrappedArray[_]] { - override def computeValue(cls: Class[_]): WrappedArray[_] = { - if (cls.isPrimitive) - cls match { - case java.lang.Integer.TYPE => new WrappedArray.ofInt(Array.emptyIntArray) - case java.lang.Double.TYPE => new WrappedArray.ofDouble(Array.emptyDoubleArray) - case java.lang.Long.TYPE => new WrappedArray.ofLong(Array.emptyLongArray) - case java.lang.Float.TYPE => new WrappedArray.ofFloat(Array.emptyFloatArray) - case java.lang.Character.TYPE => new WrappedArray.ofChar(Array.emptyCharArray) - case java.lang.Byte.TYPE => new WrappedArray.ofByte(Array.emptyByteArray) - case java.lang.Short.TYPE => new WrappedArray.ofShort(Array.emptyShortArray) - case java.lang.Boolean.TYPE => new WrappedArray.ofBoolean(Array.emptyBooleanArray) - case java.lang.Void.TYPE => new WrappedArray.ofUnit(Array.emptyUnitArray) - } - else new WrappedArray.ofRef(Array.empty[AnyRef]) - } - } -} +} \ No newline at end of file diff --git a/src/library/scala/reflect/ClassTag.scala b/src/library/scala/reflect/ClassTag.scala index cf5dc4f1c619..0c262954e24c 100644 --- a/src/library/scala/reflect/ClassTag.scala +++ b/src/library/scala/reflect/ClassTag.scala @@ -15,6 +15,9 @@ package reflect import java.lang.{ Class => jClass } +import scala.collection.mutable +import scala.runtime.BoxedUnit + /** * * A `ClassTag[T]` stores the erased class of a given type `T`, accessible via the `runtimeClass` @@ -46,6 +49,15 @@ import java.lang.{ Class => jClass } */ @scala.annotation.implicitNotFound(msg = "No ClassTag available for ${T}") trait ClassTag[T] extends ClassManifestDeprecatedApis[T] with Equals with Serializable { + + @transient private[scala] lazy val emptyArray : Array[T] = { + val componentType = + if (runtimeClass eq classOf[Void]) classOf[BoxedUnit] else runtimeClass + java.lang.reflect.Array.newInstance(componentType, 0).asInstanceOf[Array[T]] + } + @transient private[scala] lazy val emptyWrappedArray: mutable.WrappedArray[T] = + mutable.WrappedArray.make[T](emptyArray) + // please, don't add any APIs here, like it was with `newWrappedArray` and `newArrayBuilder` // class tags, and all tags in general, should be as minimalistic as possible @@ -151,7 +163,8 @@ object ClassTag { @SerialVersionUID(1L) private class GenericClassTag[T](val runtimeClass: jClass[_]) extends ClassTag[T] { override def newArray(len: Int): Array[T] = { - java.lang.reflect.Array.newInstance(runtimeClass, len).asInstanceOf[Array[T]] + if (len == 0) emptyArray + else java.lang.reflect.Array.newInstance(runtimeClass, len).asInstanceOf[Array[T]] } } From 93d1a5e10716d3a1483a9a384de1fc4cafcb185b Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Sun, 2 Aug 2020 18:43:36 +0100 Subject: [PATCH 25/46] Check all bindings exhaustively, e.g. tuples components The change to drop the null checks (introducing `TreeMakersToPropsIgnoreNullChecks`) over-reached and got rid of all the Vars that those null-checks were referencing. So, instead of that, finish honouring the `modelNull` option in `removeVarEq`. --- .../scala/tools/nsc/transform/patmat/Logic.scala | 7 +++---- .../tools/nsc/transform/patmat/MatchAnalysis.scala | 7 +------ test/files/neg/t10019.check | 11 +++++++++++ test/files/neg/t10019.flags | 1 + test/files/neg/t10019.scala | 11 +++++++++++ test/scaladoc/run/t10673.scala | 2 ++ 6 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 test/files/neg/t10019.check create mode 100644 test/files/neg/t10019.flags create mode 100644 test/files/neg/t10019.scala diff --git a/src/compiler/scala/tools/nsc/transform/patmat/Logic.scala b/src/compiler/scala/tools/nsc/transform/patmat/Logic.scala index ac3de202439e..0660798a1d38 100644 --- a/src/compiler/scala/tools/nsc/transform/patmat/Logic.scala +++ b/src/compiler/scala/tools/nsc/transform/patmat/Logic.scala @@ -398,10 +398,9 @@ trait Logic extends Debugging { object gatherEqualities extends PropTraverser { override def apply(p: Prop) = p match { - case Eq(v, c) => - vars += v - v.registerEquality(c) - case _ => super.apply(p) + case Eq(v, NullConst) if !modelNull => vars += v // not modeling equality to null + case Eq(v, c) => vars += v; v.registerEquality(c) + case _ => super.apply(p) } } diff --git a/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala b/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala index 71432b8ed6f1..ad11645b81e7 100644 --- a/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala +++ b/src/compiler/scala/tools/nsc/transform/patmat/MatchAnalysis.scala @@ -246,10 +246,6 @@ trait MatchApproximation extends TreeAndTypeAnalysis with ScalaLogic with MatchT override def toString = s"T${id}C($prop)" } - class TreeMakersToPropsIgnoreNullChecks(root: Symbol) extends TreeMakersToProps(root) { - override def uniqueNonNullProp(p: Tree): Prop = True - } - // returns (tree, tests), where `tree` will be used to refer to `root` in `tests` class TreeMakersToProps(val root: Symbol) { prepareNewAnalysis() // reset hash consing for Var and Const @@ -261,7 +257,6 @@ trait MatchApproximation extends TreeAndTypeAnalysis with ScalaLogic with MatchT def uniqueEqualityProp(testedPath: Tree, rhs: Tree): Prop = uniqueEqualityProps getOrElseUpdate((testedPath, rhs), Eq(Var(testedPath), ValueConst(rhs))) - // overridden in TreeMakersToPropsIgnoreNullChecks def uniqueNonNullProp (testedPath: Tree): Prop = uniqueNonNullProps getOrElseUpdate(testedPath, Not(Eq(Var(testedPath), NullConst))) @@ -537,7 +532,7 @@ trait MatchAnalysis extends MatchApproximation { val start = if (StatisticsStatics.areSomeColdStatsEnabled) statistics.startTimer(statistics.patmatAnaExhaust) else null var backoff = false - val approx = new TreeMakersToPropsIgnoreNullChecks(prevBinder) + val approx = new TreeMakersToProps(prevBinder) val symbolicCases = approx.approximateMatch(cases, approx.onUnknown { tm => approx.fullRewrite.applyOrElse[TreeMaker, Prop](tm, { case BodyTreeMaker(_, _) => True // irrelevant -- will be discarded by symbolCase later diff --git a/test/files/neg/t10019.check b/test/files/neg/t10019.check new file mode 100644 index 000000000000..9b861e903be1 --- /dev/null +++ b/test/files/neg/t10019.check @@ -0,0 +1,11 @@ +t10019.scala:4: warning: match may not be exhaustive. +It would fail on the following input: Foo(None) + def single(t: Foo): Nothing = t match { + ^ +t10019.scala:8: warning: match may not be exhaustive. +It would fail on the following input: (Foo(None), _) + def tuple(s: Foo, t: Foo): Nothing = (s, t) match { + ^ +error: No warnings can be incurred under -Xfatal-warnings. +two warnings found +one error found diff --git a/test/files/neg/t10019.flags b/test/files/neg/t10019.flags new file mode 100644 index 000000000000..85d8eb2ba295 --- /dev/null +++ b/test/files/neg/t10019.flags @@ -0,0 +1 @@ +-Xfatal-warnings diff --git a/test/files/neg/t10019.scala b/test/files/neg/t10019.scala new file mode 100644 index 000000000000..04cd95035f66 --- /dev/null +++ b/test/files/neg/t10019.scala @@ -0,0 +1,11 @@ +object Bug { + sealed case class Foo(e: Option[Int]) + + def single(t: Foo): Nothing = t match { + case Foo(Some(_)) => ??? + } + + def tuple(s: Foo, t: Foo): Nothing = (s, t) match { + case (Foo(Some(_)), _) => ??? + } +} diff --git a/test/scaladoc/run/t10673.scala b/test/scaladoc/run/t10673.scala index 4d747b41d7a5..0d5fc5e46c13 100644 --- a/test/scaladoc/run/t10673.scala +++ b/test/scaladoc/run/t10673.scala @@ -32,6 +32,8 @@ object Test extends ScaladocModelTest { import access._ def showParents(e: MemberTemplateEntity): Unit = { e.parentTypes.foreach(_._2.refEntity.foreach { + case (_, (LinkToMember(mbr, tpl), _)) => println(s"found link for member $mbr to $tpl") + case (_, (LinkToTpl(tpl), _)) => println(s"found link $tpl") case (_, (LinkToExternalTpl(name, _, tpl), _)) => println(s"'$name' links to $tpl") case (_, (Tooltip(name), _)) => println(s"'$name' no link!") }) From 6ae4136d0908f0ba228d00ec666b4ddb159be4d5 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 20 Aug 2020 13:51:16 +0200 Subject: [PATCH 26/46] simplify mima exceptions --- build.sbt | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/build.sbt b/build.sbt index 5863281803f4..2fa37fb0a307 100644 --- a/build.sbt +++ b/build.sbt @@ -353,30 +353,13 @@ val mimaFilterSettings = Seq { ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.generic.SortedSetFactory#SortedSetCanBuildFrom.ordering"), ProblemFilters.exclude[DirectMissingMethodProblem]("scala.Array.emptyUnitArray"), - ProblemFilters.exclude[MissingClassProblem]("scala.collection.mutable.WrappedArrayBuilder$"), - - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassTag#GenericClassTag.emptyArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassTag#GenericClassTag.emptyWrappedArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#IntersectionTypeManifest.emptyArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#IntersectionTypeManifest.emptyWrappedArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#ClassTypeManifest.emptyArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#ClassTypeManifest.emptyWrappedArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.AnyValManifest.emptyArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.AnyValManifest.emptyWrappedArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassTag.emptyArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassTag.emptyWrappedArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#WildcardManifest.emptyArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#WildcardManifest.emptyWrappedArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#SingletonTypeManifest.emptyArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#SingletonTypeManifest.emptyWrappedArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassManifestFactory#AbstractTypeClassManifest.emptyArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassManifestFactory#AbstractTypeClassManifest.emptyWrappedArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#AbstractTypeManifest.emptyArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ManifestFactory#AbstractTypeManifest.emptyWrappedArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassTypeManifest.emptyArray"), - ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.ClassTypeManifest.emptyWrappedArray"), - - // + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.*Tag.emptyArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.*Tag.emptyWrappedArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.*Manifest.emptyArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.*Manifest.emptyWrappedArray"), + + // // scala-reflect // ProblemFilters.exclude[Problem]("scala.reflect.internal.*"), From 8a125d3fa906afe4cb1b25435b1d1e7a18c4e9e0 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Fri, 14 Aug 2020 11:58:02 +0100 Subject: [PATCH 27/46] [nomerge][2.12] Welcome back Partest! --- build.sbt | 51 +- project/PartestUtil.scala | 28 +- src/intellij/junit.iml.SAMPLE | 2 +- ...t-extras.iml.SAMPLE => partest.iml.SAMPLE} | 12 +- src/intellij/scala.ipr.SAMPLE | 327 +++++--- src/intellij/test.iml.SAMPLE | 2 +- .../scala/tools/partest/ASMConverters.scala | 0 .../scala/tools/partest/AsmNode.scala | 0 .../scala/tools/partest/BytecodeTest.scala | 14 +- .../scala/tools/partest/CompilerTest.scala | 67 ++ .../scala/tools/partest/ConsoleLog.scala | 78 ++ .../scala/tools/partest/DirectTest.scala | 146 ++++ .../scala/tools/partest/IcodeComparison.scala | 0 .../scala/tools/partest/IcodeTest.scala | 50 ++ .../scala/tools/partest/JUnitTest.scala | 0 .../scala/tools/partest/JavapTest.scala | 0 .../scala/tools/partest/MemoryTest.scala | 50 ++ .../scala/tools/partest/ParserTest.scala | 0 .../scala/tools/partest/PartestDefaults.scala | 50 ++ .../scala/tools/partest/ReplTest.scala | 57 +- .../tools/partest/ScaladocJavaModelTest.scala | 2 +- .../tools/partest/ScaladocModelTest.scala | 15 +- .../scala/tools/partest/ScriptTest.scala | 0 .../scala/tools/partest/SecurityTest.scala | 26 + .../scala/tools/partest/SigTest.scala | 4 +- .../partest/StoreReporterDirectTest.scala | 26 + .../tools/partest/StubErrorMessageTest.scala | 0 .../scala/tools/partest/TestKinds.scala | 63 ++ .../scala/tools/partest/TestState.scala | 76 ++ .../scala/tools/partest/TestUtil.scala | 50 ++ .../scala/tools/partest/Util.scala | 17 +- .../scala/tools/partest/async/Async.scala | 2 +- .../partest/async/AsyncStateMachine.scala | 0 .../async/CompletableFutureAwait.scala | 0 .../scala/tools/partest/async/OptionDsl.scala | 0 .../tools/partest/async/OutputAwait.scala | 0 .../instrumented/Instrumentation.scala | 0 .../tools/partest/instrumented/Profiler.java | 0 .../tools/partest/nest/AbstractRunner.scala | 367 +++++++++ .../nest/DelegatingSecurityManager.scala | 46 ++ .../tools/partest/nest/DirectCompiler.scala | 159 ++++ .../tools/partest/nest/FileManager.scala | 134 +++ .../tools/partest/nest/PathSettings.scala | 46 ++ .../scala/tools/partest/nest/Runner.scala | 770 ++++++++++++++++++ .../scala/tools/partest/nest/RunnerSpec.scala | 72 ++ .../scala/tools/partest/nest/Stopwatch.scala | 36 + .../tools/partest/nest/StreamCapture.scala | 73 ++ .../scala/tools/partest/nest/TrapExit.scala | 36 + .../tools/partest/nest/UnsafeAccess.java | 42 + .../scala/tools/partest/nest/package.scala | 30 + src/partest/scala/tools/partest/package.scala | 196 +++++ .../scala/tools/partest/sbt/Framework.scala | 67 ++ .../scala/tools/partest/sbt/SBTRunner.scala | 91 +++ .../tools/partest/utils/Properties.scala | 21 + test/files/jvm/interpreter.scala | 5 +- .../neg/java-annotation-match-error.check | 7 - test/files/neg/t11643.scala | 2 +- test/files/neg/t7187-2.13.flags | 1 - .../macro-bundle-disambiguate-bundle.check | 0 .../macro-bundle-disambiguate-nonbundle.check | 0 .../macro-implicit-invalidate-on-error.check | 0 .../pos/reflection-compat-api-universe.check | 0 test/files/pos/reflection-compat-c.check | 0 .../reflection-compat-macro-universe.check | 0 test/files/pos/reflection-compat-ru.check | 0 test/files/pos/t11813.scala | 2 +- test/files/pos/t7776.check | 0 test/files/pos/t8001.check | 0 test/files/pos/t8187.check | 0 test/files/pos/t8209a.check | 0 test/files/pos/t8209b.check | 0 test/files/pos/t8352.check | 0 test/files/pos/t8364.check | 0 test/files/pos/t8369a.check | 0 test/files/pos/t8369b.check | 0 test/files/pos/t8719.check | 0 test/files/presentation/quasiquotes.flags | 0 test/files/run/t5545.scala | 2 - test/files/run/t7096.scala | 2 +- test/files/run/t7187-2.13.flags | 1 - test/scaladoc/run/t5527.scala | 2 - versions.properties | 2 - 82 files changed, 3204 insertions(+), 223 deletions(-) rename src/intellij/{partest-extras.iml.SAMPLE => partest.iml.SAMPLE} (74%) rename src/{partest-extras => partest}/scala/tools/partest/ASMConverters.scala (100%) rename src/{partest-extras => partest}/scala/tools/partest/AsmNode.scala (100%) rename src/{partest-extras => partest}/scala/tools/partest/BytecodeTest.scala (94%) create mode 100644 src/partest/scala/tools/partest/CompilerTest.scala create mode 100644 src/partest/scala/tools/partest/ConsoleLog.scala create mode 100644 src/partest/scala/tools/partest/DirectTest.scala rename src/{partest-extras => partest}/scala/tools/partest/IcodeComparison.scala (100%) create mode 100644 src/partest/scala/tools/partest/IcodeTest.scala rename src/{partest-extras => partest}/scala/tools/partest/JUnitTest.scala (100%) rename src/{partest-extras => partest}/scala/tools/partest/JavapTest.scala (100%) create mode 100644 src/partest/scala/tools/partest/MemoryTest.scala rename src/{partest-extras => partest}/scala/tools/partest/ParserTest.scala (100%) create mode 100644 src/partest/scala/tools/partest/PartestDefaults.scala rename src/{partest-extras => partest}/scala/tools/partest/ReplTest.scala (68%) rename src/{partest-extras => partest}/scala/tools/partest/ScaladocJavaModelTest.scala (93%) rename src/{partest-extras => partest}/scala/tools/partest/ScaladocModelTest.scala (97%) rename src/{partest-extras => partest}/scala/tools/partest/ScriptTest.scala (100%) create mode 100644 src/partest/scala/tools/partest/SecurityTest.scala rename src/{partest-extras => partest}/scala/tools/partest/SigTest.scala (92%) create mode 100644 src/partest/scala/tools/partest/StoreReporterDirectTest.scala rename src/{partest-extras => partest}/scala/tools/partest/StubErrorMessageTest.scala (100%) create mode 100644 src/partest/scala/tools/partest/TestKinds.scala create mode 100644 src/partest/scala/tools/partest/TestState.scala create mode 100644 src/partest/scala/tools/partest/TestUtil.scala rename src/{partest-extras => partest}/scala/tools/partest/Util.scala (79%) rename src/{partest-extras => partest}/scala/tools/partest/async/Async.scala (97%) rename src/{partest-extras => partest}/scala/tools/partest/async/AsyncStateMachine.scala (100%) rename src/{partest-extras => partest}/scala/tools/partest/async/CompletableFutureAwait.scala (100%) rename src/{partest-extras => partest}/scala/tools/partest/async/OptionDsl.scala (100%) rename src/{partest-extras => partest}/scala/tools/partest/async/OutputAwait.scala (100%) rename src/{partest-extras => partest}/scala/tools/partest/instrumented/Instrumentation.scala (100%) rename src/{partest-extras => partest}/scala/tools/partest/instrumented/Profiler.java (100%) create mode 100644 src/partest/scala/tools/partest/nest/AbstractRunner.scala create mode 100644 src/partest/scala/tools/partest/nest/DelegatingSecurityManager.scala create mode 100644 src/partest/scala/tools/partest/nest/DirectCompiler.scala create mode 100644 src/partest/scala/tools/partest/nest/FileManager.scala create mode 100644 src/partest/scala/tools/partest/nest/PathSettings.scala create mode 100644 src/partest/scala/tools/partest/nest/Runner.scala create mode 100644 src/partest/scala/tools/partest/nest/RunnerSpec.scala create mode 100644 src/partest/scala/tools/partest/nest/Stopwatch.scala create mode 100644 src/partest/scala/tools/partest/nest/StreamCapture.scala create mode 100644 src/partest/scala/tools/partest/nest/TrapExit.scala create mode 100644 src/partest/scala/tools/partest/nest/UnsafeAccess.java create mode 100644 src/partest/scala/tools/partest/nest/package.scala create mode 100644 src/partest/scala/tools/partest/package.scala create mode 100644 src/partest/scala/tools/partest/sbt/Framework.scala create mode 100644 src/partest/scala/tools/partest/sbt/SBTRunner.scala create mode 100644 src/partest/scala/tools/partest/utils/Properties.scala delete mode 100644 test/files/neg/java-annotation-match-error.check delete mode 100644 test/files/neg/t7187-2.13.flags delete mode 100644 test/files/pos/macro-bundle-disambiguate-bundle.check delete mode 100644 test/files/pos/macro-bundle-disambiguate-nonbundle.check delete mode 100644 test/files/pos/macro-implicit-invalidate-on-error.check delete mode 100644 test/files/pos/reflection-compat-api-universe.check delete mode 100644 test/files/pos/reflection-compat-c.check delete mode 100644 test/files/pos/reflection-compat-macro-universe.check delete mode 100644 test/files/pos/reflection-compat-ru.check delete mode 100644 test/files/pos/t7776.check delete mode 100644 test/files/pos/t8001.check delete mode 100644 test/files/pos/t8187.check delete mode 100644 test/files/pos/t8209a.check delete mode 100644 test/files/pos/t8209b.check delete mode 100644 test/files/pos/t8352.check delete mode 100644 test/files/pos/t8364.check delete mode 100644 test/files/pos/t8369a.check delete mode 100644 test/files/pos/t8369b.check delete mode 100644 test/files/pos/t8719.check delete mode 100644 test/files/presentation/quasiquotes.flags delete mode 100644 test/files/run/t7187-2.13.flags diff --git a/build.sbt b/build.sbt index 05d1348b31c0..6266357022ae 100644 --- a/build.sbt +++ b/build.sbt @@ -41,17 +41,18 @@ import VersionUtil._ val scalaSwingDep = scalaDep("org.scala-lang.modules", "scala-swing") val scalaXmlDep = scalaDep("org.scala-lang.modules", "scala-xml") val scalaParserCombinatorsDep = scalaDep("org.scala-lang.modules", "scala-parser-combinators") -val partestDep = scalaDep("org.scala-lang.modules", "scala-partest", versionProp = "partest") // Non-Scala dependencies: -val junitDep = "junit" % "junit" % "4.12" -val junitInterfaceDep = "com.novocode" % "junit-interface" % "0.11" % "test" -val scalacheckDep = "org.scalacheck" % "scalacheck_2.12" % "1.14.3" % "test" -val jolDep = "org.openjdk.jol" % "jol-core" % "0.9" -val asmDep = "org.scala-lang.modules" % "scala-asm" % versionProps("scala-asm.version") -val jlineDep = "jline" % "jline" % versionProps("jline.version") -val jansiDep = "org.fusesource.jansi" % "jansi" % "1.12" -val antDep = "org.apache.ant" % "ant" % "1.9.4" +val junitDep = "junit" % "junit" % "4.12" +val junitInterfaceDep = "com.novocode" % "junit-interface" % "0.11" % Test +val scalacheckDep = "org.scalacheck" %% "scalacheck" % "1.14.3" % Test +val jolDep = "org.openjdk.jol" % "jol-core" % "0.9" +val asmDep = "org.scala-lang.modules" % "scala-asm" % versionProps("scala-asm.version") +val jlineDep = "jline" % "jline" % versionProps("jline.version") +val jansiDep = "org.fusesource.jansi" % "jansi" % "1.12" +val antDep = "org.apache.ant" % "ant" % "1.9.4" +val testInterfaceDep = "org.scala-sbt" % "test-interface" % "1.0" +val diffUtilsDep = "com.googlecode.java-diff-utils" % "diffutils" % "1.3.0" /** Publish to ./dists/maven-sbt, similar to the Ant build which publishes to ./dists/maven. This * can be used to compare the output of the sbt and Ant builds during the transition period. Any @@ -975,18 +976,20 @@ lazy val scalap = configureAsSubproject(project) ) .dependsOn(compiler) -lazy val partestExtras = Project("partest-extras", file(".") / "src" / "partest-extras") - .dependsOn(replJlineEmbedded, scaladoc) - .settings(commonSettings) - .settings(generatePropertiesFileSettings) - .settings(clearSourceAndResourceDirectories) +lazy val partest = configureAsSubproject(project) + .dependsOn(library, reflect, compiler, scalap, replJlineEmbedded, scaladoc) .settings(disableDocs) - .settings(disablePublishing) + .settings(Osgi.settings) + .settings(AutomaticModuleName.settings("scala.partest")) .settings( - name := "scala-partest-extras", - description := "Scala Compiler Testing Tool (compiler-specific extras)", - libraryDependencies ++= Seq(partestDep, junitDep), - unmanagedSourceDirectories in Compile := List(baseDirectory.value) + name := "scala-partest", + description := "Scala Compiler Testing Tool", + libraryDependencies ++= List(testInterfaceDep, diffUtilsDep, junitDep), + fixPom( + "/project/name" -> Scala Partest, + "/project/description" -> Scala Compiler Testing Tool, + "/project/packaging" -> jar + ), ) // An instrumented version of BoxesRunTime and ScalaRunTime for partest's "specialized" test category @@ -1043,7 +1046,7 @@ lazy val bench = project.in(file("test") / "benchmarks") ) lazy val junit = project.in(file("test") / "junit") - .dependsOn(library, reflect, compiler, partestExtras, scaladoc) + .dependsOn(library, reflect, compiler, partest, scaladoc) .settings(clearSourceAndResourceDirectories) .settings(commonSettings) .settings(disableDocs) @@ -1153,7 +1156,7 @@ lazy val partestJavaAgent = Project("partest-javaagent", file(".") / "src" / "pa ) lazy val test = project - .dependsOn(compiler, interactive, replJlineEmbedded, scalap, partestExtras, partestJavaAgent, scaladoc) + .dependsOn(compiler, interactive, replJlineEmbedded, scalap, partest, partestJavaAgent, scaladoc) .disablePlugins(plugins.JUnitXmlReportPlugin) .configs(IntegrationTest) .settings(commonSettings) @@ -1161,7 +1164,7 @@ lazy val test = project .settings(disablePublishing) .settings(Defaults.itSettings) .settings( - libraryDependencies ++= Seq(asmDep, partestDep, scalaXmlDep), + libraryDependencies ++= Seq(asmDep, scalaXmlDep), // no main sources sources in Compile := Seq.empty, // test sources are compiled in partest run, not here @@ -1372,7 +1375,7 @@ lazy val root: Project = (project in file(".")) setIncOptions ) .aggregate(library, reflect, compiler, compilerOptionsExporter, interactive, repl, replJline, replJlineEmbedded, - scaladoc, scalap, partestExtras, junit, libraryAll, scalaDist).settings( + scaladoc, scalap, partest, junit, libraryAll, scalaDist).settings( sources in Compile := Seq.empty, onLoadMessage := s"""|*** Welcome to the sbt build definition for Scala! *** |version=${(Global / version).value} scalaVersion=${(Global / scalaVersion).value} @@ -1559,7 +1562,7 @@ intellij := { moduleDeps(library).value, // moduleDeps(libraryAll).value, // No sources moduleDeps(manual).value, - moduleDeps(partestExtras).value, + moduleDeps(partest).value, moduleDeps(partestJavaAgent).value, moduleDeps(reflect).value, moduleDeps(repl).value, diff --git a/project/PartestUtil.scala b/project/PartestUtil.scala index 4d88b8ae6f5b..61fec2045066 100644 --- a/project/PartestUtil.scala +++ b/project/PartestUtil.scala @@ -34,9 +34,10 @@ object PartestUtil { def partestParser(globalBase: File, testBase: File): Parser[String] = { val knownUnaryOptions = List( "--pos", "--neg", "--run", "--jvm", "--res", "--ant", "--scalap", "--specialized", - "--instrumented", "--presentation", "--failed", "--update-check", - "--show-diff", "--show-log", "--verbose", "--terse", "--debug", "--version", "--self-test", "--help") + "--instrumented", "--presentation", "--failed", "--update-check", "--no-exec", + "--show-diff", "--show-log", "--verbose", "--terse", "--debug", "--version", "--help") val srcPathOption = "--srcpath" + val compilerPathOption = "--compilerpath" val grepOption = "--grep" // HACK: if we parse `--srcpath scaladoc`, we overwrite this var. The parser for test file paths @@ -57,13 +58,23 @@ object PartestUtil { val Grep = { def expandGrep(x: String): Seq[String] = { val matchingFileContent = try { - val Pattern = ("(?i)" + x).r + import scala.util.matching.Regex + val re = raw"(?i)${Regex.quote(x)}".r testFiles.allTestCases.filter { case (testFile, testPath) => - val assocFiles = List(".check", ".flags").map(testFile.getParentFile / _) + def sibling(suffix: String) = { + val name = testFile.name + val prefix = name.lastIndexOf('.') match { + case -1 => name + case i => name.substring(0, i) + } + val next = prefix + suffix + testFile.getParentFile / next + } + val assocFiles = List(".check", ".flags").map(sibling) val sourceFiles = if (testFile.isFile) List(testFile) else testFile.**(AllPassFilter).get.toList val allFiles = testFile :: assocFiles ::: sourceFiles - allFiles.exists { f => f.exists && f.isFile && Pattern.findFirstIn(IO.read(f)).isDefined } + allFiles.exists(f => f.isFile && re.findFirstIn(IO.read(f)).isDefined) } } catch { case _: Throwable => Nil @@ -93,9 +104,14 @@ object PartestUtil { opt + " " + path } + val CompilerPath = ((token(compilerPathOption) <~ Space) ~ token(NotSpace)) map { + case opt ~ path => + opt + " " + path + } + val ScalacOptsParser = (token("-Dpartest.scalac_opts=") ~ token(NotSpace)) map { case opt ~ v => opt + v } - val P = oneOf(knownUnaryOptions.map(x => token(x))) | SrcPath | TestPathParser | Grep | ScalacOptsParser + val P = oneOf(knownUnaryOptions.map(x => token(x))) | SrcPath | CompilerPath | TestPathParser | Grep | ScalacOptsParser (Space ~> repsep(P, oneOrMore(Space))).map(_.mkString(" ")).?.map(_.getOrElse("")) } } diff --git a/src/intellij/junit.iml.SAMPLE b/src/intellij/junit.iml.SAMPLE index f830c904e97c..593fb3432fe1 100644 --- a/src/intellij/junit.iml.SAMPLE +++ b/src/intellij/junit.iml.SAMPLE @@ -15,7 +15,7 @@ - + diff --git a/src/intellij/partest-extras.iml.SAMPLE b/src/intellij/partest.iml.SAMPLE similarity index 74% rename from src/intellij/partest-extras.iml.SAMPLE rename to src/intellij/partest.iml.SAMPLE index 3618cd8f522f..332f07efbb20 100644 --- a/src/intellij/partest-extras.iml.SAMPLE +++ b/src/intellij/partest.iml.SAMPLE @@ -1,11 +1,11 @@ - - + + - - + + @@ -15,6 +15,6 @@ - + - \ No newline at end of file + diff --git a/src/intellij/scala.ipr.SAMPLE b/src/intellij/scala.ipr.SAMPLE index 229f9609b732..f4ad03c620f3 100644 --- a/src/intellij/scala.ipr.SAMPLE +++ b/src/intellij/scala.ipr.SAMPLE @@ -201,7 +201,7 @@ - + @@ -229,9 +229,19 @@ - + + + + + - + + + + + + + @@ -240,9 +250,10 @@ - + - + + @@ -251,15 +262,15 @@ - + - - - - - - - + + + + + + + @@ -269,7 +280,7 @@ - + @@ -279,15 +290,15 @@ - + - - + - + + - + @@ -297,28 +308,30 @@ - + - + - + - - + + + + - + @@ -327,7 +340,7 @@ - + @@ -337,117 +350,172 @@ - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + - + + + + @@ -456,8 +524,9 @@ - + + @@ -466,7 +535,7 @@ - + @@ -475,11 +544,12 @@ - - - + + + - + + @@ -490,19 +560,14 @@ - + - - + + - - - - - - - + + diff --git a/src/intellij/test.iml.SAMPLE b/src/intellij/test.iml.SAMPLE index 046dfd7b888a..5b4776186202 100644 --- a/src/intellij/test.iml.SAMPLE +++ b/src/intellij/test.iml.SAMPLE @@ -13,7 +13,7 @@ - + diff --git a/src/partest-extras/scala/tools/partest/ASMConverters.scala b/src/partest/scala/tools/partest/ASMConverters.scala similarity index 100% rename from src/partest-extras/scala/tools/partest/ASMConverters.scala rename to src/partest/scala/tools/partest/ASMConverters.scala diff --git a/src/partest-extras/scala/tools/partest/AsmNode.scala b/src/partest/scala/tools/partest/AsmNode.scala similarity index 100% rename from src/partest-extras/scala/tools/partest/AsmNode.scala rename to src/partest/scala/tools/partest/AsmNode.scala diff --git a/src/partest-extras/scala/tools/partest/BytecodeTest.scala b/src/partest/scala/tools/partest/BytecodeTest.scala similarity index 94% rename from src/partest-extras/scala/tools/partest/BytecodeTest.scala rename to src/partest/scala/tools/partest/BytecodeTest.scala index 35c487ba673b..2f8ead6b84aa 100644 --- a/src/partest-extras/scala/tools/partest/BytecodeTest.scala +++ b/src/partest/scala/tools/partest/BytecodeTest.scala @@ -24,11 +24,11 @@ import scala.tools.nsc.CloseableRegistry * Provides utilities for inspecting bytecode using ASM library. * * HOW TO USE - * 1. Create subdirectory in test/files/jvm for your test. Let's name it $TESTDIR. - * 2. Create $TESTDIR/BytecodeSrc_1.scala that contains Scala source file that you + * 1. Create subdirectory in test/files/jvm for your test. Let's name it \$TESTDIR. + * 2. Create \$TESTDIR/BytecodeSrc_1.scala that contains Scala source file that you * want to inspect the bytecode for. The '_1' suffix signals to partest that it * should compile this file first. - * 3. Create $TESTDIR/Test.scala: + * 3. Create \$TESTDIR/Test.scala: * import scala.tools.partest.BytecodeTest * object Test extends BytecodeTest { * def show { @@ -82,9 +82,9 @@ abstract class BytecodeTest { println(s"Different member counts in $name1 and $name2") false } - else (ms1, ms2).zipped forall { (m1, m2) => + else (ms1, ms2).zipped.forall { (m1, m2) => val c1 = f(m1) - val c2 = f(m2).replaceAllLiterally(name2, name1) + val c2 = f(m2).replace(name2, name1) if (c1 == c2) println(s"[ok] $m1") else @@ -159,7 +159,7 @@ object BytecodeTest { /** Parse `file` as a class file, transforms the ASM representation with `f`, * and overwrites the original file. */ - def modifyClassFile(file: JFile)(f: ClassNode => ClassNode) { + def modifyClassFile(file: JFile)(f: ClassNode => ClassNode): Unit = { val rfile = new reflect.io.File(file) def readClass: ClassNode = { val cr = new ClassReader(rfile.toByteArray()) @@ -168,7 +168,7 @@ object BytecodeTest { cn } - def writeClass(cn: ClassNode) { + def writeClass(cn: ClassNode): Unit = { val writer = new ClassWriter(0) cn.accept(writer) val os = rfile.bufferedOutput() diff --git a/src/partest/scala/tools/partest/CompilerTest.scala b/src/partest/scala/tools/partest/CompilerTest.scala new file mode 100644 index 000000000000..b896738e575a --- /dev/null +++ b/src/partest/scala/tools/partest/CompilerTest.scala @@ -0,0 +1,67 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest + +import scala.reflect.runtime.{universe => ru} +import scala.tools.nsc._ + +/** For testing compiler internals directly. + * Each source code string in "sources" will be compiled, and + * the check function will be called with the source code and the + * resulting CompilationUnit. The check implementation should + * test for what it wants to test and fail (via assert or other + * exception) if it is not happy. + */ +abstract class CompilerTest extends DirectTest { + def check(source: String, unit: global.CompilationUnit): Unit + + lazy val global: Global = newCompiler() + lazy val units: List[global.CompilationUnit] = compilationUnits(global)(sources: _ *) + import global._ + import definitions.{ compilerTypeFromTag } + + override def extraSettings = "-usejavacp -d " + testOutput.path + + def show() = (sources, units).zipped.foreach(check) + + // Override at least one of these... + def code = "" + def sources: List[String] = List(code) + + // Utility functions + class MkType(sym: Symbol) { + def apply[M](implicit t: ru.TypeTag[M]): Type = + if (sym eq NoSymbol) NoType + else appliedType(sym, compilerTypeFromTag(t)) + } + implicit def mkMkType(sym: Symbol) = new MkType(sym) + + def allMembers(root: Symbol): List[Symbol] = { + def loop(seen: Set[Symbol], roots: List[Symbol]): List[Symbol] = { + val latest = roots flatMap (_.info.members) filterNot (seen contains _) + if (latest.isEmpty) seen.toList.sortWith(_ isLess _) + else loop(seen ++ latest, latest) + } + loop(Set(), List(root)) + } + + class SymsInPackage(pkgName: String) { + def pkg = rootMirror.getPackage(pkgName) + def classes = allMembers(pkg) filter (_.isClass) + def modules = allMembers(pkg) filter (_.isModule) + def symbols = classes ++ terms filterNot (_ eq NoSymbol) + def terms = allMembers(pkg) filter (s => s.isTerm && !s.isConstructor) + def tparams = classes flatMap (_.info.typeParams) + def tpes = symbols.map(_.tpe).distinct + } +} diff --git a/src/partest/scala/tools/partest/ConsoleLog.scala b/src/partest/scala/tools/partest/ConsoleLog.scala new file mode 100644 index 000000000000..89feccd1ef78 --- /dev/null +++ b/src/partest/scala/tools/partest/ConsoleLog.scala @@ -0,0 +1,78 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest + +class ConsoleLog(colorEnabled: Boolean) { + + val bold = colored(Console.BOLD) + val yellow = colored(Console.YELLOW) + val green = colored(Console.GREEN) + val blue = colored(Console.BLUE) + val red = colored(Console.RED) + val cyan = colored(Console.CYAN) + val magenta = colored(Console.MAGENTA) + + private[this] var dotCount = 0 + private[this] final val DotWidth = 72 + + def print(text: String) = synchronized { + Console.out.print(text) + } + + def leftFlush(): Unit = synchronized { + if (dotCount != 0) { + normal("\n") + dotCount = 0 + } + } + + private[this] def colored(code: String): String => String = + s => if (colorEnabled) code + s + Console.RESET else s + + private[this] val (_outline, _success, _failure, _warning, _default) = + if (colorEnabled) (Console.BOLD, Console.BOLD + Console.GREEN, Console.BOLD + Console.RED, Console.BOLD + Console.YELLOW, Console.RESET) + else ("", "", "", "", "") + + def outline(msg: String) = print(_outline + msg + _default) + + def success(msg: String) = print(_success + msg + _default) + + def failure(msg: String) = print(_failure + msg + _default) + + def warning(msg: String) = print(_warning + msg + _default) + + def normal(msg: String) = print(_default + msg) + + def echo(message: String): Unit = synchronized { + leftFlush() + print(message + "\n") + } + + def echoSkipped(msg: String) = echo(yellow(msg)) + def echoPassed(msg: String) = echo(bold(green(msg))) + def echoFailed(msg: String) = echo(bold(red(msg))) + def echoMixed(msg: String) = echo(bold(yellow(msg))) + def echoWarning(msg: String) = echo(bold(red(msg))) + + def printDot(): Unit = printProgress(".") + def printEx(): Unit = printProgress(_failure + "X" + _default) + private def printProgress(icon: String): Unit = synchronized { + if (dotCount >= DotWidth) { + outline("\n" + icon) + dotCount = 1 + } else { + outline(icon) + dotCount += 1 + } + } +} diff --git a/src/partest/scala/tools/partest/DirectTest.scala b/src/partest/scala/tools/partest/DirectTest.scala new file mode 100644 index 000000000000..03005b38dba4 --- /dev/null +++ b/src/partest/scala/tools/partest/DirectTest.scala @@ -0,0 +1,146 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest + +import scala.reflect.internal.util.{BatchSourceFile, SourceFile} +import scala.tools.cmd.CommandLineParser +import scala.tools.nsc._ +import scala.tools.nsc.reporters.{ConsoleReporter, Reporter} +import scala.tools.nsc.settings.ScalaVersion + +/** Test with code which is embedded as a string. + * + * `DirectTest` allows for more complete control over settings, compiler + * configuration, sequence of events, etc. than does partest alone. + * + * Tests must define `code` and `show()`. Minimally: + * ``` + * def show() = assert(compile()) + * ``` + * + * There are helper methods for creating settings and + * invoking a (newly constructed) compiler. + */ +abstract class DirectTest { + // The program being tested in some fashion + def code: String + // produce the output to be compared against a checkfile + def show(): Unit + + // the test file or dir, and output directory + def testPath = SFile(sys.props("partest.test-path")) + def testOutput = Directory(sys.props("partest.output")) + + // override to add additional settings besides -d testOutput.path + def extraSettings: String = "" + // a default Settings object using only extraSettings + def settings: Settings = newSettings(CommandLineParser.tokenize(extraSettings)) + // settings factory using given args and also debug settings + def newSettings(args: List[String]) = { + val s = new Settings + val allArgs = args ++ CommandLineParser.tokenize(debugSettings) + log(s"newSettings: allArgs = $allArgs") + val (success, residual) = s.processArguments(allArgs, processAll = false) + assert(success && residual.isEmpty, s"Bad settings [${args.mkString(",")}], residual [${residual.mkString(",")}]") + s + } + // new compiler using given ad hoc args, -d and extraSettings + def newCompiler(args: String*): Global = { + val settings = newSettings(CommandLineParser.tokenize(s"""-d "${testOutput.path}" ${extraSettings}""") ++ args.toList) + newCompiler(settings) + } + + // compiler factory + def newCompiler(settings: Settings): Global = Global(settings, reporter(settings)) + + // reporter factory, console by default + def reporter(settings: Settings): Reporter = new ConsoleReporter(settings) + + private def newSourcesWithExtension(ext: String)(codes: String*): List[BatchSourceFile] = + codes.toList.zipWithIndex map { + case (src, idx) => new BatchSourceFile(s"newSource${idx + 1}.$ext", src) + } + + def newJavaSources(codes: String*) = newSourcesWithExtension("java")(codes: _*) + def newSources(codes: String*) = newSourcesWithExtension("scala")(codes: _*) + + def compileString(global: Global)(sourceCode: String): Boolean = { + withRun(global)(_ compileSources newSources(sourceCode)) + !global.reporter.hasErrors + } + + def javaCompilationUnits(global: Global)(sourceCodes: String*) = { + sourceFilesToCompiledUnits(global)(newJavaSources(sourceCodes: _*)) + } + + def sourceFilesToCompiledUnits(global: Global)(files: List[SourceFile]) = { + withRun(global) { run => + run compileSources files + run.units.toList + } + } + + def compilationUnits(global: Global)(sourceCodes: String*): List[global.CompilationUnit] = { + val units = sourceFilesToCompiledUnits(global)(newSources(sourceCodes: _*)) + if (global.reporter.hasErrors) { + global.reporter.flush() + sys.error("Compilation failure.") + } + units + } + + def withRun[T](global: Global)(f: global.Run => T): T = { + global.reporter.reset() + f(new global.Run) + } + + // compile the code, optionally first adding to the settings + def compile(args: String*) = compileString(newCompiler(args: _*))(code) + + /** Constructor/main body **/ + def main(args: Array[String]): Unit = + try show() + catch { + case t: Exception => + println(t.getMessage) + t.printStackTrace + sys.exit(1) + } + + /** + * Run a test only if the current java version is at least the version specified. + */ + def testUnderJavaAtLeast[A](version: String)(yesRun: => A) = ifJavaAtLeast(version)(yesRun) +} + +class TestUnderJavaAtLeast[A](version: String, yesRun: => A) { + //val javaVersion = System.getProperty("java.specification.version") + val javaVersion = scala.util.Properties.javaSpecVersion + + // the "ScalaVersion" class parses Java specification versions just fine + val requiredJavaVersion = ScalaVersion(version) + val executingJavaVersion = ScalaVersion(javaVersion) + val shouldRun = executingJavaVersion >= requiredJavaVersion + val preamble = if (shouldRun) "Attempting" else "Doing fallback for" + + def logInfo() = log(s"$preamble java $version specific test under java version $javaVersion") + + /* + * If the current java version is at least 'version' then 'yesRun' is evaluated + * otherwise 'fallback' is + */ + def otherwise(fallback: => A): A = { + logInfo() + if (shouldRun) yesRun else fallback + } +} diff --git a/src/partest-extras/scala/tools/partest/IcodeComparison.scala b/src/partest/scala/tools/partest/IcodeComparison.scala similarity index 100% rename from src/partest-extras/scala/tools/partest/IcodeComparison.scala rename to src/partest/scala/tools/partest/IcodeComparison.scala diff --git a/src/partest/scala/tools/partest/IcodeTest.scala b/src/partest/scala/tools/partest/IcodeTest.scala new file mode 100644 index 000000000000..ec9e20a27875 --- /dev/null +++ b/src/partest/scala/tools/partest/IcodeTest.scala @@ -0,0 +1,50 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest + +import scala.tools.partest.nest.FileManager.compareContents + +/** A trait for testing icode. All you need is this in a + * partest source file: + * {{{ + * object Test extends IcodeTest + * }}} + * And then the generated output will be the icode for everything + * in that file. See source for possible customizations. + */ +abstract class IcodeTest extends DirectTest { + // override to check icode at a different point. + def printIcodeAfterPhase = "icode" + // override to use source code other than the file being tested. + def code = testPath.slurp() + + override def extraSettings: String = "-usejavacp -Vprint-icode:" + printIcodeAfterPhase + + // Compile, read in all the *.icode files, delete them, and return their contents + def collectIcode(args: String*): List[String] = { + compile("-d" :: testOutput.path :: args.toList : _*) + val icodeFiles = testOutput.files.toList filter (_ hasExtension "icode") + + try icodeFiles sortBy (_.name) flatMap (f => f.lines.toList) + finally icodeFiles foreach (f => f.delete()) + } + + // Default show() compiles the code with and without optimization and + // outputs the diff. + def show(): Unit = { + val lines1 = collectIcode("") + val lines2 = collectIcode("-optimise") + + println(compareContents(lines1, lines2)) + } +} diff --git a/src/partest-extras/scala/tools/partest/JUnitTest.scala b/src/partest/scala/tools/partest/JUnitTest.scala similarity index 100% rename from src/partest-extras/scala/tools/partest/JUnitTest.scala rename to src/partest/scala/tools/partest/JUnitTest.scala diff --git a/src/partest-extras/scala/tools/partest/JavapTest.scala b/src/partest/scala/tools/partest/JavapTest.scala similarity index 100% rename from src/partest-extras/scala/tools/partest/JavapTest.scala rename to src/partest/scala/tools/partest/JavapTest.scala diff --git a/src/partest/scala/tools/partest/MemoryTest.scala b/src/partest/scala/tools/partest/MemoryTest.scala new file mode 100644 index 000000000000..9fb7bb05c74f --- /dev/null +++ b/src/partest/scala/tools/partest/MemoryTest.scala @@ -0,0 +1,50 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest + +abstract class MemoryTest { + def maxDelta: Double + def calcsPerIter: Int + def calc(): Unit + + def main(args: Array[String]): Unit = { + val rt = Runtime.getRuntime() + def memUsage() = { + import java.lang.management._ + import scala.collection.JavaConverters._ + val pools = ManagementFactory.getMemoryPoolMXBeans.asScala + pools.map(_.getUsage.getUsed).sum / 1000000d + } + + val history = scala.collection.mutable.ListBuffer[Double]() + def stressTestIter() = { + var i = 0 + while (i < calcsPerIter) { calc(); i += 1 } + 1 to 5 foreach (_ => rt.gc()) + history += memUsage + } + + 1 to 5 foreach (_ => stressTestIter()) + val reference = memUsage() + 1 to 5 foreach (_ => stressTestIter()) + 1 to 5 foreach (_ => rt.gc()) + val result = memUsage() + history += result + + val delta = result - reference + if (delta > maxDelta) { + println("FAILED") + history foreach (mb => println(s"$mb Mb")) + } + } +} diff --git a/src/partest-extras/scala/tools/partest/ParserTest.scala b/src/partest/scala/tools/partest/ParserTest.scala similarity index 100% rename from src/partest-extras/scala/tools/partest/ParserTest.scala rename to src/partest/scala/tools/partest/ParserTest.scala diff --git a/src/partest/scala/tools/partest/PartestDefaults.scala b/src/partest/scala/tools/partest/PartestDefaults.scala new file mode 100644 index 000000000000..f92da68b90d0 --- /dev/null +++ b/src/partest/scala/tools/partest/PartestDefaults.scala @@ -0,0 +1,50 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools +package partest + +import scala.concurrent.duration.Duration +import scala.tools.nsc.Properties.{ propOrNone => prop } +import scala.util.Properties.jdkHome +import java.lang.Runtime.{ getRuntime => runtime } + +object PartestDefaults { + def sourcePath = prop("partest.srcdir") getOrElse "files" + def javaCmd = prop("partest.javacmd") orElse jdkexec("java") getOrElse "java" + def javacCmd = prop("partest.javac_cmd") orElse jdkexec("javac") getOrElse "javac" + def javaOpts = prop("partest.java_opts") getOrElse "" // opts when running java during tests + def scalacOpts = prop("partest.scalac_opts") getOrElse "" + + def testBuild = prop("partest.build") + def errorCount = prop("partest.errors") map (_.toInt) getOrElse 0 + def numThreads = math.max(1, prop("partest.threads") map (_.toInt) getOrElse runtime.availableProcessors) + def execInProcess: Boolean = { + val prop = java.lang.Boolean.getBoolean("partest.exec.in.process") + if (prop && numThreads > 1) warningMessage + prop + } + private lazy val warningMessage: Unit = { + println("Note: test execution will be non-parallel under -Dpartest.exec.in.process") + } + + def waitTime = Duration(prop("partest.timeout") getOrElse "4 hours") + def printDurationThreshold = java.lang.Integer.getInteger("partest.print.duration.threshold.ms", 5000) + + //def timeout = "1200000" // per-test timeout + + // probe for the named executable + private def jdkexec(name: String): Option[String] = { + import scala.reflect.io.Path, Path._, scala.tools.nsc.Properties.isWin + (Path(jdkHome) / "bin").walk.find(e => e.name == name || isWin && e.name.equalsIgnoreCase(s"$name.exe")).map(_.path) + } +} diff --git a/src/partest-extras/scala/tools/partest/ReplTest.scala b/src/partest/scala/tools/partest/ReplTest.scala similarity index 68% rename from src/partest-extras/scala/tools/partest/ReplTest.scala rename to src/partest/scala/tools/partest/ReplTest.scala index 02a380796895..33060793a4cb 100644 --- a/src/partest-extras/scala/tools/partest/ReplTest.scala +++ b/src/partest/scala/tools/partest/ReplTest.scala @@ -17,8 +17,13 @@ import scala.tools.nsc.interpreter.{ILoop, replProps} import scala.util.matching.Regex import scala.util.matching.Regex.Match -/** A class for testing repl code. - * It filters the line of output that mentions a version number. +/** Test code or commands in a REPL. + * + * Just call `show` to print the result of `eval()` your `code`. + * + * Optionally, `transformSettings` or redefine `normalize`. + * + * The test filters the line of output that mentions a version number. */ abstract class ReplTest extends DirectTest { // override to transform Settings object immediately before the finish @@ -71,9 +76,7 @@ trait Welcoming { this: ReplTest => /** Strip Any.toString's id@abcdef16 hashCodes. These are generally at end of result lines. */ trait Hashless extends ReplTest { import Hashless._ - override def normalize(s: String) = { - stripIdentityHashCode(super.normalize(s)) - } + override def normalize(s: String) = stripIdentityHashCode(super.normalize(s)) } object Hashless { private val hashless = "@[a-fA-F0-9]+".r @@ -83,17 +86,43 @@ object Hashless { /** Strip dynamic parts of LambdaMetafactory synthetic class names. */ trait Lambdaless extends ReplTest { import Lambdaless._ - override def normalize(s: String) = { - stripLambdaClassName(super.normalize(s)) - } + override def normalize(s: String) = stripLambdaClassName(super.normalize(s)) } object Lambdaless { - private val lambdaless = """\$Lambda\$\d+/\d+(@[a-fA-F0-9]+)?""".r + private val lambdaless = """\$Lambda\$\d+/(?:0x[a-f0-9]{16}|\d+)(@[a-fA-F0-9]+)?""".r private def stripLambdaClassName(s: String): String = lambdaless.replaceAllIn(s, Regex.quoteReplacement("")) } +/** Normalize a REPL stack trace by stripping line numbers and count of elided frames. */ +trait StackCleaner extends ReplTest { + import StackCleaner._ + override def normalize(s: String) = stripFrameCount(super.normalize(s)) +} +object StackCleaner { + private val elidedAndMore = """(\s+\.{3} )\d+( elided and )\d+( more)""".r + private val elidedOrMore = """(\s+\.{3} )\d+( (?:elided|more))""".r + private val frame = """(\s+at [^(]+\(:)\d+(\))""".r + private def stripFrameCount(line: String) = line match { + case elidedAndMore(ellipsis, infix, suffix) => s"$ellipsis???$infix???$suffix" // must be before `elided` + case elidedOrMore(ellipsis, suffix) => s"$ellipsis???$suffix" + case frame(prefix, suffix) => s"${prefix}XX${suffix}" + case s => s + } +} + /** Run a REPL test from a session transcript. - * The `session` is read from the `.check` file. + * + * The `session` is read from the `.check` file, + * and the `code` is the session stripped of output text. + * + * By default, output is compared against the check file + * as usual. Optionally, redefine `show` to use `checkSession()`, + * which compares `eval()` result to `expected`. + * + * Redefine `session` if it must be constructed dynamically. + * Redefine `show` to use `checkSession` to postprocess + * the `expected` text and/or the result of `eval()`. + * */ abstract class SessionTest extends ReplTest { /** Session transcript. */ @@ -117,7 +146,7 @@ abstract class SessionTest extends ReplTest { override final def code = pasted.findAllMatchIn(expected.mkString("", "\n", "\n")).map { case pasted(null, null, prompted) => def continued(m: Match): Option[String] = m match { - case margin(text) => Some(text) + case margin(text) => Some(Regex.quoteReplacement(text)) case _ => None } margin.replaceSomeIn(prompted, continued) @@ -137,8 +166,8 @@ abstract class SessionTest extends ReplTest { } } object SessionTest { - // \R for line break is Java 8, \v for vertical space might suffice - def input(prompt: String) = s"""(?m)^$prompt(:pa.*\u000A)// Entering paste mode.*\u000A\u000A((?:.*\u000A)*)\u000A// Exiting paste mode.*\u000A|^scala> (.*\u000A(?:\\s*\\| .*\u000A)*)""".r + // \R for line break since Java 8 + private def input(prompt: String) = raw"""(?m)^$prompt(:pa.*\R)// Entering paste mode.*\R\R((?:.*\R)*)\R// Exiting paste mode.*\R|^scala> (.*\R(?:\s*\| .*\R)*)""".r - val margin = """(?m)^\s*\| (.*)$""".r + private val margin = """(?m)^\s*\| (.*)$""".r } diff --git a/src/partest-extras/scala/tools/partest/ScaladocJavaModelTest.scala b/src/partest/scala/tools/partest/ScaladocJavaModelTest.scala similarity index 93% rename from src/partest-extras/scala/tools/partest/ScaladocJavaModelTest.scala rename to src/partest/scala/tools/partest/ScaladocJavaModelTest.scala index af457c6dd6b8..3f89dc71f167 100644 --- a/src/partest-extras/scala/tools/partest/ScaladocJavaModelTest.scala +++ b/src/partest/scala/tools/partest/ScaladocJavaModelTest.scala @@ -20,7 +20,7 @@ abstract class ScaladocJavaModelTest extends ScaladocModelTest { // overridden to pass explicit files to newDocFactory.makeUniverse (rather than code strings) // since the .java file extension is required override def model: Option[Universe] = { - val path = resourcePath + "/" + resourceFile + val path = s"$resourcePath/$resourceFile" newDocFactory.makeUniverse(Left(List(path))) } diff --git a/src/partest-extras/scala/tools/partest/ScaladocModelTest.scala b/src/partest/scala/tools/partest/ScaladocModelTest.scala similarity index 97% rename from src/partest-extras/scala/tools/partest/ScaladocModelTest.scala rename to src/partest/scala/tools/partest/ScaladocModelTest.scala index c780982fa7f4..a088e5ba6e0a 100644 --- a/src/partest-extras/scala/tools/partest/ScaladocModelTest.scala +++ b/src/partest/scala/tools/partest/ScaladocModelTest.scala @@ -12,12 +12,12 @@ package scala.tools.partest -import scala.tools.nsc._ import scala.tools.cmd.CommandLineParser -import scala.tools.nsc.doc.{ DocFactory, Universe } +import scala.tools.nsc._ +import scala.tools.nsc.doc.base.comment._ import scala.tools.nsc.doc.model._ import scala.tools.nsc.doc.model.diagram._ -import scala.tools.nsc.doc.base.comment._ +import scala.tools.nsc.doc.{DocFactory, Universe} import scala.tools.nsc.reporters.ConsoleReporter /** A class for testing scaladoc model generation @@ -56,7 +56,7 @@ abstract class ScaladocModelTest extends DirectTest { /** Override to feed code into scaladoc */ override def code = if (resourceFile ne null) - io.File(resourcePath + "/" + resourceFile).slurp() + io.File(s"$resourcePath/$resourceFile").slurp() else sys.error("Scaladoc Model Test: You need to give a file or some code to feed to scaladoc!") @@ -100,9 +100,6 @@ abstract class ScaladocModelTest extends DirectTest { // compile with scaladoc and output the result def model: Option[Universe] = newDocFactory.makeUniverse(Right(code)) - // so we don't get the newSettings warning - override def isDebug = false - // finally, enable easy navigation inside the entities object access { @@ -193,9 +190,9 @@ abstract class ScaladocModelTest extends DirectTest { def countLinksInBody(body: Body, p: EntityLink => Boolean): Int = { def countLinks(b: Any): Int = b match { case el: EntityLink if p(el) => 1 - case s: Seq[_] => s.toList.map(countLinks(_)).sum + case s: Seq[_] => s.toList.map(countLinks(_)).sum case p: Product => p.productIterator.toList.map(countLinks(_)).sum - case _ => 0 + case _ => 0 } countLinks(body) } diff --git a/src/partest-extras/scala/tools/partest/ScriptTest.scala b/src/partest/scala/tools/partest/ScriptTest.scala similarity index 100% rename from src/partest-extras/scala/tools/partest/ScriptTest.scala rename to src/partest/scala/tools/partest/ScriptTest.scala diff --git a/src/partest/scala/tools/partest/SecurityTest.scala b/src/partest/scala/tools/partest/SecurityTest.scala new file mode 100644 index 000000000000..ce76d29e67fa --- /dev/null +++ b/src/partest/scala/tools/partest/SecurityTest.scala @@ -0,0 +1,26 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest + +import java.security._ +import java.util._ + +abstract class SecurityTest extends App { + def throwIt(x: Any) = throw new AccessControlException("" + x) + def propertyCheck(p: PropertyPermission): Unit = throwIt(p) + + def check(perm: Permission): Unit = perm match { + case p: PropertyPermission => propertyCheck(p) + case _ => () + } +} diff --git a/src/partest-extras/scala/tools/partest/SigTest.scala b/src/partest/scala/tools/partest/SigTest.scala similarity index 92% rename from src/partest-extras/scala/tools/partest/SigTest.scala rename to src/partest/scala/tools/partest/SigTest.scala index b0a2c5f16f81..49a756ea1945 100644 --- a/src/partest-extras/scala/tools/partest/SigTest.scala +++ b/src/partest/scala/tools/partest/SigTest.scala @@ -44,10 +44,10 @@ trait SigTest { def methodsNamed[T: ClassTag](name: String) = methods[T](_.getName == name) def allGenericStrings[T: ClassTag]() = - (allMethods[T]() map mstr) ++ (allFields[T]() map fstr) + allMethods[T]().map(mstr _) ++ allFields[T]().map(fstr _) def genericStrings[T: ClassTag](name: String) = - (methodsNamed[T](name) map mstr) ++ (fieldsNamed[T](name) map fstr) + methodsNamed[T](name).map(mstr _) ++ fieldsNamed[T](name).map(fstr _) def show[T: ClassTag](name: String = "") = { println(classTag[T].runtimeClass.getName) diff --git a/src/partest/scala/tools/partest/StoreReporterDirectTest.scala b/src/partest/scala/tools/partest/StoreReporterDirectTest.scala new file mode 100644 index 000000000000..452becd2d8a7 --- /dev/null +++ b/src/partest/scala/tools/partest/StoreReporterDirectTest.scala @@ -0,0 +1,26 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest + +import scala.tools.nsc.Settings +import scala.tools.nsc.reporters.StoreReporter + +trait StoreReporterDirectTest extends DirectTest { + lazy val storeReporter: StoreReporter = new scala.tools.nsc.reporters.StoreReporter() + + /** Discards all but the first message issued at a given position. */ + def filteredInfos: Seq[storeReporter.Info] = storeReporter.infos.groupBy(_.pos).map(_._2.head).toList + + /** Hook into [[scala.tools.partest.DirectTest]] to install the custom reporter */ + override def reporter(settings: Settings) = storeReporter +} diff --git a/src/partest-extras/scala/tools/partest/StubErrorMessageTest.scala b/src/partest/scala/tools/partest/StubErrorMessageTest.scala similarity index 100% rename from src/partest-extras/scala/tools/partest/StubErrorMessageTest.scala rename to src/partest/scala/tools/partest/StubErrorMessageTest.scala diff --git a/src/partest/scala/tools/partest/TestKinds.scala b/src/partest/scala/tools/partest/TestKinds.scala new file mode 100644 index 000000000000..10c2883d8360 --- /dev/null +++ b/src/partest/scala/tools/partest/TestKinds.scala @@ -0,0 +1,63 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools +package partest +import nest.PathSettings + +class TestKinds(pathSettings: PathSettings) { + val standardKinds = ("pos neg run jvm res scalap specialized instrumented presentation" split "\\s+").toList + + def denotesTestFile(p: Path) = p.isFile && p.hasExtension("scala", "res", "xml") + def denotesTestDir(p: Path) = kindOf(p) match { + case "res" => false + case _ => p.isDirectory && p.extension == "" + } + def denotesTestPath(p: Path) = denotesTestDir(p) || denotesTestFile(p) + + def kindOf(p: Path) = p.toAbsolute.segments.takeRight(2).head + + def logOf(p: Path) = p.parent / s"${p.stripExtension}-${kindOf(p)}.log" + + // true if a test path matches the --grep expression. + private[this] def pathMatchesExpr(path: Path, expr: String) = { + // Matches the expression if any source file contains the expr, + // or if the checkfile contains it, or if the filename contains + // it (the last is case-insensitive.) + def matches(p: Path) = ( + (p.path.toLowerCase contains expr.toLowerCase) + || (p.fileContents contains expr) + ) + def candidates = { + (path changeExtension "check") +: { + if (path.isFile) List(path) + else path.toDirectory.deepList().filter(_.isJavaOrScala).toList + } + } + + (candidates exists matches) + } + + def testsFor(kind: String): (List[Path], List[Path]) = { + val (ti, others) = (pathSettings.srcDir / kind).toDirectory.list.partition(denotesTestPath) + val ts = ti.toList + val names = ts.toSet + def warnable(p: Path) = ((p.hasExtension("flags") || p.hasExtension("check")) + && List("scala", "res").forall(x => !names(p.changeExtension(x))) + && !names(p.parent / p.stripExtension) + ) + (ts, others.filter(warnable).toList) + } + def grepFor(expr: String): List[Path] = standardTests filter (t => pathMatchesExpr(t, expr)) + def standardTests: List[Path] = standardKinds flatMap (k => testsFor(k)._1) + def failedTests: List[Path] = standardTests filter (p => logOf(p).isFile) +} diff --git a/src/partest/scala/tools/partest/TestState.scala b/src/partest/scala/tools/partest/TestState.scala new file mode 100644 index 000000000000..8867ffe72c8d --- /dev/null +++ b/src/partest/scala/tools/partest/TestState.scala @@ -0,0 +1,76 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest + +sealed abstract class TestState { + def testFile: java.io.File + def what: String + def reason: String + def transcript: Array[String] + + def isOk = false + def isSkipped = false + def testIdent = testFile.testIdent + def transcriptString = transcript mkString EOL + + def identAndReason = testIdent + reasonString + def status = s"$what - $identAndReason" + def longStatus = status + transcriptString + def reasonString = if (reason == "") "" else s" [$reason]" + + def shortStatus = if (isOk) "ok" else "!!" + + final def andAlso(next: => TestState): TestState = if (isOk) next else this + + override def toString = status +} + +object TestState { + case class Uninitialized(testFile: java.io.File) extends TestState { + def what = "uninitialized" + def reason = what + def transcript = Array.empty[String] + override def shortStatus = "??" + } + case class Pass(testFile: java.io.File) extends TestState { + def what = "pass" + override def isOk = true + def transcript: Array[String] = Array.empty[String] + def reason = "" + } + case class Updated(testFile: java.io.File) extends TestState { + def what = "updated" + override def isOk = true + def transcript: Array[String] = Array.empty[String] + def reason = "updated check file" + override def shortStatus = "++" + } + case class Skip(testFile: java.io.File, reason: String) extends TestState { + def what = "skip" + override def isOk = true + override def isSkipped = true + def transcript: Array[String] = Array.empty[String] + override def shortStatus = "--" + } + case class Fail(testFile: java.io.File, reason: String, transcript: Array[String]) extends TestState { + def what = "fail" + } + case class Crash(testFile: java.io.File, caught: Throwable, transcript: Array[String]) extends TestState { + def what = "crash" + def reason = s"caught $caught_s - ${caught.getMessage}" + override def shortStatus = "?!" + + private def caught_s = (caught.getClass.getName split '.').last + override def transcriptString = nljoin(super.transcriptString, caught_s) + } +} diff --git a/src/partest/scala/tools/partest/TestUtil.scala b/src/partest/scala/tools/partest/TestUtil.scala new file mode 100644 index 000000000000..6aa597e2bdd3 --- /dev/null +++ b/src/partest/scala/tools/partest/TestUtil.scala @@ -0,0 +1,50 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest + +import scala.reflect.{ classTag, ClassTag } + +trait TestUtil { + /** Given function and block of code, evaluates code block, + * calls function with nanoseconds elapsed, and returns block result. + */ + def timed[T](f: Long => Unit)(body: => T): T = { + val start = System.nanoTime + val result = body + val end = System.nanoTime + + f(end - start) + result + } + /** Times body and returns (nanos, result). + */ + def alsoNanos[T](body: => T): (Long, T) = { + var nanos = 0L + val result = timed(nanos = _)(body) + + (nanos, result) + } + def nanos(body: => Unit): Long = alsoNanos(body)._1 + + def intercept[T <: Exception : ClassTag](code: => Unit): Unit = + try { + code + assert(false, "did not throw " + classTag[T]) + } catch { + case ex: Exception if classTag[T].runtimeClass isInstance ex => + } +} + +// Used in tests. +object TestUtil extends TestUtil { +} diff --git a/src/partest-extras/scala/tools/partest/Util.scala b/src/partest/scala/tools/partest/Util.scala similarity index 79% rename from src/partest-extras/scala/tools/partest/Util.scala rename to src/partest/scala/tools/partest/Util.scala index b4f3d1e7b4da..d3a6b3536dbe 100644 --- a/src/partest-extras/scala/tools/partest/Util.scala +++ b/src/partest/scala/tools/partest/Util.scala @@ -61,4 +61,19 @@ object Util { a.tree))))), a.tree)) } -} \ No newline at end of file + + def prettyArray(a: Array[_]): collection.IndexedSeq[Any] = new collection.AbstractSeq[Any] with collection.IndexedSeq[Any] { + def length = a.length + + def apply(idx: Int): Any = a(idx) match { + case x: AnyRef if x.getClass.isArray => prettyArray(x.asInstanceOf[Array[_]]) + case x => x + } + + override def stringPrefix = "Array" + } + + implicit class ArrayDeep(val a: Array[_]) extends AnyVal { + def deep: collection.IndexedSeq[Any] = prettyArray(a) + } +} diff --git a/src/partest-extras/scala/tools/partest/async/Async.scala b/src/partest/scala/tools/partest/async/Async.scala similarity index 97% rename from src/partest-extras/scala/tools/partest/async/Async.scala rename to src/partest/scala/tools/partest/async/Async.scala index 3fa64a92f845..1bdcd52e8972 100644 --- a/src/partest-extras/scala/tools/partest/async/Async.scala +++ b/src/partest/scala/tools/partest/async/Async.scala @@ -44,7 +44,7 @@ object Async { abstract class AsyncAsMacroStateMachine(execContext: ExecutionContext) extends AsyncStateMachine[Future[AnyRef], Try[AnyRef]] with Function1[Try[AnyRef], Unit] { Objects.requireNonNull(execContext) - private val result$async: Promise[AnyRef] = Promise[AnyRef](); + private val result$async: Promise[AnyRef] = Promise[AnyRef]() // FSM translated method def apply(tr$async: Try[AnyRef]): Unit diff --git a/src/partest-extras/scala/tools/partest/async/AsyncStateMachine.scala b/src/partest/scala/tools/partest/async/AsyncStateMachine.scala similarity index 100% rename from src/partest-extras/scala/tools/partest/async/AsyncStateMachine.scala rename to src/partest/scala/tools/partest/async/AsyncStateMachine.scala diff --git a/src/partest-extras/scala/tools/partest/async/CompletableFutureAwait.scala b/src/partest/scala/tools/partest/async/CompletableFutureAwait.scala similarity index 100% rename from src/partest-extras/scala/tools/partest/async/CompletableFutureAwait.scala rename to src/partest/scala/tools/partest/async/CompletableFutureAwait.scala diff --git a/src/partest-extras/scala/tools/partest/async/OptionDsl.scala b/src/partest/scala/tools/partest/async/OptionDsl.scala similarity index 100% rename from src/partest-extras/scala/tools/partest/async/OptionDsl.scala rename to src/partest/scala/tools/partest/async/OptionDsl.scala diff --git a/src/partest-extras/scala/tools/partest/async/OutputAwait.scala b/src/partest/scala/tools/partest/async/OutputAwait.scala similarity index 100% rename from src/partest-extras/scala/tools/partest/async/OutputAwait.scala rename to src/partest/scala/tools/partest/async/OutputAwait.scala diff --git a/src/partest-extras/scala/tools/partest/instrumented/Instrumentation.scala b/src/partest/scala/tools/partest/instrumented/Instrumentation.scala similarity index 100% rename from src/partest-extras/scala/tools/partest/instrumented/Instrumentation.scala rename to src/partest/scala/tools/partest/instrumented/Instrumentation.scala diff --git a/src/partest-extras/scala/tools/partest/instrumented/Profiler.java b/src/partest/scala/tools/partest/instrumented/Profiler.java similarity index 100% rename from src/partest-extras/scala/tools/partest/instrumented/Profiler.java rename to src/partest/scala/tools/partest/instrumented/Profiler.java diff --git a/src/partest/scala/tools/partest/nest/AbstractRunner.scala b/src/partest/scala/tools/partest/nest/AbstractRunner.scala new file mode 100644 index 000000000000..9f2286db1157 --- /dev/null +++ b/src/partest/scala/tools/partest/nest/AbstractRunner.scala @@ -0,0 +1,367 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools +package partest +package nest + +import utils.Properties._ +import scala.tools.nsc.Properties.{propOrFalse, setProp, versionMsg} +import scala.collection.mutable +import scala.reflect.internal.util.Collections.distinctBy +import scala.util.{Try, Success, Failure} +import java.util.concurrent.Executors +import java.util.concurrent.TimeUnit +import java.util.concurrent.TimeUnit.NANOSECONDS + +class AbstractRunner(val config: RunnerSpec.Config, protected final val testSourcePath: String, val fileManager: FileManager) { + + val javaCmdPath: String = PartestDefaults.javaCmd + val javacCmdPath: String = PartestDefaults.javacCmd + val scalacExtraArgs: Seq[String] = Seq.empty + val javaOpts: String = PartestDefaults.javaOpts + val scalacOpts: String = PartestDefaults.scalacOpts + val debug: Boolean = config.optDebug || propOrFalse("partest.debug") + val verbose: Boolean = config.optVerbose + val terse: Boolean = config.optTerse + + protected val printSummary = true + protected val partestCmd = "test/partest" + + private[this] var totalTests = 0 + private[this] val passedTests = mutable.ListBuffer[TestState]() + private[this] val failedTests = mutable.ListBuffer[TestState]() + + private[this] var summarizing = false + private[this] var elapsedMillis = 0L + private[this] var expectedFailures = 0 + private[this] var onlyIndividualTests = false + + val pathSettings = new PathSettings(testSourcePath) + + private[this] val testKinds = new TestKinds(pathSettings) + import testKinds._ + + val log = new ConsoleLog(sys.props contains "partest.colors") + import log._ + + private[this] val testNum = new java.util.concurrent.atomic.AtomicInteger(1) + @volatile private[this] var testNumberFmt = "%3d" + private[this] def testNumber = testNumberFmt format testNum.getAndIncrement() + def resetTestNumber(max: Int = -1): Unit = { + testNum set 1 + val width = if (max > 0) max.toString.length else 3 + testNumberFmt = s"%${width}d" + } + + private[this] val realSysErr = System.err + + def statusLine(state: TestState, durationMs: Long) = { + import state._ + import TestState._ + val colorizer = state match { + case _: Skip => yellow + case _: Updated => cyan + case s if s.isOk => green + case _ => red + } + val word = bold(colorizer(state.shortStatus)) + def durationString = if (durationMs > PartestDefaults.printDurationThreshold) f"[duration ${(1.0 * durationMs) / 1000}%.2fs]" else "" + f"$word $testNumber - $testIdent%-40s$reasonString$durationString" + } + + def reportTest(state: TestState, info: TestInfo, durationMs: Long, diffOnFail: Boolean, logOnFail: Boolean): List[String] = { + def errInfo: List[String] = { + def showLog() = + if (info.logFile.canRead) List ( + bold(cyan(s"##### Log file '${info.logFile}' from failed test #####\n")), + info.logFile.fileContents + ) else Nil + val diffed = + if (diffOnFail) { + val differ = bold(red("% ")) + "diff " + state.transcript.find(_ startsWith differ) match { + case Some(diff) => diff :: Nil + case None if !logOnFail && !verbose => showLog() + case _ => Nil + } + } else Nil + val logged = if (logOnFail) showLog() else Nil + diffed ::: logged + } + if (terse) { + if (state.isOk) { printDot() ; Nil } + else { printEx() ; statusLine(state, durationMs) :: errInfo } + } else { + echo(statusLine(state, durationMs)) + if (!state.isOk) errInfo.foreach(echo) + Nil + } + } + + def verbose(msg: => String): Unit = + if (verbose) realSysErr.println(msg) + + def showAllJVMInfo(): Unit = { + verbose(vmArgString) + verbose(allPropertiesString) + } + + private[this] def comment(s: String) = echo(magenta("# " + s)) + + private[this] def levyJudgment() = { + if (totalTests == 0) echoMixed("No tests to run.") + else if (elapsedMillis == 0) echoMixed("Test Run ABORTED") + else if (isSuccess) echoPassed("Test Run PASSED") + else echoFailed("Test Run FAILED") + } + + private[this] def passFailString(passed: Int, failed: Int, skipped: Int): String = { + val total = passed + failed + skipped + val isSuccess = failed == 0 + def p0 = s"$passed/$total" + def p = ( if (isSuccess) bold(green(p0)) else p0 ) + " passed" + def f = if (failed == 0) "" else bold(red("" + failed)) + " failed" + def s = if (skipped == 0) "" else bold(yellow("" + skipped)) + " skipped" + + oempty(p, f, s) mkString ", " + } + + private[this] def isSuccess = failedTests.size == expectedFailures + + def issueSummaryReport(): Unit = { + // Don't run twice + if (!summarizing) { + summarizing = true + + val passed0 = passedTests.toList + val failed0 = failedTests.toList + val passed = passed0.size + val failed = failed0.size + val skipped = totalTests - (passed + failed) + val passFail = passFailString(passed, failed, skipped) + val elapsed = if (elapsedMillis > 0) " (elapsed time: " + elapsedString(elapsedMillis) + ")" else "" + val message = passFail + elapsed + + if (failed0.nonEmpty) { + if (verbose) { + echo(bold(cyan("##### Transcripts from failed tests #####\n"))) + failed0 foreach { state => + comment(partestCmd + " " + state.testFile) + echo(state.transcriptString + "\n") + } + } + + def files_s = failed0.map(_.testFile).mkString(""" \""" + "\n ") + echo("# Failed test paths (this command will update checkfiles)") + echo(partestCmd + " --update-check \\\n " + files_s + "\n") + } + + if (printSummary) { + echo(message) + levyJudgment() + } + } + } + + /** Run the tests and return the success status */ + def run(): Boolean = { + setUncaughtHandler + + if (config.optVersion) echo(versionMsg) + else if (config.optHelp) { + echo(s"Usage: $partestCmd [options] [test test ...]") + echo(RunnerSpec.helpMsg) + } + else { + val (individualTests, invalid) = config.parsed.residualArgs map (p => Path(p)) partition denotesTestPath + if (invalid.nonEmpty) { + if (verbose) + invalid foreach (p => echoWarning(s"Discarding invalid test path " + p)) + else if (!terse) + echoWarning(s"Discarding ${invalid.size} invalid test paths") + } + + config.optTimeout foreach (x => setProp("partest.timeout", x)) + + if (!terse) + echo(banner) + + val grepExpr = config.optGrep getOrElse "" + + // If --grep is given we suck in every file it matches. + // TODO: intersect results of grep with specified kinds, if any + val greppedTests = if (grepExpr == "") Nil else { + val paths = grepFor(grepExpr) + if (paths.isEmpty) + echoWarning(s"grep string '$grepExpr' matched no tests.\n") + + paths.sortBy(_.toString) + } + + val isRerun = config.optFailed + val rerunTests = if (isRerun) testKinds.failedTests else Nil + def miscTests = individualTests ++ greppedTests ++ rerunTests + + val givenKinds = standardKinds filter config.parsed.isSet + val kinds = ( + if (givenKinds.nonEmpty) givenKinds + else if (miscTests.isEmpty && invalid.isEmpty) standardKinds // If no kinds, --grep, or individual tests were given, assume --all, unless there were invalid files specified + else Nil + ) + val kindsTests = kinds.flatMap { k => + val (good, bad) = testsFor(k) + bad.foreach(baddie => echoWarning(s"Extraneous file: $baddie")) + good + } + + def testContributors = { + List( + if (rerunTests.isEmpty) "" else "previously failed tests", + if (kindsTests.isEmpty) "" else s"${kinds.size} named test categories", + if (greppedTests.isEmpty) "" else s"${greppedTests.size} tests matching '$grepExpr'", + if (individualTests.isEmpty) "" else "specified tests" + ) filterNot (_ == "") mkString ", " + } + + val allTests: Array[Path] = distinctBy(miscTests ++ kindsTests)(_.toCanonical).sortBy(_.toString).toArray + val grouped = (allTests groupBy kindOf).toArray sortBy (x => standardKinds indexOf x._1) + + onlyIndividualTests = individualTests.nonEmpty && rerunTests.isEmpty && kindsTests.isEmpty && greppedTests.isEmpty + totalTests = allTests.size + expectedFailures = propOrNone("partest.errors") match { + case Some(num) => num.toInt + case _ => 0 + } + val expectedFailureMessage = if (expectedFailures == 0) "" else s" (expecting $expectedFailures to fail)" + echo(s"Selected $totalTests tests drawn from $testContributors$expectedFailureMessage\n") + if (config.optNoExec) echoMixed("Under --no-exec, tests will be compiled but not run! Runnable tests will be marked skipped!") + + val (_, millis) = timed { + for ((kind, paths) <- grouped) { + val num = paths.size + val ss = if (num == 1) "" else "s" + comment(s"starting $num test$ss in $kind") + val results = runTestsForFiles(paths map (_.jfile.getAbsoluteFile), kind) + val (passed, failed) = results partition (_.isOk) + + passedTests ++= passed + failedTests ++= failed + if (failed.nonEmpty) { + if (terse) failed.foreach(_.transcript.foreach(echo)) + comment(passFailString(passed.size, failed.size, 0) + " in " + kind) + } + echo("") + } + } + this.elapsedMillis = millis + issueSummaryReport() + } + isSuccess + } + + def banner = { + val baseDir = fileManager.compilerUnderTest.parent.toString + def relativize(path: String) = path.replace(baseDir, s"$$baseDir").replace(pathSettings.srcDir.toString, "$sourceDir") + val vmBin = javaHome + fileSeparator + "bin" + val vmName = "%s (build %s, %s)".format(javaVmName, javaVmVersion, javaVmInfo) + + s"""|Partest version: ${Properties.versionNumberString} + |Compiler under test: ${relativize(fileManager.compilerUnderTest.getAbsolutePath)} + |Scala version is: $versionMsg + |Scalac options are: ${(scalacExtraArgs ++ scalacOpts.split(' ')).mkString(" ")} + |Compilation Path: ${relativize(FileManager.joinPaths(fileManager.testClassPath))} + |Java binaries in: $vmBin + |Java runtime is: $vmName + |Java options are: $javaOpts + |baseDir: $baseDir + |sourceDir: ${pathSettings.srcDir} + """.stripMargin + // |Available processors: ${Runtime.getRuntime().availableProcessors()} + // |Java Classpath: ${sys.props("java.class.path")} + } + + def onFinishTest(testFile: File, result: TestState, durationMs: Long): TestState = { + result + } + + def runTest(testFile: File): TestState = { + val start = System.nanoTime() + val info = TestInfo(testFile) + val runner = new Runner(info, this) + var stopwatchDuration: Option[Long] = None + + // when option "--failed" is provided execute test only if log + // is present (which means it failed before) + val state = + if (config.optFailed && !info.logFile.canRead) + runner.genPass() + else { + val (state, durationMs) = + try runner.run() + catch { + case t: Throwable => throw new RuntimeException(s"Error running $testFile", t) + } + stopwatchDuration = Some(durationMs) + val verboseSummation = onlyIndividualTests && !terse + val more = reportTest(state, info, durationMs, diffOnFail = config.optShowDiff || verboseSummation , logOnFail = config.optShowLog || verboseSummation) + runner.cleanup(state) + if (more.isEmpty) state + else { + state match { + case f: TestState.Fail => f.copy(transcript = more.toArray) + case _ => state + } + } + } + val end = System.nanoTime() + val durationMs = stopwatchDuration.getOrElse(TimeUnit.NANOSECONDS.toMillis(end - start)) + onFinishTest(testFile, state, durationMs) + } + + def runTestsForFiles(kindFiles: Array[File], kind: String): Array[TestState] = { + resetTestNumber(kindFiles.size) + + val pool = Executors newFixedThreadPool PartestDefaults.numThreads + val futures = kindFiles map (f => pool submit callable(runTest(f.getAbsoluteFile))) + + pool.shutdown() + def aborted = { + pool.shutdownNow() // little point in continuing + // try to get as many completions as possible, in case someone cares + val results = for (f <- futures) yield { + try { + Some(f.get(0, NANOSECONDS)) + } catch { + case _: Throwable => None + } + } + results.flatten + } + Try (pool.awaitTermination(PartestDefaults.waitTime) { + throw TimeoutException(PartestDefaults.waitTime) + }) match { + case Success(_) => futures.map(_.get) + case Failure(TimeoutException(e)) => + warning("Thread pool timeout elapsed before all tests were complete!") + aborted + case Failure(ie: InterruptedException) => + warning("Thread pool was interrupted") + ie.printStackTrace() + aborted + case Failure(e) => + warning("Unexpected failure") + e.printStackTrace() + aborted + } + } +} diff --git a/src/partest/scala/tools/partest/nest/DelegatingSecurityManager.scala b/src/partest/scala/tools/partest/nest/DelegatingSecurityManager.scala new file mode 100644 index 000000000000..3ba255ad4dc0 --- /dev/null +++ b/src/partest/scala/tools/partest/nest/DelegatingSecurityManager.scala @@ -0,0 +1,46 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest.nest + +import java.io.FileDescriptor +import java.net.InetAddress +import java.security.Permission + +class DelegatingSecurityManager(delegate: SecurityManager) extends SecurityManager { + override def checkExit(status: Int): Unit = if (delegate ne null) delegate.checkExit(status) + override def checkPermission(perm: Permission): Unit = if (delegate ne null) delegate.checkPermission(perm) + override def checkPermission(perm: Permission, context: AnyRef): Unit = if (delegate ne null) delegate.checkPermission(perm, context) + override def checkExec(cmd: String): Unit = if (delegate ne null) delegate.checkExec(cmd) + override def checkWrite(file: String): Unit = if (delegate ne null) delegate.checkWrite(file) + override def checkDelete(file: String): Unit = if (delegate ne null) delegate.checkDelete(file) + override def checkRead(file: String): Unit = if (delegate ne null) delegate.checkRead(file) + override def checkRead(file: String, context: scala.Any): Unit = if (delegate ne null) delegate.checkRead(file, context) + override def checkPropertyAccess(key: String): Unit = if (delegate ne null) delegate.checkPropertyAccess(key) + override def checkAccept(host: String, port: Int): Unit = if (delegate ne null) delegate.checkAccept(host, port) + override def checkWrite(fd: FileDescriptor): Unit = if (delegate ne null) delegate.checkWrite(fd) + override def checkPrintJobAccess(): Unit = if (delegate ne null) delegate.checkPrintJobAccess() + override def checkMulticast(maddr: InetAddress): Unit = if (delegate ne null) delegate.checkMulticast(maddr) + override def checkSetFactory(): Unit = if (delegate ne null) delegate.checkSetFactory() + override def checkLink(lib: String): Unit = if (delegate ne null) delegate.checkLink(lib) + override def checkSecurityAccess(target: String): Unit = if (delegate ne null) delegate.checkSecurityAccess(target) + override def checkListen(port: Int): Unit = if (delegate ne null) delegate.checkListen(port) + override def checkAccess(t: Thread): Unit = if (delegate ne null) delegate.checkAccess(t) + override def checkAccess(g: ThreadGroup): Unit = if (delegate ne null) delegate.checkAccess(g) + override def checkCreateClassLoader(): Unit = if (delegate ne null) delegate.checkCreateClassLoader() + override def checkPackageDefinition(pkg: String): Unit = if (delegate ne null) delegate.checkPackageDefinition(pkg) + override def checkConnect(host: String, port: Int): Unit = if (delegate ne null) delegate.checkConnect(host, port) + override def checkConnect(host: String, port: Int, context: scala.Any): Unit = if (delegate ne null) delegate.checkConnect(host, port, context) + override def checkPackageAccess(pkg: String): Unit = if (delegate ne null) delegate.checkPackageAccess(pkg) + override def checkPropertiesAccess(): Unit = if (delegate ne null) delegate.checkPropertiesAccess() + override def checkRead(fd: FileDescriptor): Unit = if (delegate ne null) delegate.checkRead(fd) +} diff --git a/src/partest/scala/tools/partest/nest/DirectCompiler.scala b/src/partest/scala/tools/partest/nest/DirectCompiler.scala new file mode 100644 index 000000000000..8e4bf4e1ef76 --- /dev/null +++ b/src/partest/scala/tools/partest/nest/DirectCompiler.scala @@ -0,0 +1,159 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest +package nest + +import java.io.{FileWriter, PrintWriter} + +import scala.collection.mutable.ListBuffer +import scala.reflect.internal.util.NoPosition +import scala.reflect.io.AbstractFile +import scala.tools.nsc.reporters.{ConsoleReporter, Reporter} +import scala.tools.nsc.{CompilerCommand, Global, Settings} +import scala.sys.process._ + +class ExtConsoleReporter(settings: Settings, val writer: PrintWriter) extends ConsoleReporter(settings, Console.in, writer) { + shortname = true + // override def error(pos: Position, msg: String): Unit +} + +class TestSettings(cp: String, error: String => Unit) extends Settings(error) { + @deprecated("Use primary constructor", "1.0.12") + def this(cp: String) = this(cp, _ => ()) + nowarnings.value = false + encoding.value = "UTF-8" + classpath.value = cp + //lint.add("_") +} + +class PartestGlobal(settings: Settings, reporter: Reporter) extends Global(settings, reporter) { + // override def abort(msg: String): Nothing + // override def globalError(msg: String): Unit + // override def supplementErrorMessage(msg: String): String +} +class DirectCompiler(val runner: Runner) { + def newGlobal(settings: Settings, reporter: Reporter): PartestGlobal = + new PartestGlobal(settings, reporter) + + def newGlobal(settings: Settings, logWriter: FileWriter): Global = + newGlobal(settings, new ExtConsoleReporter(settings, new PrintWriter(logWriter))) + + + /** Massage args to merge plugins and fix paths. + * Plugin path can be relative to test root, or cwd is out. + * While we're at it, mix in the baseline options, too. + * That's how ant passes in the plugins dir. + */ + private def updatePluginPath(args: List[String], out: AbstractFile, srcdir: AbstractFile): Seq[String] = { + val dir = runner.suiteRunner.pathSettings.testRoot + // The given path, or the output dir if ".", or a temp dir if output is virtual (since plugin loading doesn't like virtual) + def pathOrCwd(p: String) = + if (p == ".") { + val plugxml = "scalac-plugin.xml" + val pout = if (out.isVirtual) Directory.makeTemp() else Path(out.path) + val srcpath = Path(srcdir.path) + val pd = (srcpath / plugxml).toFile + if (pd.exists) pd copyTo (pout / plugxml) + pout.toAbsolute + } else Path(p) + def absolutize(path: String) = pathOrCwd(path) match { + case x if x.isAbsolute => x.path + case x => (dir / x).toAbsolute.path + } + + val xprefix = "-Xplugin:" + val (xplugs, others) = args.partition(_.startsWith(xprefix)) + val Xplugin = + if (xplugs.isEmpty) Nil + else List(xprefix + xplugs.map(_ stripPrefix xprefix).flatMap(_ split pathSeparator).map(absolutize).mkString(pathSeparator)) + + // tests control most compiler settings, but let the environment tell us whether to exercise optimizer + val filteredOpts = runner.suiteRunner.scalacOpts.split(' ').filter(_.startsWith("-opt")) + + runner.suiteRunner.scalacExtraArgs ++ filteredOpts ++ others ++ Xplugin + } + + def compile(opts0: List[String], sources: List[File]): TestState = { + import runner.{sources => _, _} + import testInfo._ + + // adding codelib.jar to the classpath + // codelib provides the possibility to override standard reify + // this shields the massive amount of reification tests from changes in the API + val codeLib = suiteRunner.pathSettings.srcCodeLib.fold[List[Path]](x => Nil, lib => List[Path](lib)) + // add the instrumented library version to classpath -- must come first + val specializedOverride: List[Path] = + if (kind == "specialized") + List(suiteRunner.pathSettings.srcSpecLib.fold(sys.error, identity)) + else Nil + + val classPath: List[Path] = specializedOverride ++ codeLib ++ fileManager.testClassPath ++ List[Path](outDir) + + val parseArgErrors = ListBuffer.empty[String] + + val testSettings = new TestSettings(FileManager.joinPaths(classPath), s => parseArgErrors += s) + val logWriter = new FileWriter(logFile) + val srcDir = if (testFile.isDirectory) testFile else Path(testFile).parent.jfile + val opts = updatePluginPath(opts0, AbstractFile getDirectory outDir, AbstractFile getDirectory srcDir) + val command = new CompilerCommand(opts.toList, testSettings) + val reporter = new ExtConsoleReporter(testSettings, new PrintWriter(logWriter)) + val global = newGlobal(testSettings, reporter) + def errorCount = reporter.errorCount + + testSettings.outputDirs setSingleOutput outDir.getPath + + def reportError(s: String): Unit = reporter.error(NoPosition, s) + + parseArgErrors.toList foreach reportError + + // check that option processing succeeded + if (opts0.nonEmpty) { + if (!command.ok) reportError(opts0.mkString("bad options: ", space, "")) + if (command.files.nonEmpty) reportError(command.files.mkString("flags file may only contain compiler options, found: ", space, "")) + } + + suiteRunner.verbose(s"% compiling ${ sources.map(_.testIdent).mkString(space) }${ if (suiteRunner.debug) " -d " + outDir else ""}") + + def execCompile() = + if (command.shouldStopWithInfo) { + logWriter append (command getInfoMessage global) + runner genFail "compilation stopped with info" + } else { + new global.Run compile sources.map(_.getPath) + if (!reporter.hasErrors) runner.genPass() + else { + reporter.printSummary() + reporter.writer.close() + runner.genFail(s"compilation failed with $errorCount errors") + } + } + + def execOtherCompiler() = { + val stdout = new StringBuilder + val stderr = new StringBuilder + val logger = ProcessLogger(stdout append _, stderr append _) + val resultCode = (suiteRunner.config.optCompilerPath.get + " " + sources.map(_.getPath).mkString(" ")) ! logger + logWriter append stdout + logWriter append stderr + if (resultCode == 0) runner.genPass() + else runner.genFail(s"compilation failed") + } + + try { + if (suiteRunner.config.optCompilerPath.isEmpty) execCompile() + else execOtherCompiler() + } + catch { case t: Throwable => reportError(t.getMessage) ; runner.genCrash(t) } + finally { logWriter.close() } + } +} diff --git a/src/partest/scala/tools/partest/nest/FileManager.scala b/src/partest/scala/tools/partest/nest/FileManager.scala new file mode 100644 index 000000000000..348487c4d1cf --- /dev/null +++ b/src/partest/scala/tools/partest/nest/FileManager.scala @@ -0,0 +1,134 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +// $Id$ + +package scala.tools.partest +package nest + +import java.io.{File, IOException} +import java.net.URLClassLoader + +object FileManager { + def getLogFile(dir: File, fileBase: String, kind: String): File = + new File(dir, fileBase + "-" + kind + ".log") + + def getLogFile(file: File, kind: String): File = { + val dir = file.getParentFile + val fileBase = basename(file.getName) + + getLogFile(dir, fileBase, kind) + } + + def logFileExists(file: File, kind: String) = + getLogFile(file, kind).canRead + + def overwriteFileWith(dest: File, file: File) = + dest.isFile && copyFile(file, dest) + + def copyFile(from: File, dest: File): Boolean = { + if (from.isDirectory) { + assert(dest.isDirectory, "cannot copy directory to file") + val subDir: Directory = Path(dest) / Directory(from.getName) + subDir.createDirectory() + from.listFiles.toList forall (copyFile(_, subDir)) + } else { + val to = if (dest.isDirectory) new File(dest, from.getName) else dest + + try { + SFile(to) writeAll SFile(from).slurp() + true + } catch { case _: IOException => false } + } + } + + def mapFile(file: File, replace: String => String): Unit = { + val f = SFile(file) + + f.printlnAll(f.lines.toList map replace: _*) + } + + def jarsWithPrefix(dir: Directory, name: String): Iterator[SFile] = + dir.files filter (f => (f hasExtension "jar") && (f.name startsWith name)) + + def dirsWithPrefix(dir: Directory, name: String): Iterator[Directory] = + dir.dirs filter (_.name startsWith name) + + def joinPaths(paths: List[Path]) = ClassPath.join(paths.map(_.getAbsolutePath).distinct: _*) + + /** Compares two lists of lines using difflib to produce a unified diff. + * + * @param origLines the first seq of lines to be compared + * @param newLines the second seq of lines to be compared + * @param origName file name to be used in unified diff for `origLines` + * @param newName file name to be used in unified diff for `newLines` + * @return the unified diff of the `origLines` and `newLines` or the empty string if they're equal + */ + def compareContents(original: Seq[String], revised: Seq[String], originalName: String = "a", revisedName: String = "b"): String = { + import scala.collection.JavaConverters._ + + val diff = difflib.DiffUtils.diff(original.asJava, revised.asJava) + if (diff.getDeltas.isEmpty) "" + else difflib.DiffUtils.generateUnifiedDiff(originalName, revisedName, original.asJava, diff, 1).asScala.mkString("\n") + } + + def withTempFile[A](outFile: File, fileBase: String, lines: Seq[String])(body: File => A): A = { + val prefix = s"tmp-$fileBase" + val suffix = ".check" + val f = File.createTempFile(prefix, suffix, outFile) + try { + import scala.reflect.io.{ File => Feil } + Feil(f).writeAll(lines map (line => f"$line%n"): _*) + body(f) + } finally { + f.delete() + } + } +} + +class FileManager(val testClassLoader: URLClassLoader) { + lazy val libraryUnderTest: Path = findArtifact("library") + lazy val reflectUnderTest: Path = findArtifact("reflect") + lazy val compilerUnderTest: Path = findArtifact("compiler") + lazy val agentLib: Path = findArtifact("javaagent") + + lazy val testClassPath = testClassLoader.getURLs().map(url => Path(new File(url.toURI))).toList + + def this(testClassPath: List[Path]) = + this(new URLClassLoader(testClassPath.toArray map (_.toURI.toURL))) + + def distKind = { + val p = libraryUnderTest.getAbsolutePath + if (p endsWith "build/quick/classes/library") "quick" + else if (p endsWith "build/pack/lib/scala-library.jar") "pack" + else if (p endsWith "dists/latest/lib/scala-library.jar") "latest" + else "installed" + } + + // find library/reflect/compiler/javaagent jar or subdir under build/$stage/classes/ + private def findArtifact(name: String): Path = { + val canaryClass = + name match { + case "library" => Class.forName("scala.Unit", false, testClassLoader) + case "reflect" => Class.forName("scala.reflect.api.Symbols", false, testClassLoader) + case "compiler" => Class.forName("scala.tools.nsc.Main", false, testClassLoader) + case "javaagent" => Class.forName("scala.tools.partest.javaagent.ProfilingAgent", false, testClassLoader) + } + + val path = Path(canaryClass.getProtectionDomain.getCodeSource.getLocation.getPath) + if (path.extension == "jar" + || path.absolutePathSegments.endsWith(Seq("classes", name))) path + else sys.error( + s"""Test Classloader does not contain a $name jar or classes/$name directory. + |Looked in: $testClassPath""") + } +} diff --git a/src/partest/scala/tools/partest/nest/PathSettings.scala b/src/partest/scala/tools/partest/nest/PathSettings.scala new file mode 100644 index 000000000000..31f4cd84ee83 --- /dev/null +++ b/src/partest/scala/tools/partest/nest/PathSettings.scala @@ -0,0 +1,46 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest +package nest + +import scala.tools.nsc.io.{Directory, File} +import scala.tools.nsc.Properties.propOrNone + +/** Get current value for path settings. + * Default values are read from system properties `partest.srcdir` and `partest.root`. + */ +class PathSettings(testSourcePath: String) { + + // defaults can be set using the environment + private[this] val defaultTestRootName = propOrNone("partest.root") + + private[this] def cwd = Directory.Current getOrElse sys.error("user.dir property not set") + private[this] def isPartestDir(d: Directory) = (d.name == "test") && ((d / testSourcePath).isDirectory) + private[this] def findJar(name: String, ds: Directory*): Either[String, File] = + ds.iterator flatMap (_.files) filter (_ hasExtension "jar") find ( _.name startsWith name ) map (Right(_)) getOrElse + Left(s"'${name}.jar' not found in '${ds map (_.path) mkString ", "}'.") + + // Directory /test + val testRoot: Directory = (defaultTestRootName map (Directory(_))) getOrElse { + val candidates: List[Directory] = (cwd :: cwd.parents) flatMap (d => List(d, Directory(d / "test"))) + + candidates find isPartestDir getOrElse sys.error("Directory 'test' not found.") + } + val testParent = testRoot.parent + + // Directory /test/files or .../scaladoc + val srcDir = Directory((testRoot / testSourcePath).toCanonical) + + def srcSpecLib = findJar("instrumented", Directory(srcDir / "speclib")) + def srcCodeLib = findJar("code", Directory(srcDir / "codelib"), Directory(testRoot / "files" / "codelib") /* work with --srcpath pending */) +} diff --git a/src/partest/scala/tools/partest/nest/Runner.scala b/src/partest/scala/tools/partest/nest/Runner.scala new file mode 100644 index 000000000000..8b295b8def4d --- /dev/null +++ b/src/partest/scala/tools/partest/nest/Runner.scala @@ -0,0 +1,770 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest +package nest + +import java.io.{Console => _, _} +import java.lang.reflect.InvocationTargetException +import java.nio.charset.Charset +import java.nio.file.{Files, StandardOpenOption} + +import scala.collection.mutable.ListBuffer +import scala.concurrent.duration.Duration +import scala.reflect.internal.FatalError +import scala.reflect.internal.util.ScalaClassLoader +import scala.sys.process.{Process, ProcessLogger} +import scala.tools.nsc.Properties.{isWin, propOrEmpty} +import scala.tools.nsc.{CompilerCommand, Global, Settings} +import scala.tools.nsc.reporters.ConsoleReporter +import scala.tools.nsc.util.stackTraceString +import ClassPath.join +import TestState.{Crash, Fail, Pass, Skip, Updated} +import FileManager.{compareContents, joinPaths, withTempFile} +import scala.reflect.internal.util.ScalaClassLoader.URLClassLoader +import scala.util.{Failure, Success, Try} +import scala.util.control.ControlThrowable + +/** pos/t1234.scala or pos/t1234 if dir */ +case class TestInfo(testFile: File) { + /** pos/t1234 */ + val testIdent: String = testFile.testIdent + + /** pos */ + val kind: String = parentFile.getName + + // inputs + + /** pos/t1234.check */ + val checkFile: File = testFile.changeExtension("check") + + /** pos/t1234.flags */ + def flagsFile: File = testFile.changeExtension("flags") + + // outputs + + /** pos/t1234-pos.log */ + val logFile: File = new File(parentFile, s"$fileBase-$kind.log") + + /** pos/t1234-pos.obj */ + val outFile: File = logFile.changeExtension("obj") + + // enclosing dir + def parentFile: File = testFile.getParentFile + + // test file name without extension + def fileBase: String = basename(testFile.getName) +} + +/** Run a single test. */ +class Runner(val testInfo: TestInfo, val suiteRunner: AbstractRunner) { + private val stopwatch = new Stopwatch() + + import testInfo._ + import suiteRunner.{fileManager => fm, _} + val fileManager = fm + + import fileManager._ + + private val _transcript = new TestTranscript + + def pushTranscript(msg: String) = _transcript.add(msg) + + lazy val outDir = { outFile.mkdirs() ; outFile } + + def showCrashInfo(t: Throwable): Unit = { + System.err.println(s"Crashed running test $testIdent: " + t) + if (!suiteRunner.terse) + System.err.println(stackTraceString(t)) + } + protected def crashHandler: PartialFunction[Throwable, TestState] = { + case t: InterruptedException => + genTimeout() + case t: Throwable => + showCrashInfo(t) + logFile.appendAll(stackTraceString(t)) + genCrash(t) + } + + def genPass(): TestState = Pass(testFile) + def genFail(reason: String) = Fail(testFile, reason, transcript.toArray) + def genResult(b: Boolean) = if (b) genPass() else genFail("predicate failed") + def genSkip(reason: String) = Skip(testFile, reason) + def genTimeout() = Fail(testFile, "timed out", transcript.toArray) + def genCrash(caught: Throwable) = Crash(testFile, caught, transcript.toArray) + def genUpdated() = Updated(testFile) + + private def workerError(msg: String): Unit = System.err.println("Error: " + msg) + + def javac(files: List[File]): TestState = { + // compile using command-line javac compiler + val args = Seq( + javacCmdPath, + "-d", + outDir.getAbsolutePath, + "-classpath", + joinPaths(outDir :: testClassPath), + "-J-Duser.language=en", + "-J-Duser.country=US" + ) ++ (toolArgsFor(files)("javac") + ) ++ (files.map(_.getAbsolutePath) + ) + + pushTranscript(args mkString " ") + if (runCommand(args, logFile)) genPass() else { + genFail("java compilation failed") + } + } + + /** Evaluate an action body and judge whether it passed. */ + def nextTestAction[T](body: => T)(eval: PartialFunction[T, TestState]): TestState = eval.applyOrElse(body, (_: T) => genPass) + /** If the action does not result in true, fail the action. */ + def nextTestActionExpectTrue(reason: String, body: => Boolean): TestState = nextTestAction(body) { case false => genFail(reason) } + /** Fail the action. */ + def nextTestActionFailing(reason: String): TestState = nextTestActionExpectTrue(reason, false) + + private def assembleTestCommand(outDir: File, logFile: File): List[String] = { + // check whether there is a ".javaopts" file + val argsFile = testFile changeExtension "javaopts" + val javaopts = readOptionsFile(argsFile) + if (javaopts.nonEmpty) + suiteRunner.verbose(s"Found javaopts file '$argsFile', using options: '${javaopts.mkString(",")}'") + + // Note! As this currently functions, suiteRunner.javaOpts must precede argString + // because when an option is repeated to java only the last one wins. + // That means until now all the .javaopts files were being ignored because + // they all attempt to change options which are also defined in + // partest.java_opts, leading to debug output like: + // + // debug: Found javaopts file 'files/shootout/message.scala-2.javaopts', using options: '-Xss32k' + // debug: java -Xss32k -Xss2m -Xms256M -Xmx1024M -classpath [...] + val propertyOpts = propertyOptions(fork = true).map { case (k, v) => s"-D$k=$v" } + + val classpath = joinPaths(extraClasspath ++ testClassPath) + + javaCmdPath +: ( + (suiteRunner.javaOpts.split(' ') ++ extraJavaOptions ++ javaopts).filter(_ != "").toList ++ Seq( + "-classpath", + join(outDir.toString, classpath) + ) ++ propertyOpts ++ Seq( + "scala.tools.nsc.MainGenericRunner", + "-usejavacp", + "Test", + "jvm" + ) + ) + } + + def propertyOptions(fork: Boolean): List[(String, String)] = { + val testFullPath = testFile.getAbsolutePath + val extras = if (suiteRunner.debug) List("partest.debug" -> "true") else Nil + val immutablePropsToCheck = List[(String, String)]( + "file.encoding" -> "UTF-8", + "user.language" -> "en", + "user.country" -> "US" + ) + val immutablePropsForkOnly = List[(String, String)]( + "java.library.path" -> logFile.getParentFile.getAbsolutePath, + ) + val shared = List( + "partest.output" -> ("" + outDir.getAbsolutePath), + "partest.lib" -> ("" + libraryUnderTest.jfile.getAbsolutePath), + "partest.reflect" -> ("" + reflectUnderTest.jfile.getAbsolutePath), + "partest.comp" -> ("" + compilerUnderTest.jfile.getAbsolutePath), + "partest.cwd" -> ("" + outDir.getParent), + "partest.test-path" -> ("" + testFullPath), + "partest.testname" -> ("" + fileBase), + "javacmd" -> ("" + javaCmdPath), + "javaccmd" -> ("" + javacCmdPath), + ) ++ extras + if (fork) { + immutablePropsToCheck ++ immutablePropsForkOnly ++ shared + } else { + for ((k, requiredValue) <- immutablePropsToCheck) { + val actual = System.getProperty(k) + assert(actual == requiredValue, s"Unable to run test without forking as the current JVM has an incorrect system property. For $k, found $actual, required $requiredValue") + } + shared + } + } + + /** Runs command redirecting standard out and + * error out to output file. + */ + protected def runCommand(args: Seq[String], outFile: File): Boolean = { + val nonzero = 17 // rounding down from 17.3 + //(Process(args) #> outFile !) == 0 or (Process(args) ! pl) == 0 + val pl = ProcessLogger(outFile) + def run: Int = { + val p = + Try(Process(args).run(pl)) match { + case Failure(e) => outFile.appendAll(stackTraceString(e)) ; return -1 + case Success(v) => v + } + try p.exitValue + catch { + case e: InterruptedException => + suiteRunner.verbose(s"Interrupted waiting for command to finish (${args mkString " "})") + p.destroy + nonzero + case t: Throwable => + suiteRunner.verbose(s"Exception waiting for command to finish: $t (${args mkString " "})") + p.destroy + throw t + } + } + try pl.buffer(run) == 0 + finally pl.close() + } + + private def execTest(outDir: File, logFile: File): TestState = { + val cmd = assembleTestCommand(outDir, logFile) + + pushTranscript((cmd mkString s" \\$EOL ") + " > " + logFile.getName) + nextTestAction(runCommand(cmd, logFile)) { + case false => + _transcript append EOL + logFile.fileContents + genFail("non-zero exit code") + } + } + + def execTestInProcess(classesDir: File, log: File): TestState = { + stopwatch.pause() + suiteRunner.synchronized { + stopwatch.start() + def run(): Unit = { + StreamCapture.withExtraProperties(propertyOptions(fork = false).toMap) { + try { + val out = Files.newOutputStream(log.toPath, StandardOpenOption.APPEND) + try { + val loader = new URLClassLoader(classesDir.toURI.toURL :: Nil, getClass.getClassLoader) + StreamCapture.capturingOutErr(out) { + val cls = loader.loadClass("Test") + val main = cls.getDeclaredMethod("main", classOf[Array[String]]) + try { + main.invoke(null, Array[String]("jvm")) + } catch { + case ite: InvocationTargetException => throw ite.getCause + } + } + } finally { + out.close() + } + } catch { + case t: ControlThrowable => throw t + case t: Throwable => + // We'll let the checkfile diffing report this failure + Files.write(log.toPath, stackTraceString(t).getBytes(Charset.defaultCharset()), StandardOpenOption.APPEND) + } + } + } + + pushTranscript(s" > ${logFile.getName}") + + TrapExit(() => run()) match { + case Left((status, throwable)) if status != 0 => + genFail("non-zero exit code") + case _ => + genPass + } + } + } + + override def toString = s"Test($testIdent)" + + def fail(what: Any) = { + suiteRunner.verbose("scalac: compilation of "+what+" failed\n") + false + } + + /** Filter the check file for conditional blocks. + * The check file can contain lines of the form: + * `#partest java7` + * where the line contains a conventional flag name. + * If the flag tests true, succeeding lines are retained + * (removed on false) until the next #partest flag. + * A missing flag evaluates the same as true. + */ + def filteredCheck: Seq[String] = { + import scala.util.Properties.{javaSpecVersion, isAvian} + import scala.tools.nsc.settings.ScalaVersion + // use lines in block with this label? + def retainOn(expr0: String) = { + val expr = expr0.trim + def flagWasSet(f: String) = { + val allArgs = suiteRunner.scalacExtraArgs ++ suiteRunner.scalacOpts.split(' ') + allArgs contains f + } + val (invert, token) = if (expr startsWith "!") (true, expr drop 1) else (false, expr) + val javaN = raw"java(\d+)(\+)?".r + val cond = token.trim match { + case javaN(v, up) => + val required = ScalaVersion(if (v.toInt <= 8) s"1.$v" else v) + val current = ScalaVersion(javaSpecVersion) + if (up != null) current >= required else current == required + case "avian" => isAvian + case "true" => true + case "-optimise" | "-optimize" + => flagWasSet("-optimise") || flagWasSet("-optimize") + case flag if flag startsWith "-" + => flagWasSet(flag) + case rest => rest.isEmpty + } + if (invert) !cond else cond + } + val prefix = "#partest" + val b = new ListBuffer[String]() + var on = true + for (line <- checkFile.fileContents.linesIfNonEmpty) { + if (line startsWith prefix) { + on = retainOn(line stripPrefix prefix) + } else if (on) { + b += line + } + } + b.toList + } + + // diff logfile checkfile + def currentDiff = { + val logged = logFile.fileContents.linesIfNonEmpty.toList + val (checked, checkname) = if (checkFile.canRead) (filteredCheck, checkFile.getName) else (Nil, "empty") + compareContents(original = checked, revised = logged, originalName = checkname, revisedName = logFile.getName) + } + + val gitRunner = List("/usr/local/bin/git", "/usr/bin/git") map (f => new java.io.File(f)) find (_.canRead) + val gitDiffOptions = "--ignore-space-at-eol --no-index " + propOrEmpty("partest.git_diff_options") + // --color=always --word-diff + + def gitDiff(f1: File, f2: File): Option[String] = { + try gitRunner map { git => + val cmd = s"$git diff $gitDiffOptions $f1 $f2" + val diff = Process(cmd).lineStream_!.drop(4).map(_ + "\n").mkString + + "\n" + diff + } + catch { case t: Exception => None } + } + + /** Normalize the log output by applying test-specific filters + * and fixing filesystem-specific paths. + * + * Line filters are picked up from `filter: pattern` at the top of sources. + * The filtered line is detected with a simple "contains" test, + * and yes, "filter" means "filter out" in this context. + * + * File paths are detected using the absolute path of the test root. + * A string that looks like a file path is normalized by replacing + * the leading segments (the root) with "\$ROOT" and by replacing + * any Windows backslashes with the one true file separator char. + */ + def normalizeLog(): Unit = { + import scala.util.matching.Regex + + // Apply judiciously; there are line comments in the "stub implementations" error output. + val slashes = """[/\\]+""".r + def squashSlashes(s: String) = slashes.replaceAllIn(s, "/") + + // this string identifies a path and is also snipped from log output. + val elided = parentFile.getAbsolutePath + + // something to mark the elision in the log file (disabled) + val ellipsis = "" //".../" // using * looks like a comment + + // no spaces in test file paths below root, because otherwise how to detect end of path string? + val pathFinder = raw"""(?i)\Q${elided}${File.separator}\E([\${File.separator}\S]*)""".r + def canonicalize(s: String): String = + pathFinder.replaceAllIn(s, m => Regex.quoteReplacement(ellipsis + squashSlashes(m group 1))) + + def masters = { + val files = List(new File(parentFile, "filters"), new File(suiteRunner.pathSettings.srcDir.path, "filters")) + files.filter(_.exists).flatMap(_.fileLines).map(_.trim).filter(s => !(s startsWith "#")) + } + val filters = toolArgs("filter", split = false) ++ masters + val elisions = ListBuffer[String]() + //def lineFilter(s: String): Boolean = !(filters exists (s contains _)) + def lineFilter(s: String): Boolean = ( + filters map (_.r) forall { r => + val res = (r findFirstIn s).isEmpty + if (!res) elisions += s + res + } + ) + + logFile.mapInPlace(canonicalize)(lineFilter) + if (suiteRunner.verbose && elisions.nonEmpty) { + import suiteRunner.log._ + val emdash = bold(yellow("--")) + pushTranscript(s"filtering ${logFile.getName}$EOL${elisions.mkString(emdash, EOL + emdash, EOL)}") + } + } + + def diffIsOk: TestState = { + // always normalize the log first + normalizeLog() + pushTranscript(s"diff $checkFile $logFile") + currentDiff match { + case "" => genPass + case diff if config.optUpdateCheck => + suiteRunner.verbose("Updating checkfile " + checkFile) + checkFile.writeAll(logFile.fileContents) + genUpdated() + case diff => + // Get a word-highlighted diff from git if we can find it + val bestDiff = + if (!checkFile.canRead) diff + else + gitRunner.flatMap(_ => withTempFile(outFile, fileBase, filteredCheck)(f => + gitDiff(f, logFile))).getOrElse(diff) + _transcript append bestDiff + genFail("output differs") + } + } + + /** 1. Creates log file and output directory. + * 2. Runs script function, providing log file and output directory as arguments. + * 2b. or, just run the script without context and return a new context + */ + def runInContext(body: => TestState): TestState = { + body + } + + /** Grouped files in group order, and lex order within each group. */ + def groupedFiles(sources: List[File]): List[List[File]] = ( + if (sources.tail.nonEmpty) { + val grouped = sources groupBy (_.group) + grouped.keys.toList.sorted map (k => grouped(k) sortBy (_.getName)) + } + else List(sources) + ) + + /** Source files for the given test file. */ + def sources(file: File): List[File] = if (file.isDirectory) file.listFiles.toList.filter(_.isJavaOrScala) else List(file) + + def newCompiler = new DirectCompiler(this) + + def attemptCompile(sources: List[File]): TestState = { + // TODO: Deferred until 2.12.x is ready to lose its flags files, & possibly flags file support entirely + //val badflags = (testFile :: (if (testFile.isDirectory) sources else Nil)).map(_.changeExtension("flags")).find(_.exists) + //if (badflags.isDefined) genFail(s"unexpected flags file ${badflags.get} (use source comment // scalac: -Wfatal-warnings)") + //else { + val state = newCompiler.compile(flagsForCompilation(sources), sources) + if (!state.isOk) + _transcript.append("\n" + logFile.fileContents) + + state + //} + } + + // all sources in a round may contribute flags via .flags files or // scalac: -flags + def flagsForCompilation(sources: List[File]): List[String] = { + val perTest = readOptionsFile(flagsFile) + val perGroup = if (testFile.isDirectory) { + sources.flatMap(f => readOptionsFile(f.changeExtension("flags"))) + } else Nil + val perFile = toolArgsFor(sources)("scalac") + perTest ++ perGroup ++ perFile + } + + // inspect sources for tool args + def toolArgs(tool: String, split: Boolean = true): List[String] = + toolArgsFor(sources(testFile))(tool, split) + + // inspect given files for tool args of the form `tool: args` + // if args string ends in close comment, drop the `*` `/` + // if split, parse the args string as command line. + // + def toolArgsFor(files: List[File])(tool: String, split: Boolean = true): List[String] = { + def argsFor(f: File): List[String] = { + import scala.tools.cmd.CommandLineParser.tokenize + val max = 10 + val tag = s"$tool:" + val endc = "*" + "/" // be forgiving of /* scalac: ... */ + def stripped(s: String) = s.substring(s.indexOf(tag) + tag.length).stripSuffix(endc) + def argsplitter(s: String): List[String] = if (split) tokenize(s) else List(s.trim()) + val src = Files.lines(f.toPath, codec.charSet) + val args: Option[String] = try { + val x: java.util.stream.Stream[String] = src.limit(max).filter(_.contains(tag)).map(stripped) + val s = x.findAny.orElse("") + if (s == "") None else Some(s) + } finally src.close() + args.map((arg: String) => argsplitter(arg)).getOrElse(Nil) + } + files.flatMap(argsFor) + } + + abstract class CompileRound { + def fs: List[File] + def result: TestState + def description: String + + def fsString = fs map (_.toString stripPrefix parentFile.toString + "/") mkString " " + def isOk = result.isOk + def mkScalacString(): String = s"""scalac $fsString""" + override def toString = description + ( if (result.isOk) "" else "\n" + result.status ) + } + case class OnlyJava(fs: List[File]) extends CompileRound { + def description = s"""javac $fsString""" + lazy val result = { pushTranscript(description) ; javac(fs) } + } + case class OnlyScala(fs: List[File]) extends CompileRound { + def description = mkScalacString() + lazy val result = { pushTranscript(description) ; attemptCompile(fs) } + } + case class ScalaAndJava(fs: List[File]) extends CompileRound { + def description = mkScalacString() + lazy val result = { pushTranscript(description) ; attemptCompile(fs) } + } + + def compilationRounds(file: File): List[CompileRound] = + groupedFiles(sources(file)).map(mixedCompileGroup).flatten + def mixedCompileGroup(allFiles: List[File]): List[CompileRound] = { + val (scalaFiles, javaFiles) = allFiles partition (_.isScala) + val round1 = if (scalaFiles.isEmpty) None else Some(ScalaAndJava(allFiles)) + val round2 = if (javaFiles.isEmpty) None else Some(OnlyJava(javaFiles)) + + List(round1, round2).flatten + } + + def runPosTest(): TestState = + // TODO: Deferred until cleanup has happened + //if (checkFile.exists) genFail("unexpected check file for pos test (use -Xfatal-warnings with neg test to verify warnings)") + //else runTestCommon() + runTestCommon() + + def runNegTest(): TestState = runInContext { + // pass if it checks and didn't crash the compiler + // or, OK, we'll let you crash the compiler with a FatalError if you supply a check file + def checked(r: CompileRound) = r.result match { + case crash @ Crash(_, t, _) if !checkFile.canRead || !t.isInstanceOf[FatalError] => crash + case dnc @ _ => diffIsOk + } + + compilationRounds(testFile).find(!_.result.isOk).map(checked).getOrElse(genFail("expected compilation failure")) + } + + // run compilation until failure, evaluate `andAlso` on success + def runTestCommon(andAlso: => TestState = genPass): TestState = runInContext { + // DirectCompiler already says compilation failed + val res = compilationRounds(testFile).find(!_.result.isOk).map(_.result).getOrElse(genPass) + res andAlso andAlso + } + + def extraClasspath = kind match { + case "specialized" => List(suiteRunner.pathSettings.srcSpecLib.fold(sys.error, identity)) + case _ => Nil + } + def extraJavaOptions = kind match { + case "instrumented" => ("-javaagent:"+agentLib).split(' ') + case _ => Array.empty[String] + } + + def runResidentTest(): TestState = { + // simulate resident compiler loop + val prompt = "\nnsc> " + + suiteRunner.verbose(s"$this running test $fileBase") + val dir = parentFile + val resFile = new File(dir, fileBase + ".res") + + // run compiler in resident mode + // $SCALAC -d "$os_dstbase".obj -Xresident -sourcepath . "$@" + val sourcedir = logFile.getParentFile.getAbsoluteFile + val sourcepath = sourcedir.getAbsolutePath+File.separator + suiteRunner.verbose("sourcepath: "+sourcepath) + + val argList = List( + "-d", outDir.getAbsoluteFile.getPath, + "-Xresident", + "-sourcepath", sourcepath) + + // configure input/output files + val logOut = new FileOutputStream(logFile) + val logWriter = new PrintStream(logOut, true) + val resReader = new BufferedReader(new FileReader(resFile)) + val logConsoleWriter = new PrintWriter(new OutputStreamWriter(logOut), true) + + // create compiler + val settings = new Settings(workerError) + settings.sourcepath.value = sourcepath + settings.classpath.value = joinPaths(fileManager.testClassPath) + val reporter = new ConsoleReporter(settings, scala.Console.in, logConsoleWriter) + val command = new CompilerCommand(argList, settings) + object compiler extends Global(command.settings, reporter) + + def resCompile(line: String): TestState = { + // suiteRunner.verbose("compiling "+line) + val cmdArgs = (line split ' ').toList map (fs => new File(dir, fs).getAbsolutePath) + // suiteRunner.verbose("cmdArgs: "+cmdArgs) + val sett = new Settings(workerError) + sett.sourcepath.value = sourcepath + val command = new CompilerCommand(cmdArgs, sett) + // "scalac " + command.files.mkString(" ") + pushTranscript("scalac " + command.files.mkString(" ")) + nextTestActionExpectTrue( + "compilation failed", + command.ok && { + (new compiler.Run) compile command.files + !reporter.hasErrors + } + ) + } + def loop(): TestState = { + logWriter.print(prompt) + resReader.readLine() match { + case null | "" => logWriter.close() ; genPass + case line => resCompile(line) andAlso loop() + } + } + // res/t687.res depends on ignoring its compilation failure + // and just looking at the diff, so I made them all do that + // because this is long enough. + /*val res =*/ Output.withRedirected(logWriter)(try loop() finally resReader.close()) + + /*res andAlso*/ diffIsOk + } + + def run(): (TestState, Long) = { + // javac runner, for one, would merely append to an existing log file, so just delete it before we start + logFile.delete() + stopwatch.start() + + val state = kind match { + case "pos" => runPosTest() + case "neg" => runNegTest() + case "res" => runResidentTest() + case "scalap" => runScalapTest() + case "script" => runScriptTest() + case k if k.endsWith("-neg") => runNegTest() + case _ => runRunTest() + } + (state, stopwatch.stop) + } + + private def runRunTest(): TestState = { + val argsFile = testFile changeExtension "javaopts" + val javaopts = readOptionsFile(argsFile) + val execInProcess = PartestDefaults.execInProcess && javaopts.isEmpty && !Set("specialized", "instrumented").contains(testFile.getParentFile.getName) + def exec() = if (execInProcess) execTestInProcess(outDir, logFile) else execTest(outDir, logFile) + def noexec() = genSkip("no-exec: tests compiled but not run") + runTestCommon(if (suiteRunner.config.optNoExec) noexec() else exec().andAlso(diffIsOk)) + } + + private def decompileClass(clazz: Class[_], isPackageObject: Boolean): String = { + import scala.tools.scalap + import scalap.scalax.rules.scalasig.ByteCode + + scalap.Main.decompileScala(ByteCode.forClass(clazz).bytes, isPackageObject) + } + + def runScalapTest(): TestState = runTestCommon { + val isPackageObject = testFile.getName startsWith "package" + val className = testFile.getName.stripSuffix(".scala").capitalize + (if (!isPackageObject) "" else ".package") + val loader = ScalaClassLoader.fromURLs(List(outDir.toURI.toURL), this.getClass.getClassLoader) + logFile writeAll decompileClass(loader loadClass className, isPackageObject) + diffIsOk + } + + def runScriptTest(): TestState = { + import scala.sys.process._ + + val args: String = testFile.changeExtension("args").fileContents + val cmdFile = if (isWin) testFile changeExtension "bat" else testFile + val succeeded = (((s"$cmdFile $args" #> logFile).!) == 0) + + val result = if (succeeded) genPass else genFail(s"script $cmdFile failed to run") + + result andAlso diffIsOk + } + + def cleanup(state: TestState): Unit = { + if (state.isOk) logFile.delete() + if (!suiteRunner.debug) Directory(outDir).deleteRecursively() + } + + // Colorize prompts according to pass/fail + def transcript: List[String] = { + import suiteRunner.log._ + def pass(s: String) = bold(green("% ")) + s + def fail(s: String) = bold(red("% ")) + s + _transcript.toList match { + case Nil => Nil + case xs => (xs.init map pass) :+ fail(xs.last) + } + } +} + +/** Loads `library.properties` from the jar. */ +object Properties extends scala.util.PropertiesTrait { + protected def propCategory = "partest" + protected def pickJarBasedOn = classOf[AbstractRunner] +} + +case class TimeoutException(duration: Duration) extends RuntimeException + +class LogContext(val file: File, val writers: Option[(StringWriter, PrintWriter)]) + +object LogContext { + def apply(file: File, swr: StringWriter, wr: PrintWriter): LogContext = { + require (file != null) + new LogContext(file, Some((swr, wr))) + } + def apply(file: File): LogContext = new LogContext(file, None) +} + +object Output { + object outRedirect extends Redirecter(out) + object errRedirect extends Redirecter(err) + + System.setOut(outRedirect) + System.setErr(errRedirect) + + import scala.util.DynamicVariable + private def out = java.lang.System.out + private def err = java.lang.System.err + private val redirVar = new DynamicVariable[Option[PrintStream]](None) + + class Redirecter(stream: PrintStream) extends PrintStream(new OutputStream { + def write(b: Int) = withStream(_ write b) + + private def withStream(f: PrintStream => Unit) = f(redirVar.value getOrElse stream) + + override def write(b: Array[Byte]) = withStream(_ write b) + override def write(b: Array[Byte], off: Int, len: Int) = withStream(_.write(b, off, len)) + override def flush = withStream(_.flush) + override def close = withStream(_.close) + }) + + // this supports thread-safe nested output redirects + def withRedirected[T](newstream: PrintStream)(func: => T): T = { + // note down old redirect destination + // this may be None in which case outRedirect and errRedirect print to stdout and stderr + val saved = redirVar.value + // set new redirecter + // this one will redirect both out and err to newstream + redirVar.value = Some(newstream) + + try func + finally { + newstream.flush() + redirVar.value = saved + } + } +} + +final class TestTranscript { + private[this] val buf = ListBuffer[String]() + + def add(action: String): this.type = { buf += action ; this } + def append(text: String): Unit = { val s = buf.last ; buf.trimEnd(1) ; buf += (s + text) } + def toList = buf.toList +} diff --git a/src/partest/scala/tools/partest/nest/RunnerSpec.scala b/src/partest/scala/tools/partest/nest/RunnerSpec.scala new file mode 100644 index 000000000000..cbd420664545 --- /dev/null +++ b/src/partest/scala/tools/partest/nest/RunnerSpec.scala @@ -0,0 +1,72 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest.nest + +import language.postfixOps + +import scala.tools.cmd.{ CommandLine, Interpolation, Meta, Reference, Spec, Instance } + +trait RunnerSpec extends Spec with Meta.StdOpts with Interpolation { + def referenceSpec = RunnerSpec + def programInfo = Spec.Info( + "console-runner", + "Usage: ConsoleRunner [options] [test test ...]", + "scala.tools.partest.nest.ConsoleRunner") + + heading("Test categories:") + val optPos = "pos" / "run compilation tests (success)" --? + val optNeg = "neg" / "run compilation tests (failure)" --? + val optRun = "run" / "run interpreter and backend tests" --? + val optJvm = "jvm" / "run JVM backend tests" --? + val optRes = "res" / "run resident compiler tests" --? + val optScalap = "scalap" / "run scalap tests" --? + val optSpecialized = "specialized" / "run specialization tests" --? + val optInstrumented = "instrumented" / "run instrumented tests" --? + val optPresentation = "presentation" / "run presentation compiler tests" --? + + heading("Test runner options:") + val optFailed = "failed" / "run only those tests that failed during the last run" --? + val optTimeout = "timeout" / "aborts the test suite after the given amount of time" --| + val optPack = "pack" / "pick compiler/reflect/library in build/pack, and run all tests" --? + val optGrep = "grep" / "run all tests whose source file contains the expression given to grep" --| + val optUpdateCheck = "update-check" / "instead of failing tests with output change, update checkfile (use with care!)" --? + val optNoExec = "no-exec" / "instead of running tests, stop after dry-run compilation" --? + val optBuildPath = "buildpath" / "set (relative) path to build jars (ex.: --buildpath build/pack)" --| + val optClassPath = "classpath" / "set (absolute) path to build classes" --| + val optSourcePath = "srcpath" / "set (relative) path to test source files (ex.: --srcpath pending)" --| + // Compile with a different compiler, not used internally. Used by AxLang, see PR #8407. + // Note: this will be much slower than creating a new global in the same JVM. + // Note: run tests will still use the internal Scala version for running. + val optCompilerPath = "compilerpath" / "set (absolute) path to a different compiler to test (ex.: --compilerpath /usr/local/bin/scalac)" --| + + heading("Test output options:") + val optShowDiff = "show-diff" / "show diffs for failed tests" --? + val optShowLog = "show-log" / "show log files for failed tests" --? + val optVerbose = "verbose" / "show verbose progress information" --? + val optTerse = "terse" / "show terse progress information" --? + val optDebug = "debug" / "enable debugging output, preserve generated files" --? + + heading("Other options:") + val optVersion = "version" / "show Scala version and exit" --? + val optHelp = "help" / "show this page and exit" --? + +} + +object RunnerSpec extends RunnerSpec with Reference { + trait Config extends RunnerSpec with Instance + + type ThisCommandLine = CommandLine + def creator(args: List[String]): ThisCommandLine = new CommandLine(RunnerSpec, args) + + def forArgs(args: Array[String]): Config = new { val parsed = creator(args.toList) } with Config +} diff --git a/src/partest/scala/tools/partest/nest/Stopwatch.scala b/src/partest/scala/tools/partest/nest/Stopwatch.scala new file mode 100644 index 000000000000..9112cc7da9ac --- /dev/null +++ b/src/partest/scala/tools/partest/nest/Stopwatch.scala @@ -0,0 +1,36 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest.nest + +/** + * Measured elapsed time between between calls to `start` and `stop`. + * May be `pause`-ed and re-`started` before `stop` is eventually called. + */ +final class Stopwatch { + private var base: Option[Long] = None + private var elapsed = 0L + def pause(): Unit = { + assert(base.isDefined) + val now = System.nanoTime + elapsed += (now - base.get) + base = None + } + def start(): Unit = { + base = Some(System.nanoTime()) + } + + def stop(): Long = { + pause() + (1.0 * elapsed / 1000 / 1000).toLong + } +} diff --git a/src/partest/scala/tools/partest/nest/StreamCapture.scala b/src/partest/scala/tools/partest/nest/StreamCapture.scala new file mode 100644 index 000000000000..b016f784d143 --- /dev/null +++ b/src/partest/scala/tools/partest/nest/StreamCapture.scala @@ -0,0 +1,73 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest.nest + +import java.io.{Console => _, _} +import java.nio.charset.Charset + +object StreamCapture { + def savingSystem[A](body: => A): A = { + val savedOut = System.out + val savedErr = System.err + try body + finally { + System.setErr(savedErr) + System.setOut(savedOut) + } + } + + /** Set err to out. */ + def redirErr[A](body: => A): A = savingSystem { + System.setOut(System.err) + body + } + + def capturingOutErr[A](output: OutputStream)(body: => A): A = { + val charset = Charset.defaultCharset() + val printStream = new PrintStream(output, /*autoflush=*/true, charset.name()) + savingSystem { + System.setOut(printStream) + System.setErr(printStream) + try { + Console.withErr(printStream) { + Console.withOut(printStream) { + body + } + } + } finally { + printStream.close() + } + } + } + + def withExtraProperties[A](extra: Map[String, String])(action: => A): A = { + val saved = System.getProperties() + val modified = new java.util.Properties() + // on Java 9, we need to cast our way around this: + // src/main/scala/scala/tools/partest/nest/StreamCapture.scala:44: ambiguous reference to overloaded definition, + // both method putAll in class Properties of type (x$1: java.util.Map[_, _])Unit + // and method putAll in class Hashtable of type (x$1: java.util.Map[_ <: Object, _ <: Object])Unit + // match argument types (java.util.Properties) + (modified: java.util.Hashtable[AnyRef, AnyRef]).putAll(saved) + extra.foreach { case (k, v) => modified.setProperty(k, v) } + // Trying to avoid other threads seeing the new properties object prior to the new entries + // https://github.com/scala/scala/pull/6391#issuecomment-371346171 + UnsafeAccess.U.storeFence() + System.setProperties(modified) + try { + action + } finally { + System.setProperties(saved) + } + } +} diff --git a/src/partest/scala/tools/partest/nest/TrapExit.scala b/src/partest/scala/tools/partest/nest/TrapExit.scala new file mode 100644 index 000000000000..8e4e1d7cb50b --- /dev/null +++ b/src/partest/scala/tools/partest/nest/TrapExit.scala @@ -0,0 +1,36 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest.nest + +object TrapExit { + + private class TrapExitThrowable(val status: Int) extends Throwable { + override def getMessage: String = throw this + override def getCause: Throwable = throw this + } + + def apply[A](action: () => A): Either[(Int, Throwable), A] = { + val saved = System.getSecurityManager + System.setSecurityManager(new DelegatingSecurityManager(saved) { + override def checkExit(status: Int): Unit = throw new TrapExitThrowable(status) + }) + try { + Right(action()) + } catch { + case te: TrapExitThrowable => + Left((te.status, te)) + } finally { + System.setSecurityManager(saved) + } + } +} diff --git a/src/partest/scala/tools/partest/nest/UnsafeAccess.java b/src/partest/scala/tools/partest/nest/UnsafeAccess.java new file mode 100644 index 000000000000..dadb6d189ca4 --- /dev/null +++ b/src/partest/scala/tools/partest/nest/UnsafeAccess.java @@ -0,0 +1,42 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest.nest; + +import java.lang.reflect.Field; + +@SuppressWarnings("unsafe") +public class UnsafeAccess { + public final static sun.misc.Unsafe U; + + static { + U = lookupUnsafe(); + } + + private static sun.misc.Unsafe lookupUnsafe() { + try { + sun.misc.Unsafe found = null; + for (Field field : sun.misc.Unsafe.class.getDeclaredFields()) { + if (field.getType() == sun.misc.Unsafe.class) { + field.setAccessible(true); + found = (sun.misc.Unsafe) field.get(null); + break; + } + } + if (found == null) throw new IllegalStateException("Can't find instance of sun.misc.Unsafe"); + else return found; + } catch (Throwable t) { + throw new ExceptionInInitializerError(t); + } + } +} + diff --git a/src/partest/scala/tools/partest/nest/package.scala b/src/partest/scala/tools/partest/nest/package.scala new file mode 100644 index 000000000000..4cf38946b13b --- /dev/null +++ b/src/partest/scala/tools/partest/nest/package.scala @@ -0,0 +1,30 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest + +package object nest { + + def runAndExit(body: => Unit): Nothing = { + body + System.exit(0) + ??? + } + + def toOpt(s: String): String = if (s startsWith "--") s else "--" + s + def fromOpt(s: String): String = s stripPrefix "--" + + def stripQuotes(s: String): String = { + def isQuotedBy(c: Char) = s.length > 0 && s.head == c && s.last == c + if (List('"', '\'') exists isQuotedBy) s.tail.init else s + } +} diff --git a/src/partest/scala/tools/partest/package.scala b/src/partest/scala/tools/partest/package.scala new file mode 100644 index 000000000000..282298fd36ef --- /dev/null +++ b/src/partest/scala/tools/partest/package.scala @@ -0,0 +1,196 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools + +import java.nio.file.Files +import java.util.concurrent.{Callable, ExecutorService} + +import scala.concurrent.duration.Duration +import scala.io.Codec +import scala.collection.JavaConverters._ +import scala.tools.nsc.util.Exceptional + +package object partest { + type File = java.io.File + type SFile = scala.reflect.io.File + type Directory = scala.reflect.io.Directory + type Path = scala.reflect.io.Path + type PathResolver = scala.tools.util.PathResolver + type StringWriter = java.io.StringWriter + + val SFile = scala.reflect.io.File + val Directory = scala.reflect.io.Directory + val Path = scala.reflect.io.Path + val PathResolver = scala.tools.util.PathResolver + val ClassPath = scala.tools.nsc.util.ClassPath + + val space = "\u0020" + val EOL = System.lineSeparator() + def onull(s: String) = if (s == null) "" else s + def oempty(xs: String*) = xs filterNot (x => x == null || x == "") + def ojoin(xs: String*): String = oempty(xs: _*) mkString space + def nljoin(xs: String*): String = oempty(xs: _*) mkString EOL + + implicit val codec: Codec = Codec.UTF8 + + def setUncaughtHandler() = { + Thread.setDefaultUncaughtExceptionHandler( + new Thread.UncaughtExceptionHandler { + def uncaughtException(thread: Thread, t: Throwable): Unit = { + val t1 = Exceptional.unwrap(t) + System.err.println(s"Uncaught exception on thread $thread: $t1") + t1.printStackTrace() + } + } + ) + } + + /** Sources have a numerical group, specified by name_7 and so on. */ + private val GroupPattern = """.*_(\d+)""".r + + implicit class `special string ops`(private val s: String) extends AnyVal { + def linesIfNonEmpty: Iterator[String] = if (!s.isEmpty) s.linesIterator else Iterator.empty + } + + implicit class FileOps(val f: File) { + private def sf = SFile(f) + + // e.g. pos/t1234 + def withEnclosing: String = f.toPath.iterator.asScala.toList.takeRight(2).mkString("/") + def testIdent = withEnclosing + + def mapInPlace(mapFn: String => String)(filterFn: String => Boolean = _ => true): Unit = + writeAll(fileLines filter filterFn map (x => mapFn(x) + EOL): _*) + + def appendAll(strings: String*): Unit = sf.appendAll(strings: _*) + def writeAll(strings: String*): Unit = sf.writeAll(strings: _*) + def absolutePathSegments: List[String] = f.getAbsolutePath.split("""[/\\]+""").toList + + def isJava = f.isFile && (sf hasExtension "java") + def isScala = f.isFile && (sf hasExtension "scala") + def isJavaOrScala = isJava || isScala + + def extension = sf.extension + def hasExtension(ext: String) = sf hasExtension ext + def changeExtension(ext: String): File = (sf changeExtension ext).jfile + + /** The group number for this source file, or -1 for no group. */ + def group: Int = + sf.stripExtension match { + case GroupPattern(g) if g.toInt >= 0 => g.toInt + case _ => -1 + } + + // Files.readString on jdk 11 + def fileContents: String = if (Files.isReadable(f.toPath)) try sf.slurp() catch { case _: java.io.FileNotFoundException => "" } else "" + def fileLines: List[String] = if (Files.isReadable(f.toPath)) Files.readAllLines(f.toPath).asScala.toList else Nil + } + + implicit class PathOps(p: Path) extends FileOps(p.jfile) + + implicit class Copier(val f: SFile) extends AnyVal { + def copyTo(dest: Path): Unit = dest.toFile writeAll f.slurp(Codec.UTF8) + } + + implicit class LoaderOps(val loader: ClassLoader) extends AnyVal { + import scala.util.control.Exception.catching + /** Like ScalaClassLoader.create for the case where the result type is + * available to the current class loader, implying that the current + * loader is a parent of `loader`. + */ + def instantiate[A >: Null](name: String): A = ( + catching(classOf[ClassNotFoundException], classOf[SecurityException]) opt + loader.loadClass(name).getConstructor().newInstance().asInstanceOf[A] + ).orNull + } + + implicit class ExecutorOps(val executor: ExecutorService) { + def awaitTermination[A](wait: Duration)(failing: => A = ()): Option[A] = + if (executor.awaitTermination(wait.length, wait.unit)) None + else Some(failing) + } + + implicit def temporaryPath2File(x: Path): File = x.jfile + implicit def stringPathToJavaFile(path: String): File = new File(path) + + implicit lazy val implicitConversions = scala.language.implicitConversions + + def fileSeparator = java.io.File.separator + def pathSeparator = java.io.File.pathSeparator + + def words(s: String): List[String] = (s.trim split "\\s+").toList + + def timed[T](body: => T): (T, Long) = { + val t1 = System.currentTimeMillis + val result = body + val t2 = System.currentTimeMillis + + (result, t2 - t1) + } + + def callable[T](body: => T): Callable[T] = new Callable[T] { override def call() = body } + + def basename(name: String): String = Path(name).stripExtension + + /** In order to allow for spaces in flags/options, this + * parses .flags, .javaopts, javacopts etc files as follows: + * If it is exactly one line, it is split (naively) on spaces. + * If it contains more than one line, each line is its own + * token, spaces and all. + */ + def readOptionsFile(file: File): List[String] = + file.fileLines match { + case x :: Nil => words(x) + case xs => xs + } + + def findProgram(name: String): Option[File] = { + val pathDirs = sys.env("PATH") match { + case null => List("/usr/local/bin", "/usr/bin", "/bin") + case path => path.split("[:;]").filterNot(_ == "").toList + } + pathDirs.iterator map (d => new File(d, name)) find (_.canExecute) + } + + def now = (new java.util.Date).toString + def elapsedString(millis: Long): String = { + val elapsedSecs = millis/1000 + val elapsedMins = elapsedSecs/60 + val elapsedHrs = elapsedMins/60 + val dispMins = elapsedMins - elapsedHrs * 60 + val dispSecs = elapsedSecs - elapsedMins * 60 + + "%02d:%02d:%02d".format(elapsedHrs, dispMins, dispSecs) + } + + def vmArgString = { + val javaVmArguments = + java.lang.management.ManagementFactory.getRuntimeMXBean.getInputArguments.asScala.toList + javaVmArguments.mkString( + "Java VM started with arguments: '", + " ", + "'" + ) + } + + def allPropertiesString = { + System.getProperties.asScala.toList.sorted map { case (k, v) => "%s -> %s\n".format(k, v) } mkString "" + } + + def ifJavaAtLeast[A](version: String)(yesRun: => A) = new TestUnderJavaAtLeast(version, { yesRun }) + + /** Debugger interest only below this line **/ + def isDebug = sys.props.contains("partest.debug") || sys.env.contains("PARTEST_DEBUG") + def debugSettings = sys.props.getOrElse("partest.debug.settings", "") + def log(msg: => Any): Unit = if (isDebug) Console.err.println(msg) +} diff --git a/src/partest/scala/tools/partest/sbt/Framework.scala b/src/partest/scala/tools/partest/sbt/Framework.scala new file mode 100644 index 000000000000..ac746780628c --- /dev/null +++ b/src/partest/scala/tools/partest/sbt/Framework.scala @@ -0,0 +1,67 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest.sbt + +import scala.tools.partest.nest.RunnerSpec +import _root_.sbt.testing._ +import java.net.URLClassLoader +import java.io.File + +object Framework { + // as partest is not driven by test classes discovered by sbt, need to add this marker fingerprint to definedTests + val fingerprint = new AnnotatedFingerprint { def isModule = true; def annotationName = "partest" } + + // TODO how can we export `fingerprint` so that a user can just add this to their build.sbt + // definedTests in Test += new sbt.TestDefinition("partest", fingerprint, true, Array()) +} +class Framework extends sbt.testing.Framework { + def fingerprints: Array[Fingerprint] = Array(Framework.fingerprint) + def name: String = "partest" + + def runner(args: Array[String], remoteArgs: Array[String], testClassLoader: ClassLoader): Runner = + new PartestRunner(args, remoteArgs, testClassLoader) +} + +// We don't use sbt's Runner or Task abstractions properly. +// sbt runs a single dummy fingerprint match and partest does everything else internally. +case class PartestRunner(args: Array[String], remoteArgs: Array[String], testClassLoader: ClassLoader) extends Runner { + def tasks(taskDefs: Array[TaskDef]): Array[Task] = taskDefs map (PartestTask(_, args): Task) + def done(): String = "" // no summary +} + +/** Run partest in this VM. Assumes we're running in a forked VM! + */ +case class PartestTask(taskDef: TaskDef, args: Array[String]) extends Task { + /** Executes this task, possibly returning to the client new tasks to execute. */ + def execute(eventHandler: EventHandler, loggers: Array[Logger]): Array[Task] = { + val forkedCp = scala.util.Properties.javaClassPath + val classLoader = new URLClassLoader(forkedCp.split(java.io.File.pathSeparator).map(new File(_).toURI.toURL)) + val config = RunnerSpec.forArgs(args.filter(a => !a.startsWith("-D"))) + val runner = new SBTRunner(config, taskDef.fingerprint(), eventHandler, loggers, "files", classLoader, null, null, Array.empty[String], args) + + if (Runtime.getRuntime().maxMemory() / (1024*1024) < 800) + loggers foreach (_.warn(s"""Low heap size detected (~ ${Runtime.getRuntime().maxMemory() / (1024*1024)}M). Please add the following to your build.sbt: javaOptions in Test += "-Xmx1G"""")) + + try runner.run + catch { + case ex: ClassNotFoundException => + loggers foreach { l => l.error("Please make sure partest is running in a forked VM by including the following line in build.sbt:\nfork in Test := true") } + throw ex + } + + Array() + } + + /** A possibly zero-length array of string tags associated with this task. */ + def tags: Array[String] = Array() +} diff --git a/src/partest/scala/tools/partest/sbt/SBTRunner.scala b/src/partest/scala/tools/partest/sbt/SBTRunner.scala new file mode 100644 index 000000000000..891c51acf88d --- /dev/null +++ b/src/partest/scala/tools/partest/sbt/SBTRunner.scala @@ -0,0 +1,91 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest.sbt + +import java.net.URLClassLoader + +import _root_.sbt.testing._ + +import scala.tools.partest.TestState._ +import scala.tools.partest._ +import scala.tools.partest.nest.{AbstractRunner, FileManager, RunnerSpec} + +class SBTRunner(config: RunnerSpec.Config, + partestFingerprint: Fingerprint, eventHandler: EventHandler, loggers: Array[Logger], + srcDir: String, testClassLoader: URLClassLoader, javaCmd: File, javacCmd: File, + scalacArgs: Array[String], args: Array[String]) extends AbstractRunner( + config, + config.optSourcePath orElse Option(srcDir) getOrElse PartestDefaults.sourcePath, + new FileManager(testClassLoader = testClassLoader) +) { + + // no summary, SBT will do that for us + override protected val printSummary = false + override protected val partestCmd = "partest" + + val defs = { + val Def = "-D([^=]*)=(.*)".r + args.collect { case Def(k, v) => (k, v) } + } + + // Enable colors if there's an explicit override or all loggers support them + override val log = new ConsoleLog({ + val ptOverride = defs.collect { case ("partest.colors", v) => v.toBoolean }.lastOption + ptOverride.getOrElse { + val sbtOverride1 = sys.props.get("sbt.log.format").map(_.toBoolean) + val sbtOverride2 = sys.props.get("sbt.log.noformat").map(s => !s.toBoolean) + sbtOverride1.orElse(sbtOverride2).getOrElse { + loggers.forall(_.ansiCodesSupported()) + } + } + }) + + override val javaOpts = { + val l = defs.collect { case ("partest.java_opts", v) => v } + if(l.isEmpty) PartestDefaults.javaOpts + else l.mkString(" ") + } + + override val scalacOpts = { + val l = defs.collect { case ("partest.scalac_opts", v) => v } + if(l.isEmpty) PartestDefaults.scalacOpts + else l.mkString(" ") + } + + override val javaCmdPath = Option(javaCmd).map(_.getAbsolutePath) getOrElse PartestDefaults.javaCmd + override val javacCmdPath = Option(javacCmd).map(_.getAbsolutePath) getOrElse PartestDefaults.javacCmd + override val scalacExtraArgs = scalacArgs.toIndexedSeq + + override def onFinishTest(testFile: File, result: TestState, durationMs: Long): TestState = { + synchronized { + eventHandler.handle(new Event { + def fullyQualifiedName: String = pathSettings.testRoot.name + "/" + testSourcePath + def fingerprint: Fingerprint = partestFingerprint + def selector: Selector = new TestSelector(testFile.testIdent) + val (status, throwable) = makeStatus(result) + def duration: Long = durationMs + }) + } + result + } + + def makeStatus(t: TestState): (Status, OptionalThrowable) = t match { + case Uninitialized(_) => (Status.Pending, new OptionalThrowable) + case Pass(_) => (Status.Success, new OptionalThrowable) + case Updated(_) => (Status.Success, new OptionalThrowable) + case Skip(_, _) => (Status.Skipped, new OptionalThrowable) + case Fail(_, reason, transcript) => (Status.Failure, new OptionalThrowable(new TestFailedThrowable(reason, transcript.mkString("\n")))) + case Crash(_, e, _) => (Status.Error, new OptionalThrowable(e)) + } +} +class TestFailedThrowable(reason: String, transcript: String) extends Throwable(reason + "\n\n" + transcript) diff --git a/src/partest/scala/tools/partest/utils/Properties.scala b/src/partest/scala/tools/partest/utils/Properties.scala new file mode 100644 index 000000000000..86fc6ec81963 --- /dev/null +++ b/src/partest/scala/tools/partest/utils/Properties.scala @@ -0,0 +1,21 @@ +/* + * Scala (https://www.scala-lang.org) + * + * Copyright EPFL and Lightbend, Inc. + * + * Licensed under Apache License 2.0 + * (http://www.apache.org/licenses/LICENSE-2.0). + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package scala.tools.partest +package utils + +/** Loads scala-partest.properties from the jar. */ +object Properties extends scala.util.PropertiesTrait { + protected def propCategory = "scala-partest" + protected def pickJarBasedOn = classOf[nest.Runner] + override def isAvian = super.isAvian +} diff --git a/test/files/jvm/interpreter.scala b/test/files/jvm/interpreter.scala index c68c064c3100..6e02dca8f06d 100644 --- a/test/files/jvm/interpreter.scala +++ b/test/files/jvm/interpreter.scala @@ -155,5 +155,8 @@ def f(e: Exp) = e match {{ // non-exhaustive warning here interp.interpret("plusOne(5) // should be undefined now") } - appendix() + override def main(args: Array[String]): Unit = { + super.main(args) + appendix() + } } diff --git a/test/files/neg/java-annotation-match-error.check b/test/files/neg/java-annotation-match-error.check deleted file mode 100644 index 69333df48297..000000000000 --- a/test/files/neg/java-annotation-match-error.check +++ /dev/null @@ -1,7 +0,0 @@ -J.java:11: error: identifier expected but `int' found. - int int int // check we get this syntax error - ^ -J.java:12: error: `;' expected but `}' found. -} -^ -two errors found diff --git a/test/files/neg/t11643.scala b/test/files/neg/t11643.scala index a0ec2358743c..aaecf3840b6b 100644 --- a/test/files/neg/t11643.scala +++ b/test/files/neg/t11643.scala @@ -1,5 +1,5 @@ -// scalac: -Werror -Wunused:params +// scalac: -Xfatal-warnings -Ywarn-unused:params trait T { def f(implicit i: Int) = i diff --git a/test/files/neg/t7187-2.13.flags b/test/files/neg/t7187-2.13.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/neg/t7187-2.13.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/pos/macro-bundle-disambiguate-bundle.check b/test/files/pos/macro-bundle-disambiguate-bundle.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/macro-bundle-disambiguate-nonbundle.check b/test/files/pos/macro-bundle-disambiguate-nonbundle.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/macro-implicit-invalidate-on-error.check b/test/files/pos/macro-implicit-invalidate-on-error.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/reflection-compat-api-universe.check b/test/files/pos/reflection-compat-api-universe.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/reflection-compat-c.check b/test/files/pos/reflection-compat-c.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/reflection-compat-macro-universe.check b/test/files/pos/reflection-compat-macro-universe.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/reflection-compat-ru.check b/test/files/pos/reflection-compat-ru.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/t11813.scala b/test/files/pos/t11813.scala index 8ee89821c185..88d96dbfe4e2 100644 --- a/test/files/pos/t11813.scala +++ b/test/files/pos/t11813.scala @@ -1,4 +1,4 @@ -// scalac: -Werror -Wself-implicit +// scalac: -Xfatal-warnings -Ywarn-self-implicit // package warner diff --git a/test/files/pos/t7776.check b/test/files/pos/t7776.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/t8001.check b/test/files/pos/t8001.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/t8187.check b/test/files/pos/t8187.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/t8209a.check b/test/files/pos/t8209a.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/t8209b.check b/test/files/pos/t8209b.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/t8352.check b/test/files/pos/t8352.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/t8364.check b/test/files/pos/t8364.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/t8369a.check b/test/files/pos/t8369a.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/t8369b.check b/test/files/pos/t8369b.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/pos/t8719.check b/test/files/pos/t8719.check deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/presentation/quasiquotes.flags b/test/files/presentation/quasiquotes.flags deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/test/files/run/t5545.scala b/test/files/run/t5545.scala index fd3c48e45a0c..3b46bbb6422c 100644 --- a/test/files/run/t5545.scala +++ b/test/files/run/t5545.scala @@ -22,6 +22,4 @@ object Test extends DirectTest { compile() System.setErr(prevErr) } - - override def isDebug = false // so we don't get the newSettings warning } diff --git a/test/files/run/t7096.scala b/test/files/run/t7096.scala index 44485e5da1e8..3aa05bc2a13f 100644 --- a/test/files/run/t7096.scala +++ b/test/files/run/t7096.scala @@ -47,7 +47,7 @@ abstract class CompilerTest extends DirectTest { def symbols = classes ++ terms filterNot (_ eq NoSymbol) def terms = allMembers(pkg) filter (s => s.isTerm && !s.isConstructor) def tparams = classes flatMap (_.info.typeParams) - def tpes = symbols map (_.tpe) distinct + def tpes = symbols.map(_.tpe).distinct } } diff --git a/test/files/run/t7187-2.13.flags b/test/files/run/t7187-2.13.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/run/t7187-2.13.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/scaladoc/run/t5527.scala b/test/scaladoc/run/t5527.scala index 05319c3b4660..d57237086732 100644 --- a/test/scaladoc/run/t5527.scala +++ b/test/scaladoc/run/t5527.scala @@ -150,6 +150,4 @@ object Test extends DirectTest { val command = new ScalaDoc.Command((CommandLineParser tokenize extraSettings) ++ args.toList, settings) new DocFactory(new ConsoleReporter(settings), settings).compiler } - - override def isDebug = false // so we don't get the newSettings warning } diff --git a/versions.properties b/versions.properties index df5517f29279..4958952cacd1 100644 --- a/versions.properties +++ b/versions.properties @@ -18,10 +18,8 @@ scala.binary.version=2.12 # Other usages: # - scala-asm: jar content included in scala-compiler # - jline: shaded with JarJar and included in scala-compiler -# - partest: used for running the tests scala-xml.version.number=1.0.6 scala-parser-combinators.version.number=1.0.7 scala-swing.version.number=2.0.3 -partest.version.number=1.1.9 scala-asm.version=7.3.1-scala-1 jline.version=2.14.6 From 1c0b8e41046c5ab9272d1c2178a9429bff7636ae Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Tue, 25 Aug 2020 08:53:24 +0100 Subject: [PATCH 28/46] Kill pos checkfiles --- src/partest/scala/tools/partest/nest/Runner.scala | 6 ++---- test/files/neg/constant-warning.check | 6 ++++++ test/files/{pos => neg}/constant-warning.scala | 1 + test/files/pos/constant-warning.check | 4 ---- test/files/pos/constant-warning.flags | 1 - test/files/pos/delambdafy_t6260_method.check | 13 ------------- test/files/pos/delambdafy_t6260_method.flags | 1 - test/files/pos/delambdafy_t6260_method.scala | 1 + test/files/pos/t5692a.check | 4 ---- test/files/pos/t5692a.flags | 1 - test/files/pos/t5692a/Macros_1.scala | 4 +++- test/files/pos/t5692b.check | 4 ---- test/files/pos/t5692b.flags | 1 - test/files/pos/t5692b/Macros_1.scala | 4 +++- 14 files changed, 16 insertions(+), 35 deletions(-) create mode 100644 test/files/neg/constant-warning.check rename test/files/{pos => neg}/constant-warning.scala (53%) delete mode 100644 test/files/pos/constant-warning.check delete mode 100644 test/files/pos/constant-warning.flags delete mode 100644 test/files/pos/delambdafy_t6260_method.check delete mode 100644 test/files/pos/delambdafy_t6260_method.flags delete mode 100644 test/files/pos/t5692a.check delete mode 100644 test/files/pos/t5692a.flags delete mode 100644 test/files/pos/t5692b.check delete mode 100644 test/files/pos/t5692b.flags diff --git a/src/partest/scala/tools/partest/nest/Runner.scala b/src/partest/scala/tools/partest/nest/Runner.scala index 8b295b8def4d..cd6ce2a1b537 100644 --- a/src/partest/scala/tools/partest/nest/Runner.scala +++ b/src/partest/scala/tools/partest/nest/Runner.scala @@ -536,10 +536,8 @@ class Runner(val testInfo: TestInfo, val suiteRunner: AbstractRunner) { } def runPosTest(): TestState = - // TODO: Deferred until cleanup has happened - //if (checkFile.exists) genFail("unexpected check file for pos test (use -Xfatal-warnings with neg test to verify warnings)") - //else runTestCommon() - runTestCommon() + if (checkFile.exists) genFail("unexpected check file for pos test (use -Xfatal-warnings with neg test to verify warnings)") + else runTestCommon() def runNegTest(): TestState = runInContext { // pass if it checks and didn't crash the compiler diff --git a/test/files/neg/constant-warning.check b/test/files/neg/constant-warning.check new file mode 100644 index 000000000000..dd99ad5dc231 --- /dev/null +++ b/test/files/neg/constant-warning.check @@ -0,0 +1,6 @@ +constant-warning.scala:3: warning: Evaluation of a constant expression results in an arithmetic error: / by zero + val fails = 1 + 2 / (3 - 2 - 1) + ^ +error: No warnings can be incurred under -Xfatal-warnings. +one warning found +one error found diff --git a/test/files/pos/constant-warning.scala b/test/files/neg/constant-warning.scala similarity index 53% rename from test/files/pos/constant-warning.scala rename to test/files/neg/constant-warning.scala index c8ca8823e759..081ba4a1e01e 100644 --- a/test/files/pos/constant-warning.scala +++ b/test/files/neg/constant-warning.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint:constant -Xfatal-warnings object Test { val fails = 1 + 2 / (3 - 2 - 1) } diff --git a/test/files/pos/constant-warning.check b/test/files/pos/constant-warning.check deleted file mode 100644 index f7df2165d133..000000000000 --- a/test/files/pos/constant-warning.check +++ /dev/null @@ -1,4 +0,0 @@ -constant-warning.scala:2: warning: Evaluation of a constant expression results in an arithmetic error: / by zero - val fails = 1 + 2 / (3 - 2 - 1) - ^ -one warning found diff --git a/test/files/pos/constant-warning.flags b/test/files/pos/constant-warning.flags deleted file mode 100644 index d00cbbe77b61..000000000000 --- a/test/files/pos/constant-warning.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint:constant diff --git a/test/files/pos/delambdafy_t6260_method.check b/test/files/pos/delambdafy_t6260_method.check deleted file mode 100644 index f5cd6947d128..000000000000 --- a/test/files/pos/delambdafy_t6260_method.check +++ /dev/null @@ -1,13 +0,0 @@ -delambdafy_t6260_method.scala:3: error: bridge generated for member method apply: (bx: Object)Object in class map$extension1 -which overrides method apply: (v1: Object)Object in trait Function1 -clashes with definition of the member itself; -both have erased type (bx: Object)Object - ((bx: Box[X]) => new Box(f(bx.x)))(this) - ^ -delambdafy_t6260_method.scala:8: error: bridge generated for member method apply: (bx: Object)Object in class map21 -which overrides method apply: (v1: Object)Object in trait Function1 -clashes with definition of the member itself; -both have erased type (bx: Object)Object - ((bx: Box[X]) => new Box(f(bx.x)))(self) - ^ -two errors found diff --git a/test/files/pos/delambdafy_t6260_method.flags b/test/files/pos/delambdafy_t6260_method.flags deleted file mode 100644 index 48b438ddf86a..000000000000 --- a/test/files/pos/delambdafy_t6260_method.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method diff --git a/test/files/pos/delambdafy_t6260_method.scala b/test/files/pos/delambdafy_t6260_method.scala index 93b5448227d5..477638998fd6 100644 --- a/test/files/pos/delambdafy_t6260_method.scala +++ b/test/files/pos/delambdafy_t6260_method.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method class Box[X](val x: X) extends AnyVal { def map[Y](f: X => Y): Box[Y] = ((bx: Box[X]) => new Box(f(bx.x)))(this) diff --git a/test/files/pos/t5692a.check b/test/files/pos/t5692a.check deleted file mode 100644 index 7fbfb5dba7ee..000000000000 --- a/test/files/pos/t5692a.check +++ /dev/null @@ -1,4 +0,0 @@ -Test_2.scala:2: error: this type parameter must be specified - def x = Macros.foo - ^ -one error found diff --git a/test/files/pos/t5692a.flags b/test/files/pos/t5692a.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/pos/t5692a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/pos/t5692a/Macros_1.scala b/test/files/pos/t5692a/Macros_1.scala index 440e37d75d3c..f7c90dd3c0eb 100644 --- a/test/files/pos/t5692a/Macros_1.scala +++ b/test/files/pos/t5692a/Macros_1.scala @@ -1,6 +1,8 @@ +import scala.language.experimental.macros + import scala.reflect.macros.blackbox.Context object Macros { def impl[T](c: Context) = { import c.universe._; c.Expr[Unit](q"()") } def foo[T] = macro impl[T] -} \ No newline at end of file +} diff --git a/test/files/pos/t5692b.check b/test/files/pos/t5692b.check deleted file mode 100644 index 16796826b471..000000000000 --- a/test/files/pos/t5692b.check +++ /dev/null @@ -1,4 +0,0 @@ -Test_2.scala:2: error: these type parameters must be specified - def x = Macros.foo - ^ -one error found diff --git a/test/files/pos/t5692b.flags b/test/files/pos/t5692b.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/pos/t5692b.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/pos/t5692b/Macros_1.scala b/test/files/pos/t5692b/Macros_1.scala index 98fb88284461..b04a6a1e3c2b 100644 --- a/test/files/pos/t5692b/Macros_1.scala +++ b/test/files/pos/t5692b/Macros_1.scala @@ -1,6 +1,8 @@ +import scala.language.experimental.macros + import scala.reflect.macros.blackbox.Context object Macros { def impl[T, U](c: Context) = { import c.universe._; c.Expr[Unit](q"()") } def foo[T, U] = macro impl[T, U] -} \ No newline at end of file +} From 6651375f7306e82dbae464773353579785031c05 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Tue, 25 Aug 2020 08:54:43 +0100 Subject: [PATCH 29/46] Drop flagsfile support, port test suite --- .../scala/tools/partest/PartestDefaults.scala | 2 +- .../scala/tools/partest/nest/Runner.scala | 46 +++++--- test/async/jvm/anf.flags | 1 - test/async/jvm/anf.scala | 1 + test/async/jvm/await0.flags | 1 - test/async/jvm/await0.scala | 1 + test/async/jvm/block0.flags | 1 - test/async/jvm/block0.scala | 1 + test/async/jvm/block1.flags | 1 - test/async/jvm/block1.scala | 1 + test/async/jvm/completable-future.flags | 1 - test/async/jvm/completable-future.scala | 3 +- .../jvm/concurrent_AfterRefchecksIssue.flags | 1 - .../jvm/concurrent_AfterRefchecksIssue.scala | 1 + ...concurrent_ArrayIndexOutOfBoundIssue.flags | 1 - ...concurrent_ArrayIndexOutOfBoundIssue.scala | 1 + .../concurrent_GenericTypeBoundaryIssue.flags | 1 - .../concurrent_GenericTypeBoundaryIssue.scala | 1 + test/async/jvm/concurrent_MatchEndIssue.flags | 1 - test/async/jvm/concurrent_MatchEndIssue.scala | 1 + ...oncurrent_NegativeArraySizeException.flags | 1 - ...oncurrent_NegativeArraySizeException.scala | 1 + ...rent_NegativeArraySizeExceptionFine1.flags | 1 - ...rent_NegativeArraySizeExceptionFine1.scala | 1 + .../jvm/concurrent_ReturnTupleIssue.flags | 1 - .../jvm/concurrent_ReturnTupleIssue.scala | 1 + test/async/jvm/concurrent_fetch.flags | 1 - test/async/jvm/concurrent_fetch.scala | 1 + .../jvm/concurrent_patternAlternative.flags | 1 - .../jvm/concurrent_patternAlternative.scala | 1 + ...nt_patternAlternativeBothAnnotations.flags | 1 - ...nt_patternAlternativeBothAnnotations.scala | 1 + .../jvm/concurrent_polymorphicMethod.check | 2 +- .../jvm/concurrent_polymorphicMethod.flags | 1 - .../jvm/concurrent_polymorphicMethod.scala | 1 + test/async/jvm/concurrent_shadowing.check | 2 +- test/async/jvm/concurrent_shadowing.flags | 1 - test/async/jvm/concurrent_shadowing.scala | 1 + test/async/jvm/concurrent_shadowing0.flags | 1 - test/async/jvm/concurrent_shadowing0.scala | 1 + test/async/jvm/concurrent_shadowing2.flags | 1 - test/async/jvm/concurrent_shadowing2.scala | 1 + .../concurrent_shadowingRefinedTypes.flags | 1 - .../concurrent_shadowingRefinedTypes.scala | 1 + test/async/jvm/concurrent_test0.flags | 1 - test/async/jvm/concurrent_test0.scala | 1 + test/async/jvm/exceptions.flags | 1 - test/async/jvm/exceptions.scala | 1 + test/async/jvm/futures.check | 6 +- test/async/jvm/futures.flags | 1 - test/async/jvm/futures.scala | 1 + test/async/jvm/hygiene.flags | 1 - test/async/jvm/hygiene.scala | 1 + test/async/jvm/ifelse0.flags | 1 - test/async/jvm/ifelse0.scala | 1 + test/async/jvm/ifelse0_while.flags | 1 - test/async/jvm/ifelse0_while.scala | 1 + test/async/jvm/ifelse1.flags | 1 - test/async/jvm/ifelse1.scala | 1 + test/async/jvm/ifelse2.flags | 1 - test/async/jvm/ifelse2.scala | 1 + test/async/jvm/ifelse3.flags | 1 - test/async/jvm/ifelse3.scala | 1 + test/async/jvm/ifelse4.flags | 1 - test/async/jvm/ifelse4.scala | 1 + test/async/jvm/lazyval.flags | 1 - test/async/jvm/lazyval.scala | 1 + test/async/jvm/live.flags | 1 - test/async/jvm/live.scala | 1 + test/async/jvm/localclasses.flags | 1 - test/async/jvm/localclasses.scala | 1 + test/async/jvm/match0.flags | 1 - test/async/jvm/match0.scala | 1 + test/async/jvm/nesteddef.flags | 1 - test/async/jvm/nesteddef.scala | 1 + test/async/jvm/noawait.flags | 1 - test/async/jvm/noawait.scala | 1 + test/async/jvm/stackoverflow.flags | 1 - test/async/jvm/stackoverflow.scala | 1 + test/async/jvm/syncOptimization.flags | 1 - test/async/jvm/syncOptimization.scala | 1 + test/async/jvm/toughtype.flags | 1 - test/async/jvm/toughtype.scala | 1 + test/async/neg/ill-nested-await.check | 26 ++--- test/async/neg/ill-nested-await.flags | 1 - test/async/neg/ill-nested-await.scala | 1 + test/async/neg/naked_await.check | 4 +- test/async/neg/naked_await.flags | 1 - test/async/neg/naked_await.scala | 1 + test/async/neg/stark_naked_await.check | 2 +- test/async/neg/stark_naked_await.flags | 1 - test/async/neg/stark_naked_await.scala | 1 + test/async/run/booleans.flags | 1 - test/async/run/booleans.scala | 1 + test/async/run/edge-cases.flags | 1 - test/async/run/edge-cases.scala | 1 + test/async/run/lambda.flags | 1 - test/async/run/lambda.scala | 1 + test/async/run/output.flags | 1 - test/async/run/output.scala | 1 + test/async/run/smoketest.flags | 1 - test/async/run/smoketest.scala | 3 +- test/async/run/value-class.flags | 1 - test/async/run/value-class.scala | 1 + .../instrumented/inline-in-constructors.flags | 1 - .../inline-in-constructors/assert_1.scala | 1 + .../inline-in-constructors/bar_2.scala | 1 + .../inline-in-constructors/test_3.scala | 1 + test/files/jvm/annotations.check | 2 +- test/files/jvm/annotations.flags | 1 - test/files/jvm/annotations/Test_2.scala | 1 + test/files/jvm/bytecode-test-example.flags | 1 - .../jvm/bytecode-test-example/Foo_1.scala | 1 + .../jvm/bytecode-test-example/Test.scala | 1 + test/files/jvm/matchbox.flags | 1 - test/files/jvm/matchbox/Test.scala | 3 +- test/files/jvm/matchbox/matchbox_1.scala | 3 +- test/files/jvm/t10512a.scala | 2 +- test/files/jvm/t8582.check | 2 +- test/files/jvm/t8582.flags | 1 - test/files/jvm/t8582.scala | 1 + test/files/jvm/unreachable/Foo_1.check | 36 +++++++ test/files/jvm/unreachable/Foo_1.flags | 1 - test/files/jvm/unreachable/Foo_1.scala | 1 + test/files/neg/abstract-explaintypes.check | 4 +- test/files/neg/abstract-explaintypes.flags | 1 - test/files/neg/abstract-explaintypes.scala | 1 + test/files/neg/abstract-inaccessible.check | 6 +- test/files/neg/abstract-inaccessible.flags | 1 - test/files/neg/abstract-inaccessible.scala | 1 + test/files/neg/aladdin1055.check | 2 +- test/files/neg/aladdin1055.flags | 1 - test/files/neg/aladdin1055/A.scala | 1 + test/files/neg/aladdin1055/Test_1.scala | 1 + test/files/neg/applydynamic_sip.check | 38 +++---- test/files/neg/applydynamic_sip.flags | 1 - test/files/neg/applydynamic_sip.scala | 1 + test/files/neg/bad-advice.check | 2 +- test/files/neg/bad-advice.flags | 1 - test/files/neg/bad-advice.scala | 1 + test/files/neg/badtok-1-212.check | 10 +- test/files/neg/badtok-1-212.flags | 1 - test/files/neg/badtok-1-212.scala | 1 + test/files/neg/badtok-1.check | 20 ++-- test/files/neg/badtok-1.flags | 1 - test/files/neg/badtok-1.scala | 1 + test/files/neg/beanInfoDeprecation.check | 2 +- test/files/neg/beanInfoDeprecation.flags | 1 - test/files/neg/beanInfoDeprecation.scala | 1 + test/files/neg/case-collision-multifile.check | 2 +- test/files/neg/case-collision-multifile.flags | 1 - .../neg/case-collision-multifile/one.scala | 3 +- .../neg/case-collision-multifile/two.scala | 3 +- test/files/neg/case-collision.check | 12 +-- test/files/neg/case-collision.flags | 1 - test/files/neg/case-collision.scala | 3 +- test/files/neg/catch-all.check | 6 +- test/files/neg/catch-all.flags | 1 - test/files/neg/catch-all.scala | 1 + test/files/neg/check-dead.check | 8 +- test/files/neg/check-dead.flags | 1 - test/files/neg/check-dead.scala | 1 + test/files/neg/checksensible.check | 72 ++++++------- test/files/neg/checksensible.flags | 1 - test/files/neg/checksensible.scala | 1 + test/files/neg/choices.flags | 1 - test/files/neg/choices.scala | 1 + .../neg/classmanifests_new_deprecations.check | 16 +-- .../neg/classmanifests_new_deprecations.flags | 1 - .../neg/classmanifests_new_deprecations.scala | 3 +- test/files/neg/constructor-init-order.check | 4 +- test/files/neg/constructor-init-order.flags | 1 - test/files/neg/constructor-init-order.scala | 1 + test/files/neg/cycle-bounds.check | 2 +- test/files/neg/cycle-bounds.flags | 1 - test/files/neg/cycle-bounds.scala | 1 + test/files/neg/delayed-init-ref.check | 8 +- test/files/neg/delayed-init-ref.flags | 1 - test/files/neg/delayed-init-ref.scala | 1 + test/files/neg/deprecated-target.flags | 1 - test/files/neg/deprecated-target.scala | 3 +- test/files/neg/exhausting.check | 12 +-- test/files/neg/exhausting.flags | 1 - test/files/neg/exhausting.scala | 1 + test/files/neg/for-comprehension-old.check | 16 +-- test/files/neg/for-comprehension-old.flags | 1 - test/files/neg/for-comprehension-old.scala | 1 + test/files/neg/forgot-interpolator.check | 16 +-- test/files/neg/forgot-interpolator.flags | 1 - test/files/neg/forgot-interpolator.scala | 1 + test/files/neg/gadts2-strict.check | 2 +- test/files/neg/gadts2-strict.flags | 1 - test/files/neg/gadts2-strict.scala | 1 + test/files/neg/gadts2.check | 2 +- test/files/neg/gadts2.flags | 1 - test/files/neg/gadts2.scala | 1 + test/files/neg/hk-typevar-unification.check | 8 +- test/files/neg/hk-typevar-unification.flags | 1 - test/files/neg/hk-typevar-unification.scala | 1 + .../neg/implicit-ambiguous-invalid.check | 2 +- .../neg/implicit-ambiguous-invalid.flags | 1 - .../neg/implicit-ambiguous-invalid.scala | 1 + test/files/neg/implicit-shadow.check | 4 +- test/files/neg/implicit-shadow.flags | 1 - test/files/neg/implicit-shadow.scala | 3 +- test/files/neg/implicitly-self.check | 8 +- test/files/neg/implicitly-self.flags | 1 - test/files/neg/implicitly-self.scala | 1 + test/files/neg/inlineIndyLambdaPrivate.check | 2 +- test/files/neg/inlineIndyLambdaPrivate.flags | 1 - .../neg/inlineIndyLambdaPrivate/Test_2.scala | 1 + test/files/neg/inlineMaxSize.check | 2 +- test/files/neg/inlineMaxSize.flags | 1 - test/files/neg/inlineMaxSize.scala | 1 + .../java-import-non-existing-selector.flags | 1 - test/files/neg/logImplicits.check | 12 +-- test/files/neg/logImplicits.flags | 1 - test/files/neg/logImplicits.scala | 3 +- test/files/neg/macro-basic-mamdmi.check | 6 +- test/files/neg/macro-basic-mamdmi.flags | 1 - .../Impls_Macros_Test_1.scala | 3 +- ...acro-blackbox-fundep-materialization.check | 2 +- ...acro-blackbox-fundep-materialization.flags | 1 - .../Macros_1.scala | 1 + .../Test_2.scala | 3 +- test/files/neg/macro-cyclic.check | 2 +- test/files/neg/macro-cyclic.flags | 1 - .../neg/macro-cyclic/Impls_Macros_1.scala | 1 + test/files/neg/macro-deprecate-idents.check | 44 ++++---- test/files/neg/macro-deprecate-idents.flags | 1 - test/files/neg/macro-deprecate-idents.scala | 3 +- .../neg/macro-false-deprecation-warning.check | 2 +- .../neg/macro-false-deprecation-warning.flags | 1 - .../Impls_Macros_1.scala | 1 + .../Macros_2.flags | 1 - .../Macros_2.scala | 3 +- .../macro-incompatible-macro-engine-b.check | 4 +- .../macro-incompatible-macro-engine-b.flags | 1 - .../Macros_2.flags | 1 - .../Macros_2.scala | 3 +- .../Plugin_1.scala | 2 +- .../Test_3.scala | 3 +- test/files/neg/macro-invalidimpl.check | 20 ++-- test/files/neg/macro-invalidimpl.flags | 1 - .../files/neg/macro-invalidimpl/Impls_1.scala | 3 +- .../neg/macro-invalidimpl/Macros_Test_2.scala | 3 +- test/files/neg/macro-invalidret.check | 14 +-- test/files/neg/macro-invalidret.flags | 3 - test/files/neg/macro-invalidret/Impls_1.scala | 1 + .../neg/macro-invalidret/Macros_Test_2.scala | 3 +- test/files/neg/macro-invalidshape.check | 8 +- test/files/neg/macro-invalidshape.flags | 1 - .../neg/macro-invalidshape/Impls_1.scala | 1 + .../macro-invalidshape/Macros_Test_2.scala | 3 +- .../neg/macro-invalidsig-params-badtype.check | 2 +- .../neg/macro-invalidsig-params-badtype.flags | 1 - .../Impls_Macros_1.scala | 1 + test/files/neg/macro-invalidsig.check | 32 +++--- test/files/neg/macro-invalidsig.flags | 1 - test/files/neg/macro-invalidsig/Impls_1.scala | 3 +- .../neg/macro-invalidsig/Macros_Test_2.scala | 3 +- .../neg/macro-invalidusage-badargs.check | 10 +- .../neg/macro-invalidusage-badargs.flags | 1 - .../macro-invalidusage-badargs/Impls_1.scala | 1 + .../Macros_Test_2.scala | 3 +- .../neg/macro-invalidusage-badbounds.check | 2 +- .../neg/macro-invalidusage-badbounds.flags | 1 - .../Impls_1.scala | 1 + .../Macros_Test_2.scala | 3 +- .../neg/macro-invalidusage-badtargs.check | 10 +- .../neg/macro-invalidusage-badtargs.flags | 1 - .../macro-invalidusage-badtargs/Impls_1.scala | 1 + .../Macros_Test_2.scala | 3 +- ...macro-invalidusage-methodvaluesyntax.check | 2 +- ...macro-invalidusage-methodvaluesyntax.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../neg/macro-invalidusage-nontypeable.check | 2 +- .../neg/macro-invalidusage-nontypeable.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../Test_2.scala | 3 +- .../neg/macro-invalidusage-presuper.check | 2 +- .../neg/macro-invalidusage-presuper.flags | 1 - .../macro-invalidusage-presuper/Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- test/files/neg/macro-noexpand.check | 2 +- test/files/neg/macro-noexpand.flags | 1 - test/files/neg/macro-noexpand/Impls_1.scala | 1 + .../neg/macro-noexpand/Macros_Test_2.scala | 3 +- test/files/neg/macro-nontypeablebody.check | 2 +- test/files/neg/macro-nontypeablebody.flags | 1 - .../neg/macro-nontypeablebody/Impls_1.scala | 1 + .../macro-nontypeablebody/Macros_Test_2.scala | 3 +- ...de-macro-overrides-abstract-method-a.check | 2 +- ...de-macro-overrides-abstract-method-a.flags | 1 - .../Impls_Macros_1.scala | 1 + .../Test_2.scala | 3 +- ...de-macro-overrides-abstract-method-b.check | 4 +- ...de-macro-overrides-abstract-method-b.flags | 1 - .../Impls_Macros_1.scala | 1 + .../Test_2.scala | 3 +- ...acro-override-method-overrides-macro.check | 2 +- ...acro-override-method-overrides-macro.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 1 + .../files/neg/macro-reify-splice-splice.check | 2 +- .../files/neg/macro-reify-splice-splice.flags | 1 - .../macro-reify-splice-splice/Macros_1.scala | 3 +- .../macro-reify-splice-splice/Test_2.scala | 3 +- test/files/neg/main1.check | 10 +- test/files/neg/main1.flags | 1 - test/files/neg/main1.scala | 1 + test/files/neg/maxerrs.check | 6 +- test/files/neg/maxerrs.flags | 1 - test/files/neg/maxerrs.scala | 1 + test/files/neg/maxwarns.check | 6 +- test/files/neg/maxwarns.flags | 1 - test/files/neg/maxwarns.scala | 1 + test/files/neg/migration28.check | 2 +- test/files/neg/migration28.flags | 1 - test/files/neg/migration28.scala | 1 + test/files/neg/multi-array.check | 2 +- test/files/neg/multi-array.flags | 1 - test/files/neg/multi-array.scala | 1 + test/files/neg/names-defaults-neg-213.check | 4 +- test/files/neg/names-defaults-neg-213.flags | 1 - test/files/neg/names-defaults-neg-213.scala | 1 + test/files/neg/names-defaults-neg-warn.check | 12 +-- test/files/neg/names-defaults-neg-warn.flags | 1 - test/files/neg/names-defaults-neg-warn.scala | 1 + test/files/neg/names-defaults-neg.check | 102 +++++++++--------- test/files/neg/names-defaults-neg.flags | 1 - test/files/neg/names-defaults-neg.scala | 1 + test/files/neg/newpat_unreachable.check | 18 ++-- test/files/neg/newpat_unreachable.flags | 1 - test/files/neg/newpat_unreachable.scala | 1 + test/files/neg/no-predef.check | 6 +- test/files/neg/no-predef.flags | 1 - test/files/neg/no-predef.scala | 3 +- test/files/neg/nonlocal-warning.check | 4 +- test/files/neg/nonlocal-warning.flags | 1 - test/files/neg/nonlocal-warning.scala | 1 + test/files/neg/nonsense_eq_refine.check | 4 +- test/files/neg/nonsense_eq_refine.flags | 1 - test/files/neg/nonsense_eq_refine.scala | 1 + test/files/neg/nullary-override.check | 2 +- test/files/neg/nullary-override.flags | 1 - test/files/neg/nullary-override.scala | 1 + test/files/neg/optimiseDeprecated.flags | 1 - test/files/neg/optimiseDeprecated.scala | 1 + test/files/neg/outer-ref-checks.check | 14 +-- test/files/neg/outer-ref-checks.flags | 1 - test/files/neg/outer-ref-checks.scala | 1 + test/files/neg/overloaded-implicit.check | 4 +- test/files/neg/overloaded-implicit.flags | 1 - test/files/neg/overloaded-implicit.scala | 1 + test/files/neg/override-object-no.check | 12 +-- test/files/neg/override-object-no.flags | 1 - test/files/neg/override-object-no.scala | 1 + test/files/neg/partestInvalidFlag.flags | 1 - test/files/neg/partestInvalidFlag.scala | 1 + test/files/neg/pat_unreachable.check | 8 +- test/files/neg/pat_unreachable.flags | 1 - test/files/neg/pat_unreachable.scala | 1 + test/files/neg/patmat-classtag-compound.check | 2 +- test/files/neg/patmat-classtag-compound.flags | 1 - test/files/neg/patmat-classtag-compound.scala | 1 + test/files/neg/patmatexhaust.check | 20 ++-- test/files/neg/patmatexhaust.flags | 1 - test/files/neg/patmatexhaust.scala | 1 + test/files/neg/permanent-blindness.check | 6 +- test/files/neg/permanent-blindness.flags | 1 - test/files/neg/permanent-blindness.scala | 3 +- test/files/neg/pickle-java-crash.flags | 1 - test/files/neg/pickle-java-crash/Brash.scala | 3 +- test/files/neg/run-gadts-strict.check | 8 +- test/files/neg/run-gadts-strict.flags | 1 - test/files/neg/run-gadts-strict.scala | 1 + test/files/neg/sammy_disabled.check | 2 +- test/files/neg/sammy_disabled.flags | 1 - test/files/neg/sammy_disabled.scala | 1 + test/files/neg/sealed-final-neg.check | 4 +- test/files/neg/sealed-final-neg.flags | 1 - test/files/neg/sealed-final-neg.scala | 1 + test/files/neg/sealed-java-enums.check | 2 +- test/files/neg/sealed-java-enums.flags | 1 - test/files/neg/sealed-java-enums.scala | 1 + test/files/neg/stmt-expr-discard.check | 4 +- test/files/neg/stmt-expr-discard.flags | 1 - test/files/neg/stmt-expr-discard.scala | 1 + test/files/neg/switch.check | 4 +- test/files/neg/switch.flags | 1 - test/files/neg/switch.scala | 1 + test/files/neg/t0903.check | 4 +- test/files/neg/t0903.flags | 1 - test/files/neg/t0903.scala | 1 + test/files/neg/t10019.check | 4 +- test/files/neg/t10019.flags | 1 - test/files/neg/t10019.scala | 1 + test/files/neg/t10068.check | 8 +- test/files/neg/t10068.flags | 1 - test/files/neg/t10068.scala | 1 + test/files/neg/t10097.check | 12 +-- test/files/neg/t10097.flags | 1 - test/files/neg/t10097.scala | 1 + test/files/neg/t10097b.check | 2 +- test/files/neg/t10097b.flags | 1 - test/files/neg/t10097b.scala | 1 + test/files/neg/t10270.check | 2 +- test/files/neg/t10270.flags | 1 - test/files/neg/t10270/Macros_1.scala | 1 + test/files/neg/t10270/Main_2.scala | 1 + test/files/neg/t10296-after.check | 2 +- test/files/neg/t10296-after.flags | 1 - .../neg/t10296-after/UnusedMacro_1.scala | 1 + test/files/neg/t10296-after/Unused_2.scala | 1 + test/files/neg/t10296-both.check | 4 +- test/files/neg/t10296-both.flags | 1 - .../files/neg/t10296-both/UnusedMacro_1.scala | 1 + test/files/neg/t10296-both/Unused_2.scala | 1 + test/files/neg/t10296-warn.check | 2 +- test/files/neg/t10296-warn.flags | 1 - .../files/neg/t10296-warn/UnusedMacro_1.scala | 1 + test/files/neg/t10296-warn/Unused_2.scala | 1 + test/files/neg/t10678.check | 6 +- test/files/neg/t10678.flags | 1 - test/files/neg/t10678.scala | 1 + test/files/neg/t10752.check | 4 +- test/files/neg/t10752/Test_2.flags | 1 - test/files/neg/t10752/Test_2.scala | 1 + test/files/neg/t1215.check | 2 +- test/files/neg/t1215.flags | 1 - test/files/neg/t1215.scala | 1 + test/files/neg/t1224.check | 2 +- test/files/neg/t1224.flags | 1 - test/files/neg/t1224.scala | 1 + test/files/neg/t1503.check | 2 +- test/files/neg/t1503.flags | 1 - test/files/neg/t1503.scala | 3 +- test/files/neg/t1909-object.check | 2 +- test/files/neg/t1909-object.flags | 1 - test/files/neg/t1909-object.scala | 3 +- test/files/neg/t1980.check | 6 +- test/files/neg/t1980.flags | 1 - test/files/neg/t1980.scala | 1 + test/files/neg/t2442.check | 4 +- test/files/neg/t2442.flags | 1 - test/files/neg/t2442/t2442.scala | 3 +- test/files/neg/t2462b.check | 4 +- test/files/neg/t2462b.flags | 1 - test/files/neg/t2462b.scala | 1 + test/files/neg/t2462c.check | 4 +- test/files/neg/t2462c.flags | 1 - test/files/neg/t2462c.scala | 1 + test/files/neg/t2509-2.check | 2 +- test/files/neg/t2509-2.flags | 1 - test/files/neg/t2509-2.scala | 1 + test/files/neg/t2712-2.check | 4 +- test/files/neg/t2712-2.flags | 1 - test/files/neg/t2712-2.scala | 1 + test/files/neg/t2796.check | 4 +- test/files/neg/t2796.flags | 1 - test/files/neg/t2796.scala | 1 + test/files/neg/t284.check | 2 +- test/files/neg/t284.flags | 1 - test/files/neg/t284.scala | 1 + test/files/neg/t3098.check | 2 +- test/files/neg/t3098.flags | 1 - test/files/neg/t3098/a.scala | 1 + test/files/neg/t3098/b.scala | 1 + test/files/neg/t3683a.check | 2 +- test/files/neg/t3683a.flags | 1 - test/files/neg/t3683a.scala | 3 +- test/files/neg/t3692-new.check | 10 +- test/files/neg/t3692-new.flags | 1 - test/files/neg/t3692-new.scala | 3 +- test/files/neg/t4302.check | 2 +- test/files/neg/t4302.flags | 1 - test/files/neg/t4302.scala | 1 + test/files/neg/t4440.check | 8 +- test/files/neg/t4440.flags | 1 - test/files/neg/t4440.scala | 1 + test/files/neg/t4691_exhaust_extractor.check | 6 +- test/files/neg/t4691_exhaust_extractor.flags | 1 - test/files/neg/t4691_exhaust_extractor.scala | 3 +- test/files/neg/t4749.check | 14 +-- test/files/neg/t4749.flags | 1 - test/files/neg/t4749.scala | 1 + test/files/neg/t4762.check | 4 +- test/files/neg/t4762.flags | 1 - test/files/neg/t4762.scala | 1 + test/files/neg/t4851.check | 16 +-- test/files/neg/t4851.flags | 1 - test/files/neg/t4851/S.scala | 1 + test/files/neg/t5182.check | 4 +- test/files/neg/t5182.flags | 1 - test/files/neg/t5182.scala | 1 + test/files/neg/t5352.check | 4 +- test/files/neg/t5352.flags | 1 - test/files/neg/t5352.scala | 1 + test/files/neg/t5426.check | 8 +- test/files/neg/t5426.flags | 1 - test/files/neg/t5426.scala | 1 + test/files/neg/t5440.check | 2 +- test/files/neg/t5440.flags | 1 - test/files/neg/t5440.scala | 3 +- test/files/neg/t5639b.check | 2 +- test/files/neg/t5639b.flags | 1 - test/files/neg/t5639b/A_1.scala | 1 + test/files/neg/t5639b/A_2.scala | 1 + test/files/neg/t5663-badwarneq.check | 26 ++--- test/files/neg/t5663-badwarneq.flags | 1 - test/files/neg/t5663-badwarneq.scala | 1 + test/files/neg/t5675.flags | 1 - test/files/neg/t5675.scala | 1 + test/files/neg/t5689.check | 2 +- test/files/neg/t5689.flags | 1 - test/files/neg/t5689.scala | 1 + test/files/neg/t5691.check | 14 +-- test/files/neg/t5691.flags | 1 - test/files/neg/t5691.scala | 1 + test/files/neg/t5753.check | 2 +- test/files/neg/t5753.flags | 1 - test/files/neg/t5753/Impls_Macros_1.scala | 1 + test/files/neg/t5753/Test_2.scala | 1 + test/files/neg/t5762.check | 8 +- test/files/neg/t5762.flags | 1 - test/files/neg/t5762.scala | 1 + test/files/neg/t5830.check | 4 +- test/files/neg/t5830.flags | 1 - test/files/neg/t5830.scala | 3 +- test/files/neg/t5956.check | 4 +- test/files/neg/t5956.flags | 1 - test/files/neg/t5956.scala | 1 + test/files/neg/t6011.check | 6 +- test/files/neg/t6011.flags | 1 - test/files/neg/t6011.scala | 3 +- test/files/neg/t6048.check | 10 +- test/files/neg/t6048.flags | 1 - test/files/neg/t6048.scala | 1 + test/files/neg/t6120.check | 8 +- test/files/neg/t6120.flags | 1 - test/files/neg/t6120.scala | 1 + .../files/neg/t6123-explaintypes-macros.check | 2 +- .../t6123-explaintypes-macros/BadMac_2.flags | 1 - .../t6123-explaintypes-macros/BadMac_2.scala | 1 + .../t6123-explaintypes-macros/Macros.flags | 1 - .../t6123-explaintypes-macros/Macros.scala | 1 + test/files/neg/t6162-inheritance.check | 6 +- test/files/neg/t6162-inheritance.flags | 1 - test/files/neg/t6162-inheritance/defn.scala | 1 + test/files/neg/t6162-inheritance/usage.scala | 1 + test/files/neg/t6162-overriding.check | 4 +- test/files/neg/t6162-overriding.flags | 1 - test/files/neg/t6162-overriding.scala | 1 + test/files/neg/t6264.check | 2 +- test/files/neg/t6264.flags | 1 - test/files/neg/t6264.scala | 1 + test/files/neg/t6276.check | 12 +-- test/files/neg/t6276.flags | 1 - test/files/neg/t6276.scala | 1 + test/files/neg/t6289.flags | 1 - test/files/neg/t6289/SUT_5.scala | 1 + test/files/neg/t6323a.check | 8 +- test/files/neg/t6323a.flags | 1 - test/files/neg/t6323a.scala | 3 +- test/files/neg/t6406-regextract.check | 2 +- test/files/neg/t6406-regextract.flags | 1 - test/files/neg/t6406-regextract.scala | 1 + .../files/neg/t6446-additional/sample_2.flags | 1 - .../files/neg/t6446-additional/sample_2.scala | 1 + test/files/neg/t6446-list/sample_2.flags | 1 - test/files/neg/t6446-list/sample_2.scala | 1 + test/files/neg/t6446-missing/sample_2.flags | 1 - test/files/neg/t6446-missing/sample_2.scala | 1 + test/files/neg/t6446-show-phases.flags | 1 - test/files/neg/t6446-show-phases.scala | 1 + test/files/neg/t6534.check | 6 +- test/files/neg/t6534.flags | 1 - test/files/neg/t6534.scala | 1 + test/files/neg/t6567.check | 4 +- test/files/neg/t6567.flags | 1 - test/files/neg/t6567.scala | 1 + test/files/neg/t6582_exhaust_big.check | 2 +- test/files/neg/t6582_exhaust_big.flags | 1 - test/files/neg/t6582_exhaust_big.scala | 1 + test/files/neg/t6666.check | 24 ++--- test/files/neg/t6666.flags | 1 - test/files/neg/t6666.scala | 3 +- test/files/neg/t6666c.check | 6 +- test/files/neg/t6666c.flags | 1 - test/files/neg/t6666c.scala | 1 + test/files/neg/t6675.check | 2 +- test/files/neg/t6675.flags | 1 - test/files/neg/t6675.scala | 1 + test/files/neg/t6675b.check | 18 ++-- test/files/neg/t6675b.flags | 1 - test/files/neg/t6675b.scala | 1 + test/files/neg/t6680a.check | 4 +- test/files/neg/t6680a.flags | 1 - test/files/neg/t6680a.scala | 1 + test/files/neg/t6902.check | 6 +- test/files/neg/t6902.flags | 1 - test/files/neg/t6902.scala | 1 + test/files/neg/t6963a.check | 2 +- test/files/neg/t6963a.flags | 1 - test/files/neg/t6963a.scala | 1 + test/files/neg/t7014.flags | 1 - test/files/neg/t7014/t7014_2.scala | 1 + test/files/neg/t7020.check | 8 +- test/files/neg/t7020.flags | 1 - test/files/neg/t7020.scala | 1 + test/files/neg/t7110.check | 2 +- test/files/neg/t7110.flags | 1 - test/files/neg/t7110.scala | 1 + test/files/neg/t7171.check | 4 +- test/files/neg/t7171.flags | 1 - test/files/neg/t7171.scala | 1 + test/files/neg/t7171b.check | 6 +- test/files/neg/t7171b.flags | 1 - test/files/neg/t7171b.scala | 1 + test/files/neg/t7187.check | 10 +- test/files/neg/t7187.flags | 1 - test/files/neg/t7187.scala | 1 + test/files/neg/t7285.check | 6 +- test/files/neg/t7285.flags | 1 - test/files/neg/t7285.scala | 1 + test/files/neg/t7290.check | 6 +- test/files/neg/t7290.flags | 1 - test/files/neg/t7290.scala | 1 + test/files/neg/t7292-deprecation.check | 6 +- test/files/neg/t7292-deprecation.flags | 1 - test/files/neg/t7292-deprecation.scala | 1 + test/files/neg/t7292-removal.check | 6 +- test/files/neg/t7292-removal.flags | 1 - test/files/neg/t7292-removal.scala | 1 + test/files/neg/t7369.check | 8 +- test/files/neg/t7369.flags | 1 - test/files/neg/t7369.scala | 1 + .../neg/t7494-after-terminal/sample_2.flags | 1 - .../neg/t7494-after-terminal/sample_2.scala | 1 + .../neg/t7494-before-parser/sample_2.flags | 1 - .../neg/t7494-before-parser/sample_2.scala | 1 + .../t7494-multi-right-after/sample_2.flags | 1 - .../t7494-multi-right-after/sample_2.scala | 1 + .../files/neg/t7494-no-options/sample_2.flags | 1 - .../files/neg/t7494-no-options/sample_2.scala | 1 + .../t7494-right-after-before/sample_2.flags | 1 - .../t7494-right-after-before/sample_2.scala | 1 + .../t7494-right-after-terminal/sample_2.flags | 1 - .../t7494-right-after-terminal/sample_2.scala | 1 + test/files/neg/t7605-deprecation.check | 8 +- test/files/neg/t7605-deprecation.flags | 1 - test/files/neg/t7605-deprecation.scala | 1 + .../t7622-cyclic-dependency/sample_2.flags | 1 - .../t7622-cyclic-dependency/sample_2.scala | 1 + .../t7622-missing-dependency/sample_2.flags | 1 - .../t7622-missing-dependency/sample_2.scala | 1 + test/files/neg/t7622-missing-required.flags | 1 - test/files/neg/t7622-missing-required.scala | 1 + .../neg/t7622-multi-followers/sample_2.flags | 1 - .../neg/t7622-multi-followers/sample_2.scala | 1 + test/files/neg/t7623.check | 8 +- test/files/neg/t7623.flags | 1 - test/files/neg/t7623.scala | 1 + .../neg/t7629-view-bounds-deprecation.check | 4 +- .../neg/t7629-view-bounds-deprecation.flags | 1 - .../neg/t7629-view-bounds-deprecation.scala | 1 + test/files/neg/t7669.check | 2 +- test/files/neg/t7669.flags | 1 - test/files/neg/t7669.scala | 1 + test/files/neg/t7721.check | 16 +-- test/files/neg/t7721.flags | 1 - test/files/neg/t7721.scala | 3 +- test/files/neg/t7756b.check | 2 +- test/files/neg/t7756b.flags | 1 - test/files/neg/t7756b.scala | 1 + test/files/neg/t7783.check | 10 +- test/files/neg/t7783.flags | 1 - test/files/neg/t7783.scala | 1 + test/files/neg/t7848-interp-warn.check | 16 +-- test/files/neg/t7848-interp-warn.flags | 1 - test/files/neg/t7848-interp-warn.scala | 1 + test/files/neg/t7860.check | 4 +- test/files/neg/t7860.flags | 1 - test/files/neg/t7860.scala | 1 + test/files/neg/t7984.check | 2 +- test/files/neg/t7984.flags | 1 - test/files/neg/t7984.scala | 1 + test/files/neg/t8015-ffb.check | 2 +- test/files/neg/t8015-ffb.flags | 1 - test/files/neg/t8015-ffb.scala | 1 + test/files/neg/t8035-deprecated.check | 6 +- test/files/neg/t8035-deprecated.flags | 1 - test/files/neg/t8035-deprecated.scala | 1 + test/files/neg/t8035-no-adapted-args.check | 8 +- test/files/neg/t8035-no-adapted-args.flags | 1 - test/files/neg/t8035-no-adapted-args.scala | 1 + test/files/neg/t8035-removed.check | 6 +- test/files/neg/t8035-removed.flags | 1 - test/files/neg/t8035-removed.scala | 1 + test/files/neg/t8265.check | 2 +- test/files/neg/t8265.flags | 1 - test/files/neg/t8265.scala | 1 + test/files/neg/t8417.check | 4 +- test/files/neg/t8417.flags | 1 - test/files/neg/t8417.scala | 1 + test/files/neg/t8430.check | 8 +- test/files/neg/t8430.flags | 1 - test/files/neg/t8430.scala | 1 + test/files/neg/t8450.check | 2 +- test/files/neg/t8450.flags | 1 - test/files/neg/t8450.scala | 1 + test/files/neg/t8525.check | 6 +- test/files/neg/t8525.flags | 1 - test/files/neg/t8525.scala | 1 + test/files/neg/t8597.check | 12 +-- test/files/neg/t8597.flags | 1 - test/files/neg/t8597.scala | 1 + test/files/neg/t8597b.check | 2 +- test/files/neg/t8597b.flags | 1 - test/files/neg/t8597b.scala | 1 + test/files/neg/t8610-arg.check | 2 +- test/files/neg/t8610-arg.flags | 1 - test/files/neg/t8610-arg.scala | 1 + test/files/neg/t8610.check | 8 +- test/files/neg/t8610.flags | 1 - test/files/neg/t8610.scala | 1 + test/files/neg/t8685.check | 30 +++--- test/files/neg/t8685.flags | 1 - test/files/neg/t8685.scala | 1 + test/files/neg/t8700a.check | 4 +- test/files/neg/t8700a.flags | 1 - test/files/neg/t8700a/Bar.scala | 1 + test/files/neg/t8700b.check | 4 +- test/files/neg/t8700b.flags | 1 - test/files/neg/t8700b/Bar_2.scala | 1 + test/files/neg/t8704.check | 6 +- test/files/neg/t8704.flags | 1 - test/files/neg/t8704.scala | 1 + test/files/neg/t8731.check | 2 +- test/files/neg/t8731.flags | 1 - test/files/neg/t8731.scala | 1 + test/files/neg/t8736-c.check | 2 +- test/files/neg/t8736-c.flags | 1 - test/files/neg/t8736-c.scala | 1 + test/files/neg/t9127.check | 6 +- test/files/neg/t9127.flags | 1 - test/files/neg/t9127.scala | 1 + test/files/neg/t9398.check | 2 +- test/files/neg/t9398.flags | 1 - test/files/neg/t9398/data.scala | 1 + test/files/neg/t9398/match.scala | 1 + test/files/neg/t9617.check | 4 +- test/files/neg/t9617/Test.flags | 1 - test/files/neg/t9617/Test.scala | 1 + test/files/neg/t9636.check | 2 +- test/files/neg/t9636.flags | 1 - test/files/neg/t9636.scala | 1 + test/files/neg/t9675.check | 16 +-- test/files/neg/t9675.flags | 1 - test/files/neg/t9675.scala | 1 + test/files/neg/t9684.check | 4 +- test/files/neg/t9684.flags | 1 - test/files/neg/t9684.scala | 1 + test/files/neg/t9834.check | 2 +- test/files/neg/t9834.flags | 1 - test/files/neg/t9834.scala | 1 + test/files/neg/t9847.check | 28 ++--- test/files/neg/t9847.flags | 1 - test/files/neg/t9847.scala | 1 + test/files/neg/t9953.check | 2 +- test/files/neg/t9953.flags | 1 - test/files/neg/t9953.scala | 1 + .../trait_fields_deprecated_overriding.check | 2 +- .../trait_fields_deprecated_overriding.flags | 1 - .../trait_fields_deprecated_overriding.scala | 3 +- test/files/neg/unchecked-abstract.check | 24 ++--- test/files/neg/unchecked-abstract.flags | 1 - test/files/neg/unchecked-abstract.scala | 1 + test/files/neg/unchecked-impossible.check | 4 +- test/files/neg/unchecked-impossible.flags | 1 - test/files/neg/unchecked-impossible.scala | 1 + test/files/neg/unchecked-knowable.check | 4 +- test/files/neg/unchecked-knowable.flags | 1 - test/files/neg/unchecked-knowable.scala | 1 + test/files/neg/unchecked-refinement.check | 8 +- test/files/neg/unchecked-refinement.flags | 1 - test/files/neg/unchecked-refinement.scala | 1 + test/files/neg/unchecked-suppress.check | 6 +- test/files/neg/unchecked-suppress.flags | 1 - test/files/neg/unchecked-suppress.scala | 1 + test/files/neg/unchecked.check | 12 +-- test/files/neg/unchecked.flags | 1 - test/files/neg/unchecked.scala | 1 + test/files/neg/unchecked2.check | 28 ++--- test/files/neg/unchecked2.flags | 1 - test/files/neg/unchecked2.scala | 1 + test/files/neg/unchecked3.check | 26 ++--- test/files/neg/unchecked3.flags | 1 - test/files/neg/unchecked3.scala | 1 + test/files/neg/unit-returns-value.check | 8 +- test/files/neg/unit-returns-value.flags | 1 - test/files/neg/unit-returns-value.scala | 1 + test/files/neg/unreachablechar.check | 6 +- test/files/neg/unreachablechar.flags | 1 - test/files/neg/unreachablechar.scala | 1 + test/files/neg/virtpatmat_exhaust_big.check | 2 +- test/files/neg/virtpatmat_exhaust_big.flags | 1 - test/files/neg/virtpatmat_exhaust_big.scala | 1 + .../neg/virtpatmat_exhaust_compound.check | 6 +- .../neg/virtpatmat_exhaust_compound.flags | 1 - .../neg/virtpatmat_exhaust_compound.scala | 1 + test/files/neg/virtpatmat_reach_null.check | 2 +- test/files/neg/virtpatmat_reach_null.flags | 1 - test/files/neg/virtpatmat_reach_null.scala | 1 + .../virtpatmat_reach_sealed_unsealed.check | 8 +- .../virtpatmat_reach_sealed_unsealed.flags | 1 - .../virtpatmat_reach_sealed_unsealed.scala | 3 +- .../files/neg/virtpatmat_unreach_select.check | 2 +- .../files/neg/virtpatmat_unreach_select.flags | 1 - .../files/neg/virtpatmat_unreach_select.scala | 1 + test/files/neg/warn-inferred-any.check | 8 +- test/files/neg/warn-inferred-any.flags | 1 - test/files/neg/warn-inferred-any.scala | 1 + test/files/neg/warn-unused-implicits.check | 4 +- test/files/neg/warn-unused-implicits.flags | 1 - test/files/neg/warn-unused-implicits.scala | 1 + test/files/neg/warn-unused-imports.check | 34 +++--- test/files/neg/warn-unused-imports.flags | 1 - .../neg/warn-unused-imports/sample_1.scala | 1 + .../warn-unused-imports_2.scala | 1 + test/files/neg/warn-unused-locals.check | 14 +-- test/files/neg/warn-unused-locals.flags | 1 - test/files/neg/warn-unused-locals.scala | 1 + test/files/neg/warn-unused-params.check | 14 +-- test/files/neg/warn-unused-params.flags | 1 - test/files/neg/warn-unused-params.scala | 1 + test/files/neg/warn-unused-patvars.check | 2 +- test/files/neg/warn-unused-patvars.flags | 1 - test/files/neg/warn-unused-patvars.scala | 1 + test/files/neg/warn-unused-privates.check | 46 ++++---- test/files/neg/warn-unused-privates.flags | 1 - test/files/neg/warn-unused-privates.scala | 1 + test/files/pos/annotated-treecopy.flags | 1 - .../annotated-treecopy/Impls_Macros_1.scala | 3 +- .../files/pos/annotated-treecopy/Test_2.scala | 3 +- .../pos/attachments-typed-another-ident.flags | 1 - .../Impls_1.scala | 1 + .../Macros_Test_2.scala | 1 + test/files/pos/attachments-typed-ident.flags | 1 - .../pos/attachments-typed-ident/Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../pos/case-object-add-serializable.flags | 1 - .../pos/case-object-add-serializable.scala | 1 + test/files/pos/classtag-pos.flags | 1 - test/files/pos/classtag-pos.scala | 1 + test/files/pos/comp-rec-test.flags | 1 - test/files/pos/comp-rec-test.scala | 1 + test/files/pos/cycle-jsoup.flags | 1 - test/files/pos/cycle-jsoup/Test_2.scala | 1 + test/files/pos/cycle.flags | 1 - test/files/pos/cycle/X_2.scala | 1 + test/files/pos/debug-reset-local-attrs.flags | 1 - test/files/pos/debug-reset-local-attrs.scala | 1 + test/files/pos/dotless-targs-ranged.flags | 1 - test/files/pos/dotless-targs-ranged.scala | 1 + test/files/pos/dotless-targs.flags | 1 - test/files/pos/dotless-targs.scala | 1 + test/files/pos/exhaust_alternatives.flags | 1 - test/files/pos/exhaust_alternatives.scala | 3 +- .../files/pos/existential-slow-compile1.flags | 1 - .../files/pos/existential-slow-compile1.scala | 1 + test/files/pos/generic-sigs.flags | 1 - test/files/pos/generic-sigs.scala | 1 + test/files/pos/hkarray.flags | 1 - test/files/pos/hkarray.scala | 3 +- test/files/pos/implicit-anyval-2.10.flags | 1 - test/files/pos/implicit-anyval-2.10.scala | 3 +- test/files/pos/infer_override_def_args.flags | 1 - test/files/pos/infer_override_def_args.scala | 3 +- test/files/pos/infersingle.flags | 1 - test/files/pos/infersingle.scala | 1 + test/files/pos/inline-access-levels.flags | 1 - test/files/pos/inline-access-levels/A_1.scala | 1 + .../pos/inline-access-levels/Test_2.scala | 1 + .../java-import-static-from-subclass.flags | 1 - .../Test.scala | 1 + ...eprecate-dont-touch-backquotedidents.flags | 1 - ...eprecate-dont-touch-backquotedidents.scala | 3 +- test/files/pos/native-warning.flags | 1 - test/files/pos/native-warning.scala | 1 + test/files/pos/nonlocal-unchecked.flags | 1 - test/files/pos/nonlocal-unchecked.scala | 1 + test/files/pos/override-object-yes.flags | 1 - test/files/pos/override-object-yes.scala | 1 + test/files/pos/package-ob-case.flags | 1 - test/files/pos/package-ob-case/A_1.scala | 1 + test/files/pos/package-ob-case/B_2.scala | 1 + test/files/pos/patmat-hk.flags | 1 - test/files/pos/patmat-hk.scala | 1 + test/files/pos/patmat-suppress.flags | 1 - test/files/pos/patmat-suppress.scala | 1 + test/files/pos/polymorphic-case-class.flags | 1 - test/files/pos/polymorphic-case-class.scala | 1 + test/files/pos/proj-rec-test.flags | 1 - test/files/pos/proj-rec-test.scala | 1 + test/files/pos/rangepos-anonapply.flags | 1 - test/files/pos/rangepos-anonapply.scala | 1 + test/files/pos/rangepos-patmat.flags | 1 - test/files/pos/rangepos-patmat.scala | 1 + test/files/pos/rangepos.flags | 1 - test/files/pos/rangepos.scala | 1 + test/files/pos/setter-not-implicit.flags | 1 - test/files/pos/setter-not-implicit.scala | 1 + test/files/pos/t10093.flags | 1 - test/files/pos/t10093.scala | 1 + test/files/pos/t10185.flags | 1 - test/files/pos/t10185.scala | 1 + test/files/pos/t10195.flags | 1 - test/files/pos/t10195.scala | 1 + test/files/pos/t10195b.flags | 1 - test/files/pos/t10195b.scala | 1 + test/files/pos/t10197.flags | 1 - test/files/pos/t10197.scala | 1 + test/files/pos/t10213.flags | 1 - test/files/pos/t10213.scala | 1 + test/files/pos/t10238.flags | 1 - test/files/pos/t10238.scala | 1 + test/files/pos/t10270.flags | 1 - test/files/pos/t10270/Macros_1.scala | 1 + test/files/pos/t10270/Main_2.scala | 1 + test/files/pos/t10288.flags | 1 - test/files/pos/t10288.scala | 3 +- test/files/pos/t10296-before.flags | 1 - .../pos/t10296-before/UnusedMacro_1.scala | 1 + test/files/pos/t10296-before/Unused_2.scala | 1 + test/files/pos/t10296.flags | 1 - test/files/pos/t10296/UnusedMacro_1.scala | 1 + test/files/pos/t10296/Unused_2.scala | 1 + test/files/pos/t10372.flags | 1 - test/files/pos/t10372.scala | 1 + test/files/pos/t10394.flags | 1 - test/files/pos/t10394.scala | 1 + test/files/pos/t10623.flags | 1 - test/files/pos/t10623.scala | 1 + test/files/pos/t10643.flags | 1 - test/files/pos/t10643.scala | 1 + test/files/pos/t10644.flags | 1 - test/files/pos/t10644/Objs_1.scala | 1 + test/files/pos/t10644/Test_2.scala | 3 +- test/files/pos/t10763.flags | 1 - test/files/pos/t10763.scala | 1 + test/files/pos/t11538.flags | 1 - test/files/pos/t11538.scala | 3 +- test/files/pos/t11917.flags | 1 - test/files/pos/t11917/Z.scala | 3 +- test/files/pos/t1439.flags | 1 - test/files/pos/t1439.scala | 1 + test/files/pos/t1803.flags | 1 - test/files/pos/t1803.scala | 1 + test/files/pos/t2066-2.10-compat.flags | 1 - test/files/pos/t2066-2.10-compat.scala | 1 + test/files/pos/t2712-1.flags | 1 - test/files/pos/t2712-1.scala | 1 + test/files/pos/t2712-2.flags | 2 - test/files/pos/t2712-2.scala | 1 + test/files/pos/t2712-3.flags | 2 - test/files/pos/t2712-3.scala | 1 + test/files/pos/t2712-4.flags | 2 - test/files/pos/t2712-4.scala | 1 + test/files/pos/t2712-5.flags | 1 - test/files/pos/t2712-5.scala | 1 + test/files/pos/t2712-6.flags | 1 - test/files/pos/t2712-6.scala | 1 + test/files/pos/t2712-7.flags | 1 - test/files/pos/t2712-7.scala | 1 + test/files/pos/t2799.flags | 1 - test/files/pos/t2799.scala | 1 + test/files/pos/t3234.flags | 1 - test/files/pos/t3234.scala | 1 + test/files/pos/t3368.flags | 1 - test/files/pos/t3368.scala | 1 + test/files/pos/t3420.flags | 1 - test/files/pos/t3420.scala | 1 + test/files/pos/t3495.flags | 1 - test/files/pos/t3495.scala | 1 + test/files/pos/t3960.flags | 1 - test/files/pos/t3960.scala | 1 + test/files/pos/t4020.flags | 1 - test/files/pos/t4020.scala | 3 +- test/files/pos/t4494.flags | 1 - test/files/pos/t4494.scala | 1 + test/files/pos/t4649.flags | 1 - test/files/pos/t4649.scala | 1 + test/files/pos/t4744.flags | 1 - test/files/pos/t4744/Bar.scala | 1 + test/files/pos/t4840.flags | 1 - test/files/pos/t4840.scala | 1 + test/files/pos/t4911.flags | 1 - test/files/pos/t4911.scala | 3 +- test/files/pos/t5029.flags | 1 - test/files/pos/t5029.scala | 3 +- test/files/pos/t5165b.flags | 1 - test/files/pos/t5165b/TestObject_3.scala | 1 + test/files/pos/t5165b/TestTrait_2.scala | 1 + test/files/pos/t5175.flags | 1 - test/files/pos/t5175.scala | 1 + test/files/pos/t5542.flags | 1 - test/files/pos/t5542.scala | 3 +- test/files/pos/t5639.flags | 1 - test/files/pos/t5639/A_1.scala | 1 + test/files/pos/t5639/A_2.scala | 1 + test/files/pos/t5683.flags | 1 - test/files/pos/t5683.scala | 1 + test/files/pos/t5706.flags | 1 - test/files/pos/t5706.scala | 1 + test/files/pos/t5809.flags | 1 - test/files/pos/t5809.scala | 1 + test/files/pos/t5818.flags | 1 - test/files/pos/t5818.scala | 1 + test/files/pos/t5897.flags | 1 - test/files/pos/t5897.scala | 1 + test/files/pos/t5899.flags | 1 - test/files/pos/t5899.scala | 3 +- test/files/pos/t5930.flags | 1 - test/files/pos/t5930.scala | 3 +- test/files/pos/t5932.flags | 1 - test/files/pos/t5932.scala | 1 + test/files/pos/t5954c.flags | 1 - test/files/pos/t5954c/A_1.scala | 1 + test/files/pos/t5954c/B_2.scala | 1 + test/files/pos/t5954d.flags | 1 - test/files/pos/t5954d/A_1.scala | 1 + test/files/pos/t5954d/B_2.scala | 1 + test/files/pos/t5968.flags | 1 - test/files/pos/t5968.scala | 1 + test/files/pos/t6008.flags | 1 - test/files/pos/t6008.scala | 3 +- test/files/pos/t6022.flags | 1 - test/files/pos/t6022.scala | 3 +- test/files/pos/t6047.flags | 1 - test/files/pos/t6047.scala | 3 +- test/files/pos/t6091.flags | 1 - test/files/pos/t6091.scala | 1 + .../pos/t6123-explaintypes-implicits.flags | 1 - .../pos/t6123-explaintypes-implicits.scala | 1 + test/files/pos/t6146.flags | 1 - test/files/pos/t6146.scala | 1 + test/files/pos/t6162-inheritance.flags | 1 - test/files/pos/t6162-inheritance.scala | 1 + test/files/pos/t6210.flags | 1 - test/files/pos/t6210.scala | 1 + test/files/pos/t6260.flags | 1 - test/files/pos/t6260.scala | 1 + test/files/pos/t6275.flags | 1 - test/files/pos/t6275.scala | 1 + test/files/pos/t6537.flags | 1 - test/files/pos/t6537.scala | 1 + test/files/pos/t6595.flags | 1 - test/files/pos/t6595.scala | 1 + test/files/pos/t6675.flags | 1 - test/files/pos/t6675.scala | 1 + test/files/pos/t6771.flags | 1 - test/files/pos/t6771.scala | 1 + test/files/pos/t6891.flags | 1 - test/files/pos/t6891.scala | 1 + test/files/pos/t6895b-2.flags | 1 - test/files/pos/t6895b-2.scala | 1 + test/files/pos/t6895b.flags | 2 - test/files/pos/t6895b.scala | 1 + test/files/pos/t6896.flags | 1 - test/files/pos/t6896.scala | 1 + test/files/pos/t6942.flags | 1 - test/files/pos/t6942/t6942.scala | 1 + test/files/pos/t6963c.flags | 1 - test/files/pos/t6963c.scala | 1 + test/files/pos/t6978.flags | 1 - test/files/pos/t6978/S.scala | 1 + test/files/pos/t6994.flags | 1 - test/files/pos/t6994.scala | 1 + test/files/pos/t7011.flags | 1 - test/files/pos/t7011.scala | 3 +- test/files/pos/t7183.flags | 1 - test/files/pos/t7183.scala | 1 + test/files/pos/t7232.flags | 1 - test/files/pos/t7232/Test.scala | 1 + test/files/pos/t7232b.flags | 1 - test/files/pos/t7232b/Test.scala | 1 + test/files/pos/t7232c.flags | 1 - test/files/pos/t7232c/Test.scala | 1 + test/files/pos/t7232d.flags | 1 - test/files/pos/t7232d/Test.scala | 1 + test/files/pos/t7285a.flags | 1 - test/files/pos/t7285a.scala | 1 + test/files/pos/t7315.flags | 1 - test/files/pos/t7315.scala | 3 +- test/files/pos/t7369.flags | 1 - test/files/pos/t7369.scala | 3 +- test/files/pos/t7427.flags | 1 - test/files/pos/t7427.scala | 1 + test/files/pos/t7433.flags | 1 - test/files/pos/t7433.scala | 1 + test/files/pos/t7551.flags | 1 - test/files/pos/t7551/T.scala | 1 + test/files/pos/t7551/Test.scala | 1 + test/files/pos/t7649.flags | 1 - test/files/pos/t7649.scala | 1 + .../t7683-stop-after-parser/sample_2.flags | 1 - .../t7683-stop-after-parser/sample_2.scala | 1 + test/files/pos/t7750.flags | 1 - test/files/pos/t7750.scala | 1 + test/files/pos/t7864.flags | 1 - test/files/pos/t7864.scala | 1 + test/files/pos/t8001.flags | 1 - test/files/pos/t8001/Macros_1.scala | 3 +- test/files/pos/t8001/Test_2.scala | 3 +- test/files/pos/t8013.flags | 1 - test/files/pos/t8013/inpervolated_2.scala | 1 + test/files/pos/t8013/inpervolator_1.scala | 1 + test/files/pos/t8040.flags | 1 - test/files/pos/t8040.scala | 1 + test/files/pos/t8064.flags | 1 - test/files/pos/t8064/Client_2.scala | 3 +- test/files/pos/t8064/Macro_1.scala | 1 + test/files/pos/t8064b.flags | 1 - test/files/pos/t8064b/Client_2.scala | 3 +- test/files/pos/t8064b/Macro_1.scala | 1 + test/files/pos/t8157-2.10.flags | 1 - test/files/pos/t8157-2.10.scala | 1 + test/files/pos/t8363.flags | 1 - test/files/pos/t8363.scala | 1 + test/files/pos/t8410.flags | 1 - test/files/pos/t8410.scala | 1 + test/files/pos/t8523.flags | 1 - test/files/pos/t8523.scala | 3 +- test/files/pos/t8546.flags | 1 - test/files/pos/t8546.scala | 3 +- test/files/pos/t8578.flags | 1 - test/files/pos/t8578.scala | 3 +- test/files/pos/t8596.flags | 1 - test/files/pos/t8596.scala | 1 + test/files/pos/t8617.flags | 1 - test/files/pos/t8617.scala | 1 + test/files/pos/t8736-b.flags | 1 - test/files/pos/t8736.flags | 1 - test/files/pos/t8781/Test_2.flags | 1 - test/files/pos/t8781/Test_2.scala | 1 + test/files/pos/t8828.flags | 1 - test/files/pos/t8828.scala | 1 + test/files/pos/t8861.flags | 1 - test/files/pos/t8861.scala | 1 + test/files/pos/t8934a/Test_2.flags | 1 - test/files/pos/t8934a/Test_2.scala | 1 + test/files/pos/t8954.flags | 1 - test/files/pos/t8954/t1.scala | 1 + test/files/pos/t8954/t2.scala | 1 + test/files/pos/t8965.flags | 1 - test/files/pos/t8965.scala | 1 + test/files/pos/t8999.flags | 1 - test/files/pos/t8999.scala | 3 +- test/files/pos/t9020.flags | 1 - test/files/pos/t9020.scala | 1 + test/files/pos/t9111-inliner-workaround.flags | 1 - .../pos/t9111-inliner-workaround/Test_1.scala | 1 + test/files/pos/t9178b.flags | 1 - test/files/pos/t9178b.scala | 1 + test/files/pos/t9220.flags | 1 - test/files/pos/t9220.scala | 1 + test/files/pos/t9285.flags | 1 - test/files/pos/t9285.scala | 1 + test/files/pos/t9369.flags | 1 - test/files/pos/t9369.scala | 3 +- test/files/pos/t9370/sample_2.flags | 1 - test/files/pos/t9370/sample_2.scala | 1 + test/files/pos/t9399.flags | 1 - test/files/pos/t9399.scala | 1 + test/files/pos/t9411a.flags | 1 - test/files/pos/t9411a.scala | 1 + test/files/pos/t9411b.flags | 1 - test/files/pos/t9411b.scala | 1 + test/files/pos/t9630.flags | 1 - test/files/pos/t9630/t9630a.scala | 1 + test/files/pos/t9630/t9630b.scala | 1 + test/files/pos/unchecked-a.flags | 1 - test/files/pos/unchecked-a.scala | 1 + .../pos/value-class-override-no-spec.flags | 1 - .../pos/value-class-override-no-spec.scala | 1 + test/files/pos/virtpatmat_alts_subst.flags | 1 - test/files/pos/virtpatmat_alts_subst.scala | 1 + test/files/pos/virtpatmat_binding_opt.flags | 1 - test/files/pos/virtpatmat_binding_opt.scala | 1 + test/files/pos/virtpatmat_castbinder.flags | 1 - test/files/pos/virtpatmat_castbinder.scala | 3 +- .../pos/virtpatmat_exhaust_unchecked.flags | 1 - .../pos/virtpatmat_exhaust_unchecked.scala | 1 + test/files/pos/virtpatmat_exist1.flags | 1 - test/files/pos/virtpatmat_exist1.scala | 1 + test/files/pos/virtpatmat_exist2.flags | 1 - test/files/pos/virtpatmat_exist2.scala | 3 +- test/files/pos/virtpatmat_exist3.flags | 1 - test/files/pos/virtpatmat_exist3.scala | 3 +- test/files/pos/virtpatmat_gadt_array.flags | 1 - test/files/pos/virtpatmat_gadt_array.scala | 3 +- .../files/pos/virtpatmat_infer_single_1.flags | 1 - .../files/pos/virtpatmat_infer_single_1.scala | 3 +- .../pos/virtpatmat_instof_valuetype.flags | 1 - .../pos/virtpatmat_instof_valuetype.scala | 3 +- test/files/pos/virtpatmat_obj_in_case.flags | 1 - test/files/pos/virtpatmat_obj_in_case.scala | 3 +- .../warn-unused-params-not-implicits.flags | 1 - .../warn-unused-params-not-implicits.scala | 1 + test/files/pos/xlint1.flags | 1 - test/files/pos/xlint1.scala | 1 + test/files/pos/z1730.flags | 1 - test/files/pos/z1730.scala | 1 + test/files/presentation/ide-t1000976.check | 3 +- test/files/presentation/ide-t1000976.flags | 1 - .../presentation/ide-t1000976/Test.scala | 1 + test/files/presentation/t8085.check | 3 +- test/files/presentation/t8085.flags | 1 - test/files/presentation/t8085/Test.scala | 1 + test/files/presentation/t8085b.check | 3 +- test/files/presentation/t8085b.flags | 1 - test/files/presentation/t8085b/Test.scala | 1 + test/files/run/abstype_implicits.flags | 1 - test/files/run/abstype_implicits.scala | 1 + test/files/run/anyval-box-types.flags | 1 - test/files/run/anyval-box-types.scala | 3 +- test/files/run/applydynamic_sip.flags | 2 - test/files/run/applydynamic_sip.scala | 1 + .../bcodeInlinerMixed.check} | 0 test/files/run/bcodeInlinerMixed.flags | 1 - test/files/run/bcodeInlinerMixed/B_1.scala | 1 + test/files/run/bcodeInlinerMixed/Test_2.scala | 1 + test/files/run/checked.check | 4 +- test/files/run/checked.flags | 1 - test/files/run/checked.scala | 1 + test/files/run/checkinit.check | 4 +- test/files/run/checkinit.flags | 1 - test/files/run/checkinit.scala | 1 + .../delambdafy-dependent-on-param-subst.flags | 1 - .../delambdafy-dependent-on-param-subst.scala | 1 + .../files/run/deprecate-early-type-defs.check | 2 +- .../files/run/deprecate-early-type-defs.flags | 1 - .../files/run/deprecate-early-type-defs.scala | 3 +- test/files/run/disable-assertions.flags | 1 - test/files/run/disable-assertions.scala | 1 + test/files/run/elidable-opt.flags | 1 - test/files/run/elidable-opt.scala | 1 + test/files/run/elidable.flags | 1 - test/files/run/elidable.scala | 1 + test/files/run/finalvar.flags | 1 - test/files/run/finalvar.scala | 3 +- test/files/run/hk-typevar-unification.flags | 1 - test/files/run/hk-typevar-unification.scala | 1 + test/files/run/indy-meth-refs-b.flags | 1 - test/files/run/indy-meth-refs-b.scala | 1 + test/files/run/indy-meth-refs-c.flags | 1 - test/files/run/indy-meth-refs-c.scala | 1 + test/files/run/indy-meth-refs-d.flags | 1 - test/files/run/indy-meth-refs-d.scala | 1 + test/files/run/indy-meth-refs-e.flags | 1 - test/files/run/indy-meth-refs-e.scala | 1 + test/files/run/indy-meth-refs-f.flags | 1 - test/files/run/indy-meth-refs-f.scala | 1 + test/files/run/indy-meth-refs-g.flags | 1 - test/files/run/indy-meth-refs-g.scala | 1 + test/files/run/indy-meth-refs-h.flags | 1 - test/files/run/indy-meth-refs-h.scala | 1 + test/files/run/indy-meth-refs-i.flags | 1 - test/files/run/indy-meth-refs-i.scala | 1 + test/files/run/indy-meth-refs.flags | 1 - test/files/run/indy-meth-refs.scala | 1 + .../run/inferred-type-constructors-hou.flags | 1 - .../run/inferred-type-constructors-hou.scala | 1 + .../run/interop_typetags_are_manifests.flags | 1 - .../run/interop_typetags_are_manifests.scala | 3 +- test/files/run/kmpSliceSearch.flags | 1 - test/files/run/kmpSliceSearch.scala | 1 + .../run/lambda-serialization-meth-ref.flags | 1 - .../run/lambda-serialization-meth-ref.scala | 1 + test/files/run/literals.check | 8 +- test/files/run/literals.flags | 1 - test/files/run/literals.scala | 1 + test/files/run/macro-abort-fresh.flags | 1 - .../run/macro-abort-fresh/Macros_1.scala | 3 +- test/files/run/macro-abort-fresh/Test_2.scala | 3 +- test/files/run/macro-basic-ma-md-mi.flags | 1 - .../run/macro-basic-ma-md-mi/Impls_1.scala | 3 +- .../run/macro-basic-ma-md-mi/Macros_2.scala | 3 +- .../run/macro-basic-ma-md-mi/Test_3.scala | 3 +- test/files/run/macro-basic-ma-mdmi.flags | 1 - .../macro-basic-ma-mdmi/Impls_Macros_1.scala | 3 +- .../run/macro-basic-ma-mdmi/Test_2.scala | 3 +- test/files/run/macro-basic-mamd-mi.flags | 1 - .../run/macro-basic-mamd-mi/Impls_1.scala | 3 +- .../macro-basic-mamd-mi/Macros_Test_2.scala | 3 +- test/files/run/macro-bodyexpandstoimpl.flags | 1 - .../run/macro-bodyexpandstoimpl/Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- test/files/run/macro-bundle-toplevel.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../run/macro-bundle-toplevel/Test_2.scala | 3 +- test/files/run/macro-def-path-dependent.flags | 1 - .../run/macro-def-path-dependent/Dummy.scala | 3 +- .../run/macro-def-path-dependent/Test_1.scala | 1 + .../run/macro-def-path-dependent/Test_2.scala | 1 + .../run/macro-def-path-dependent/Test_3.scala | 1 + .../run/macro-def-path-dependent/Test_4.scala | 3 +- .../run/macro-def-path-dependent/Test_5.scala | 3 +- .../run/macro-def-path-dependent/Test_6.scala | 3 +- test/files/run/macro-duplicate.check | 2 +- test/files/run/macro-duplicate.flags | 1 - .../run/macro-duplicate/Impls_Macros_1.scala | 1 + test/files/run/macro-duplicate/Test_2.scala | 3 +- test/files/run/macro-enclosures.flags | 1 - .../run/macro-enclosures/Impls_Macros_1.scala | 3 +- test/files/run/macro-enclosures/Test_2.scala | 3 +- .../run/macro-expand-implicit-argument.flags | 1 - .../Macros_1.scala | 3 +- .../Test_2.scala | 3 +- ...o-expand-implicit-macro-has-implicit.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- ...ro-expand-implicit-macro-is-implicit.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 1 + .../macro-expand-implicit-macro-is-val.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../run/macro-expand-multiple-arglists.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../run/macro-expand-nullary-generic.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../run/macro-expand-nullary-nongeneric.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- test/files/run/macro-expand-overload.flags | 1 - .../run/macro-expand-overload/Impls_1.scala | 3 +- .../macro-expand-overload/Macros_Test_2.scala | 3 +- test/files/run/macro-expand-override.flags | 1 - .../run/macro-expand-override/Impls_1.scala | 3 +- .../macro-expand-override/Macros_Test_2.scala | 3 +- test/files/run/macro-expand-recursive.flags | 1 - .../run/macro-expand-recursive/Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../run/macro-expand-tparams-bounds.flags | 1 - .../macro-expand-tparams-bounds/Impls_1.scala | 1 + .../Macros_Test_2.scala | 1 + .../run/macro-expand-tparams-explicit.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../run/macro-expand-tparams-implicit.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../run/macro-expand-tparams-prefix.flags | 1 - .../macro-expand-tparams-prefix/Impls_1.scala | 1 + .../Macros_Test_2.scala | 3 +- test/files/run/macro-expand-unapply-a.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../run/macro-expand-unapply-a/Test_2.scala | 3 +- ...varargs-explicit-over-nonvarargs-bad.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- ...arargs-explicit-over-nonvarargs-good.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- ...expand-varargs-explicit-over-varargs.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- ...and-varargs-implicit-over-nonvarargs.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- ...expand-varargs-implicit-over-varargs.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../files/run/macro-impl-default-params.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../macro-impl-default-params/Test_2.scala | 3 +- .../files/run/macro-impl-rename-context.flags | 1 - .../Impls_Macros_1.scala | 1 + .../macro-impl-rename-context/Test_2.scala | 3 +- .../run/macro-impl-tparam-only-in-impl.flags | 1 - .../Impls_1.scala | 1 + .../Macros_Test_2.scala | 3 +- ...acro-impl-tparam-typetag-is-optional.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- test/files/run/macro-implicit-decorator.flags | 1 - .../macro-implicit-decorator/Macros_1.scala | 1 + .../run/macro-implicit-decorator/Test_2.scala | 1 + ...lidret-doesnt-conform-to-def-rettype.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../Test_2.scala | 3 +- .../run/macro-invalidret-nontypeable.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../macro-invalidret-nontypeable/Test_2.scala | 3 +- .../files/run/macro-invalidusage-badret.flags | 1 - .../Impls_Macros_1.scala | 1 + .../macro-invalidusage-badret/Test_2.scala | 1 + ...sage-partialapplication-with-tparams.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../Test_2.scala | 1 + ...acro-invalidusage-partialapplication.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../Test_2.scala | 1 + test/files/run/macro-openmacros.check | 6 +- test/files/run/macro-openmacros.flags | 2 - .../run/macro-openmacros/Impls_Macros_1.scala | 3 +- test/files/run/macro-openmacros/Test_2.scala | 1 + test/files/run/macro-parse-position.flags | 1 - .../macro-parse-position/Impls_Macros_1.scala | 3 +- .../run/macro-parse-position/Test_2.scala | 1 + test/files/run/macro-quasiinvalidbody-c.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../run/macro-quasiinvalidbody-c/Test_2.scala | 3 +- test/files/run/macro-range.flags | 1 - test/files/run/macro-range/Common_1.scala | 1 + .../macro-range/Expansion_Impossible_2.scala | 3 +- .../macro-range/Expansion_Possible_3.scala | 3 +- test/files/run/macro-rangepos-args.check | 2 +- test/files/run/macro-rangepos-args.flags | 1 - .../run/macro-rangepos-args/Macros_1.scala | 1 + .../run/macro-rangepos-args/Test_2.scala | 3 +- .../run/macro-rangepos-subpatterns.flags | 1 - .../macro-rangepos-subpatterns/Macros_1.scala | 1 + .../macro-rangepos-subpatterns/Test_2.scala | 1 + .../run/macro-reflective-ma-normal-mdmi.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../Test_2.scala | 1 + test/files/run/macro-reify-basic.flags | 1 - .../run/macro-reify-basic/Macros_1.scala | 3 +- test/files/run/macro-reify-basic/Test_2.scala | 3 +- test/files/run/macro-reify-freevars.check | 2 +- test/files/run/macro-reify-freevars.flags | 1 - .../run/macro-reify-freevars/Macros_1.scala | 3 +- .../run/macro-reify-freevars/Test_2.scala | 3 +- .../run/macro-reify-ref-to-packageless.flags | 1 - .../Impls_1.scala | 1 + .../Test_2.scala | 3 +- .../macro-reify-splice-outside-reify.flags | 1 - .../Impls_Macros_1.scala | 1 + .../Test_2.scala | 1 + test/files/run/macro-reify-staticXXX.flags | 1 - .../run/macro-reify-staticXXX/Macros_1.scala | 1 + .../run/macro-reify-staticXXX/Test_2.scala | 1 + test/files/run/macro-reify-tagful-a.flags | 1 - .../run/macro-reify-tagful-a/Macros_1.scala | 3 +- .../run/macro-reify-tagful-a/Test_2.scala | 3 +- test/files/run/macro-reify-tagless-a.check | 2 +- test/files/run/macro-reify-tagless-a.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../run/macro-reify-tagless-a/Test_2.scala | 1 + test/files/run/macro-reify-type.flags | 1 - .../files/run/macro-reify-type/Macros_1.scala | 1 + test/files/run/macro-reify-type/Test_2.scala | 3 +- test/files/run/macro-reify-unreify.flags | 1 - .../run/macro-reify-unreify/Macros_1.scala | 3 +- .../run/macro-reify-unreify/Test_2.scala | 3 +- test/files/run/macro-settings.flags | 1 - .../run/macro-settings/Impls_Macros_1.scala | 3 +- test/files/run/macro-settings/Test_2.scala | 3 +- test/files/run/macro-sip19-revised.check | 8 +- test/files/run/macro-sip19-revised.flags | 1 - .../macro-sip19-revised/Impls_Macros_1.scala | 1 + .../run/macro-sip19-revised/Test_2.scala | 1 + test/files/run/macro-sip19.check | 8 +- test/files/run/macro-sip19.flags | 1 - .../run/macro-sip19/Impls_Macros_1.scala | 3 +- test/files/run/macro-sip19/Test_2.scala | 1 + .../macro-term-declared-in-annotation.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_2.scala | 3 +- .../Test_3.scala | 3 +- .../macro-term-declared-in-anonymous.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 1 + .../run/macro-term-declared-in-block.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../macro-term-declared-in-class-class.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../macro-term-declared-in-class-object.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../run/macro-term-declared-in-class.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- ...macro-term-declared-in-default-param.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- ...acro-term-declared-in-implicit-class.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../Test_2.scala | 3 +- .../run/macro-term-declared-in-method.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../macro-term-declared-in-object-class.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- ...macro-term-declared-in-object-object.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../run/macro-term-declared-in-object.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- ...acro-term-declared-in-package-object.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../macro-term-declared-in-refinement.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 1 + .../run/macro-term-declared-in-trait.flags | 1 - .../Impls_1.scala | 3 +- .../Macros_Test_2.scala | 3 +- .../macro-typecheck-implicitsdisabled.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../Test_2.scala | 3 +- .../run/macro-typecheck-macrosdisabled.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../Test_2.scala | 3 +- .../run/macro-typecheck-macrosdisabled2.flags | 1 - .../Impls_Macros_1.scala | 1 + .../Test_2.scala | 3 +- .../run/macro-undetparams-consfromsls.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../Test_2.scala | 3 +- .../run/macro-undetparams-implicitval.flags | 1 - .../macro-undetparams-implicitval/Test.scala | 3 +- .../run/macro-undetparams-macroitself.flags | 1 - .../Impls_Macros_1.scala | 3 +- .../Test_2.scala | 3 +- .../run/macro-vampire-false-warning.flags | 1 - .../Macros_1.scala | 1 + .../macro-vampire-false-warning/Test_2.scala | 3 +- .../run/macroPlugins-isBlackbox/Test_3.flags | 1 - .../run/macroPlugins-isBlackbox/Test_3.scala | 3 +- test/files/run/macroPlugins-macroArgs.check | 4 +- .../run/macroPlugins-macroArgs/Macros_2.scala | 2 +- .../run/macroPlugins-macroArgs/Plugin_1.scala | 3 +- .../run/macroPlugins-macroArgs/Test_3.flags | 1 - .../run/macroPlugins-macroArgs/Test_3.scala | 2 +- test/files/run/macroPlugins-macroExpand.check | 4 +- test/files/run/macroPlugins-macroExpand.flags | 1 - .../macroPlugins-macroExpand/Macros_2.scala | 3 +- .../macroPlugins-macroExpand/Plugin_1.scala | 3 +- .../run/macroPlugins-macroExpand/Test_3.flags | 1 - .../run/macroPlugins-macroExpand/Test_3.scala | 3 +- .../files/run/macroPlugins-macroRuntime.check | 4 +- .../macroPlugins-macroRuntime/Macros_2.scala | 2 +- .../macroPlugins-macroRuntime/Plugin_1.scala | 3 +- .../macroPlugins-macroRuntime/Test_3.flags | 1 - .../macroPlugins-macroRuntime/Test_3.scala | 2 +- .../run/macroPlugins-typedMacroBody.flags | 1 - .../Macros_2.flags | 1 - .../Macros_2.scala | 3 +- .../Plugin_1.scala | 3 +- .../macroPlugins-typedMacroBody/Test_3.scala | 3 +- .../manifests-undeprecated-in-2.10.0.flags | 1 - .../manifests-undeprecated-in-2.10.0.scala | 3 +- test/files/run/nothingTypeDce.flags | 1 - test/files/run/nothingTypeDce.scala | 1 + test/files/run/nothingTypeNoOpt.flags | 1 - test/files/run/nothingTypeNoOpt.scala | 1 + test/files/run/primitive-sigs-2-new.flags | 1 - test/files/run/primitive-sigs-2-new.scala | 1 + test/files/run/primitive-sigs-2-old.flags | 1 - test/files/run/primitive-sigs-2-old.scala | 1 + test/files/run/pure-warning-post-macro.flags | 1 - .../run/pure-warning-post-macro/Macro_1.scala | 1 + .../run/pure-warning-post-macro/test_2.scala | 1 + test/files/run/synchronized.flags | 1 - test/files/run/synchronized.scala | 1 + test/files/run/t10067.flags | 1 - test/files/run/t10067/Test.scala | 1 + test/files/run/t10097.check | 2 +- test/files/run/t10097.flags | 1 - test/files/run/t10097.scala | 1 + test/files/run/t10283.flags | 1 - test/files/run/t10283.scala | 1 + test/files/run/t10439.flags | 1 - test/files/run/t10439.scala | 1 + test/files/run/t10692.flags | 1 - test/files/run/t10692.scala | 1 + test/files/run/t11255.flags | 1 - test/files/run/t11255/A_1.scala | 1 + test/files/run/t11255/Test_2.scala | 1 + test/files/run/t1167.flags | 1 - test/files/run/t1167.scala | 1 + test/files/run/t1503_future.flags | 1 - test/files/run/t1503_future.scala | 3 +- test/files/run/t1987.flags | 1 - test/files/run/t1987.scala | 1 + test/files/run/t2106.check | 2 +- test/files/run/t2106.flags | 1 - test/files/run/t2106.scala | 1 + test/files/run/t2251.flags | 1 - test/files/run/t2251.scala | 1 + test/files/run/t2251b.flags | 1 - test/files/run/t2251b.scala | 1 + test/files/run/t3038b.flags | 1 - test/files/run/t3038b.scala | 1 + test/files/run/t3038d.flags | 1 - test/files/run/t3038d.scala | 1 + test/files/run/t3235-minimal.check | 8 +- test/files/run/t3235-minimal.flags | 1 - test/files/run/t3235-minimal.scala | 1 + test/files/run/t3509.flags | 1 - test/files/run/t3509.scala | 3 +- test/files/run/t3518.check | 8 +- test/files/run/t3518.flags | 1 - test/files/run/t3518.scala | 1 + test/files/run/t3569.flags | 1 - test/files/run/t3569.scala | 1 + test/files/run/t3895.flags | 1 - test/files/run/t3895.scala | 1 + test/files/run/t3897.flags | 1 - test/files/run/t3897/a_1.scala | 1 + test/files/run/t3897/a_2.scala | 1 + test/files/run/t4072.flags | 1 - test/files/run/t4072.scala | 1 + test/files/run/t4201.check | 2 +- test/files/run/t4201.flags | 1 - test/files/run/t4201.scala | 1 + test/files/run/t4285.flags | 1 - test/files/run/t4285.scala | 1 + test/files/run/t4317.flags | 1 - test/files/run/t4317/S_1.scala | 1 + test/files/run/t4317/S_3.scala | 1 + test/files/run/t4536.flags | 1 - test/files/run/t4536.scala | 1 + test/files/run/t4742.flags | 1 - test/files/run/t4742.scala | 1 + test/files/run/t4935.flags | 1 - test/files/run/t4935.scala | 1 + test/files/run/t5040.flags | 1 - test/files/run/t5040.scala | 1 + test/files/run/t5568.flags | 1 - test/files/run/t5568.scala | 1 + test/files/run/t5648.flags | 1 - test/files/run/t5648.scala | 1 + test/files/run/t5676.flags | 1 - test/files/run/t5676.scala | 1 + test/files/run/t5704.flags | 1 - test/files/run/t5704.scala | 3 +- test/files/run/t5713.flags | 1 - test/files/run/t5713/Impls_Macros_1.scala | 3 +- test/files/run/t5713/Test_2.scala | 3 +- test/files/run/t5753_1.flags | 1 - test/files/run/t5753_1/Impls_Macros_1.scala | 3 +- test/files/run/t5753_1/Test_2.scala | 3 +- test/files/run/t5753_2.flags | 1 - test/files/run/t5753_2/Impls_Macros_1.scala | 1 + test/files/run/t5753_2/Test_2.scala | 3 +- test/files/run/t5830.flags | 1 - test/files/run/t5830.scala | 3 +- test/files/run/t5857.check | 4 +- test/files/run/t5857.flags | 1 - test/files/run/t5857.scala | 1 + test/files/run/t5903a.flags | 1 - test/files/run/t5903a/Macros_1.scala | 1 + test/files/run/t5903a/Test_2.scala | 1 + test/files/run/t5903b.flags | 1 - test/files/run/t5903b/Macros_1.scala | 1 + test/files/run/t5903b/Test_2.scala | 1 + test/files/run/t5903c.flags | 1 - test/files/run/t5903c/Macros_1.scala | 1 + test/files/run/t5903c/Test_2.scala | 1 + test/files/run/t5903d.flags | 1 - test/files/run/t5903d/Macros_1.scala | 1 + test/files/run/t5903d/Test_2.scala | 1 + test/files/run/t5905-features.flags | 1 - test/files/run/t5905-features.scala | 1 + test/files/run/t6102.flags | 1 - test/files/run/t6102.scala | 1 + test/files/run/t6188.flags | 1 - test/files/run/t6188.scala | 1 + test/files/run/t6327.flags | 1 - test/files/run/t6327.scala | 1 + test/files/run/t6394a.flags | 1 - test/files/run/t6394a/Macros_1.scala | 3 +- test/files/run/t6394a/Test_2.scala | 3 +- test/files/run/t6394b.flags | 1 - test/files/run/t6394b/Macros_1.scala | 3 +- test/files/run/t6394b/Test_2.scala | 3 +- test/files/run/t6541.flags | 1 - test/files/run/t6541.scala | 1 + test/files/run/t6663.flags | 1 - test/files/run/t6663.scala | 1 + test/files/run/t6731.flags | 1 - test/files/run/t6731.scala | 1 + test/files/run/t7171.check | 4 +- test/files/run/t7171.flags | 1 - test/files/run/t7171.scala | 1 + test/files/run/t7341.flags | 1 - test/files/run/t7341.scala | 1 + test/files/run/t7407.flags | 1 - test/files/run/t7407.scala | 1 + test/files/run/t7459b-optimize.flags | 1 - test/files/run/t7459b-optimize.scala | 1 + test/files/run/t7582.check | 2 +- test/files/run/t7582.flags | 1 - test/files/run/t7582/InlineHolder_2.scala | 1 + test/files/run/t7582b.check | 2 +- test/files/run/t7582b.flags | 1 - test/files/run/t7582b/InlineHolder_2.scala | 1 + test/files/run/t7584.flags | 1 - test/files/run/t7584.scala | 1 + test/files/run/t7852.flags | 1 - test/files/run/t7852.scala | 1 + test/files/run/t7974.flags | 1 - test/files/run/t7974/Symbols.scala | 1 + test/files/run/t7974/Test.scala | 1 + test/files/run/t8017.flags | 1 - test/files/run/t8017/value-class-lambda.scala | 1 + test/files/run/t8017/value-class.scala | 1 + test/files/run/t8266-octal-interp.check | 14 +-- test/files/run/t8266-octal-interp.flags | 1 - test/files/run/t8266-octal-interp.scala | 1 + test/files/run/t8570.flags | 1 - test/files/run/t8570.scala | 1 + test/files/run/t8570a.flags | 1 - test/files/run/t8570a.scala | 1 + test/files/run/t8601-closure-elim.flags | 1 - test/files/run/t8601-closure-elim.scala | 1 + test/files/run/t8601.flags | 1 - test/files/run/t8601.scala | 1 + test/files/run/t8601b.flags | 1 - test/files/run/t8601b.scala | 1 + test/files/run/t8601c.flags | 1 - test/files/run/t8601c.scala | 1 + test/files/run/t8601d.flags | 1 - test/files/run/t8601d.scala | 1 + test/files/run/t8601e.flags | 1 - test/files/run/t8601e/Test.scala | 1 + test/files/run/t8610.check | 2 +- test/files/run/t8610.flags | 1 - test/files/run/t8610.scala | 1 + test/files/run/t8611a.flags | 1 - test/files/run/t8611a.scala | 1 + test/files/run/t8611b.flags | 1 - test/files/run/t8611b.scala | 1 + test/files/run/t8611c.flags | 1 - test/files/run/t8611c.scala | 1 + test/files/run/t8888.flags | 1 - test/files/run/t8888.scala | 1 + test/files/run/t8925.flags | 1 - test/files/run/t8925.scala | 1 + test/files/run/t9003.flags | 1 - test/files/run/t9003.scala | 1 + test/files/run/t9029.flags | 1 - test/files/run/t9029.scala | 1 + test/files/run/t9178a.flags | 1 - test/files/run/t9178a.scala | 1 + test/files/run/t9403.check | 0 test/files/run/t9403.flags | 1 - test/files/run/t9403/C_1.scala | 1 + test/files/run/t9403/Test_2.scala | 1 + test/files/run/t9489.flags | 1 - test/files/run/t9489/test.scala | 1 + test/files/run/t9656.check | 4 +- test/files/run/t9656.flags | 1 - test/files/run/t9656.scala | 1 + test/files/run/virtpatmat_apply.flags | 1 - test/files/run/virtpatmat_apply.scala | 3 +- test/files/run/virtpatmat_casting.flags | 1 - test/files/run/virtpatmat_casting.scala | 1 + .../run/virtpatmat_extends_product.flags | 1 - test/files/run/virtpatmat_literal.flags | 1 - test/files/run/virtpatmat_literal.scala | 3 +- test/files/run/virtpatmat_nested_lists.check | 2 +- test/files/run/virtpatmat_nested_lists.flags | 1 - test/files/run/virtpatmat_nested_lists.scala | 1 + test/files/run/virtpatmat_npe.flags | 1 - test/files/run/virtpatmat_npe.scala | 3 +- test/files/run/virtpatmat_opt_sharing.check | 2 +- test/files/run/virtpatmat_opt_sharing.flags | 1 - test/files/run/virtpatmat_opt_sharing.scala | 1 + test/files/run/virtpatmat_partial.flags | 1 - test/files/run/virtpatmat_partial.scala | 1 + test/files/run/virtpatmat_staging.flags | 2 - test/files/run/virtpatmat_staging.scala | 1 + test/files/run/virtpatmat_stringinterp.flags | 1 - test/files/run/virtpatmat_stringinterp.scala | 1 + test/files/run/virtpatmat_switch.flags | 1 - test/files/run/virtpatmat_switch.scala | 1 + .../virtpatmat_tailcalls_verifyerror.flags | 1 - .../virtpatmat_tailcalls_verifyerror.scala | 3 +- test/files/run/virtpatmat_try.flags | 1 - test/files/run/virtpatmat_try.scala | 1 + test/files/run/virtpatmat_typed.check | 2 +- test/files/run/virtpatmat_typed.flags | 1 - test/files/run/virtpatmat_typed.scala | 3 +- test/files/run/virtpatmat_typetag.flags | 1 - test/files/run/virtpatmat_typetag.scala | 3 +- test/files/run/virtpatmat_unapply.flags | 1 - test/files/run/virtpatmat_unapply.scala | 3 +- test/files/run/virtpatmat_unapplyprod.flags | 1 - test/files/run/virtpatmat_unapplyprod.scala | 3 +- test/files/run/virtpatmat_unapplyseq.flags | 1 - test/files/run/virtpatmat_unapplyseq.scala | 3 +- test/files/run/wacky-value-classes.flags | 1 - test/files/run/wacky-value-classes.scala | 3 +- test/files/specialized/spec-patmatch.flags | 1 - test/files/specialized/spec-patmatch.scala | 1 + 1809 files changed, 2128 insertions(+), 1923 deletions(-) delete mode 100644 test/async/jvm/anf.flags delete mode 100644 test/async/jvm/await0.flags delete mode 100644 test/async/jvm/block0.flags delete mode 100644 test/async/jvm/block1.flags delete mode 100644 test/async/jvm/completable-future.flags delete mode 100644 test/async/jvm/concurrent_AfterRefchecksIssue.flags delete mode 100644 test/async/jvm/concurrent_ArrayIndexOutOfBoundIssue.flags delete mode 100644 test/async/jvm/concurrent_GenericTypeBoundaryIssue.flags delete mode 100644 test/async/jvm/concurrent_MatchEndIssue.flags delete mode 100644 test/async/jvm/concurrent_NegativeArraySizeException.flags delete mode 100644 test/async/jvm/concurrent_NegativeArraySizeExceptionFine1.flags delete mode 100644 test/async/jvm/concurrent_ReturnTupleIssue.flags delete mode 100644 test/async/jvm/concurrent_fetch.flags delete mode 100644 test/async/jvm/concurrent_patternAlternative.flags delete mode 100644 test/async/jvm/concurrent_patternAlternativeBothAnnotations.flags delete mode 100644 test/async/jvm/concurrent_polymorphicMethod.flags delete mode 100644 test/async/jvm/concurrent_shadowing.flags delete mode 100644 test/async/jvm/concurrent_shadowing0.flags delete mode 100644 test/async/jvm/concurrent_shadowing2.flags delete mode 100644 test/async/jvm/concurrent_shadowingRefinedTypes.flags delete mode 100644 test/async/jvm/concurrent_test0.flags delete mode 100644 test/async/jvm/exceptions.flags delete mode 100644 test/async/jvm/futures.flags delete mode 100644 test/async/jvm/hygiene.flags delete mode 100644 test/async/jvm/ifelse0.flags delete mode 100644 test/async/jvm/ifelse0_while.flags delete mode 100644 test/async/jvm/ifelse1.flags delete mode 100644 test/async/jvm/ifelse2.flags delete mode 100644 test/async/jvm/ifelse3.flags delete mode 100644 test/async/jvm/ifelse4.flags delete mode 100644 test/async/jvm/lazyval.flags delete mode 100644 test/async/jvm/live.flags delete mode 100644 test/async/jvm/localclasses.flags delete mode 100644 test/async/jvm/match0.flags delete mode 100644 test/async/jvm/nesteddef.flags delete mode 100644 test/async/jvm/noawait.flags delete mode 100644 test/async/jvm/stackoverflow.flags delete mode 100644 test/async/jvm/syncOptimization.flags delete mode 100644 test/async/jvm/toughtype.flags delete mode 100644 test/async/neg/ill-nested-await.flags delete mode 100644 test/async/neg/naked_await.flags delete mode 100644 test/async/neg/stark_naked_await.flags delete mode 100644 test/async/run/booleans.flags delete mode 100644 test/async/run/edge-cases.flags delete mode 100644 test/async/run/lambda.flags delete mode 100644 test/async/run/output.flags delete mode 100644 test/async/run/smoketest.flags delete mode 100644 test/async/run/value-class.flags delete mode 100644 test/files/instrumented/inline-in-constructors.flags delete mode 100644 test/files/jvm/annotations.flags delete mode 100644 test/files/jvm/bytecode-test-example.flags delete mode 100644 test/files/jvm/matchbox.flags delete mode 100644 test/files/jvm/t8582.flags create mode 100644 test/files/jvm/unreachable/Foo_1.check delete mode 100644 test/files/jvm/unreachable/Foo_1.flags delete mode 100644 test/files/neg/abstract-explaintypes.flags delete mode 100644 test/files/neg/abstract-inaccessible.flags delete mode 100644 test/files/neg/aladdin1055.flags delete mode 100644 test/files/neg/applydynamic_sip.flags delete mode 100644 test/files/neg/bad-advice.flags delete mode 100644 test/files/neg/badtok-1-212.flags delete mode 100644 test/files/neg/badtok-1.flags delete mode 100644 test/files/neg/beanInfoDeprecation.flags delete mode 100644 test/files/neg/case-collision-multifile.flags delete mode 100644 test/files/neg/case-collision.flags delete mode 100644 test/files/neg/catch-all.flags delete mode 100644 test/files/neg/check-dead.flags delete mode 100644 test/files/neg/checksensible.flags delete mode 100644 test/files/neg/choices.flags delete mode 100644 test/files/neg/classmanifests_new_deprecations.flags delete mode 100644 test/files/neg/constructor-init-order.flags delete mode 100644 test/files/neg/cycle-bounds.flags delete mode 100644 test/files/neg/delayed-init-ref.flags delete mode 100644 test/files/neg/deprecated-target.flags delete mode 100644 test/files/neg/exhausting.flags delete mode 100644 test/files/neg/for-comprehension-old.flags delete mode 100644 test/files/neg/forgot-interpolator.flags delete mode 100644 test/files/neg/gadts2-strict.flags delete mode 100644 test/files/neg/gadts2.flags delete mode 100644 test/files/neg/hk-typevar-unification.flags delete mode 100644 test/files/neg/implicit-ambiguous-invalid.flags delete mode 100644 test/files/neg/implicit-shadow.flags delete mode 100644 test/files/neg/implicitly-self.flags delete mode 100644 test/files/neg/inlineIndyLambdaPrivate.flags delete mode 100644 test/files/neg/inlineMaxSize.flags delete mode 100644 test/files/neg/java-import-non-existing-selector.flags delete mode 100644 test/files/neg/logImplicits.flags delete mode 100644 test/files/neg/macro-basic-mamdmi.flags delete mode 100644 test/files/neg/macro-blackbox-fundep-materialization.flags delete mode 100644 test/files/neg/macro-cyclic.flags delete mode 100644 test/files/neg/macro-deprecate-idents.flags delete mode 100644 test/files/neg/macro-false-deprecation-warning.flags delete mode 100644 test/files/neg/macro-incompatible-macro-engine-a/Macros_2.flags delete mode 100644 test/files/neg/macro-incompatible-macro-engine-b.flags delete mode 100644 test/files/neg/macro-incompatible-macro-engine-b/Macros_2.flags delete mode 100644 test/files/neg/macro-invalidimpl.flags delete mode 100644 test/files/neg/macro-invalidret.flags delete mode 100644 test/files/neg/macro-invalidshape.flags delete mode 100644 test/files/neg/macro-invalidsig-params-badtype.flags delete mode 100644 test/files/neg/macro-invalidsig.flags delete mode 100644 test/files/neg/macro-invalidusage-badargs.flags delete mode 100644 test/files/neg/macro-invalidusage-badbounds.flags delete mode 100644 test/files/neg/macro-invalidusage-badtargs.flags delete mode 100644 test/files/neg/macro-invalidusage-methodvaluesyntax.flags delete mode 100644 test/files/neg/macro-invalidusage-nontypeable.flags delete mode 100644 test/files/neg/macro-invalidusage-presuper.flags delete mode 100644 test/files/neg/macro-noexpand.flags delete mode 100644 test/files/neg/macro-nontypeablebody.flags delete mode 100644 test/files/neg/macro-override-macro-overrides-abstract-method-a.flags delete mode 100644 test/files/neg/macro-override-macro-overrides-abstract-method-b.flags delete mode 100644 test/files/neg/macro-override-method-overrides-macro.flags delete mode 100644 test/files/neg/macro-reify-splice-splice.flags delete mode 100644 test/files/neg/main1.flags delete mode 100644 test/files/neg/maxerrs.flags delete mode 100644 test/files/neg/maxwarns.flags delete mode 100644 test/files/neg/migration28.flags delete mode 100644 test/files/neg/multi-array.flags delete mode 100644 test/files/neg/names-defaults-neg-213.flags delete mode 100644 test/files/neg/names-defaults-neg-warn.flags delete mode 100644 test/files/neg/names-defaults-neg.flags delete mode 100644 test/files/neg/newpat_unreachable.flags delete mode 100644 test/files/neg/no-predef.flags delete mode 100644 test/files/neg/nonlocal-warning.flags delete mode 100644 test/files/neg/nonsense_eq_refine.flags delete mode 100644 test/files/neg/nullary-override.flags delete mode 100644 test/files/neg/optimiseDeprecated.flags delete mode 100644 test/files/neg/outer-ref-checks.flags delete mode 100644 test/files/neg/overloaded-implicit.flags delete mode 100644 test/files/neg/override-object-no.flags delete mode 100644 test/files/neg/partestInvalidFlag.flags delete mode 100644 test/files/neg/pat_unreachable.flags delete mode 100644 test/files/neg/patmat-classtag-compound.flags delete mode 100644 test/files/neg/patmatexhaust.flags delete mode 100644 test/files/neg/permanent-blindness.flags delete mode 100644 test/files/neg/pickle-java-crash.flags delete mode 100644 test/files/neg/run-gadts-strict.flags delete mode 100644 test/files/neg/sammy_disabled.flags delete mode 100644 test/files/neg/sealed-final-neg.flags delete mode 100644 test/files/neg/sealed-java-enums.flags delete mode 100644 test/files/neg/stmt-expr-discard.flags delete mode 100644 test/files/neg/switch.flags delete mode 100644 test/files/neg/t0903.flags delete mode 100644 test/files/neg/t10019.flags delete mode 100644 test/files/neg/t10068.flags delete mode 100644 test/files/neg/t10097.flags delete mode 100644 test/files/neg/t10097b.flags delete mode 100644 test/files/neg/t10270.flags delete mode 100644 test/files/neg/t10296-after.flags delete mode 100644 test/files/neg/t10296-both.flags delete mode 100644 test/files/neg/t10296-warn.flags delete mode 100644 test/files/neg/t10678.flags delete mode 100644 test/files/neg/t10752/Test_2.flags delete mode 100644 test/files/neg/t1215.flags delete mode 100644 test/files/neg/t1224.flags delete mode 100644 test/files/neg/t1503.flags delete mode 100644 test/files/neg/t1909-object.flags delete mode 100644 test/files/neg/t1980.flags delete mode 100644 test/files/neg/t2442.flags delete mode 100644 test/files/neg/t2462b.flags delete mode 100644 test/files/neg/t2462c.flags delete mode 100644 test/files/neg/t2509-2.flags delete mode 100644 test/files/neg/t2712-2.flags delete mode 100644 test/files/neg/t2796.flags delete mode 100644 test/files/neg/t284.flags delete mode 100644 test/files/neg/t3098.flags delete mode 100644 test/files/neg/t3683a.flags delete mode 100644 test/files/neg/t3692-new.flags delete mode 100644 test/files/neg/t4302.flags delete mode 100644 test/files/neg/t4440.flags delete mode 100644 test/files/neg/t4691_exhaust_extractor.flags delete mode 100644 test/files/neg/t4749.flags delete mode 100644 test/files/neg/t4762.flags delete mode 100644 test/files/neg/t4851.flags delete mode 100644 test/files/neg/t5182.flags delete mode 100644 test/files/neg/t5352.flags delete mode 100644 test/files/neg/t5426.flags delete mode 100644 test/files/neg/t5440.flags delete mode 100644 test/files/neg/t5639b.flags delete mode 100644 test/files/neg/t5663-badwarneq.flags delete mode 100644 test/files/neg/t5675.flags delete mode 100644 test/files/neg/t5689.flags delete mode 100644 test/files/neg/t5691.flags delete mode 100644 test/files/neg/t5753.flags delete mode 100644 test/files/neg/t5762.flags delete mode 100644 test/files/neg/t5830.flags delete mode 100644 test/files/neg/t5956.flags delete mode 100644 test/files/neg/t6011.flags delete mode 100644 test/files/neg/t6048.flags delete mode 100644 test/files/neg/t6120.flags delete mode 100644 test/files/neg/t6123-explaintypes-macros/BadMac_2.flags delete mode 100644 test/files/neg/t6123-explaintypes-macros/Macros.flags delete mode 100644 test/files/neg/t6162-inheritance.flags delete mode 100644 test/files/neg/t6162-overriding.flags delete mode 100644 test/files/neg/t6264.flags delete mode 100644 test/files/neg/t6276.flags delete mode 100644 test/files/neg/t6289.flags delete mode 100644 test/files/neg/t6323a.flags delete mode 100644 test/files/neg/t6406-regextract.flags delete mode 100644 test/files/neg/t6446-additional/sample_2.flags delete mode 100644 test/files/neg/t6446-list/sample_2.flags delete mode 100644 test/files/neg/t6446-missing/sample_2.flags delete mode 100644 test/files/neg/t6446-show-phases.flags delete mode 100644 test/files/neg/t6534.flags delete mode 100644 test/files/neg/t6567.flags delete mode 100644 test/files/neg/t6582_exhaust_big.flags delete mode 100644 test/files/neg/t6666.flags delete mode 100644 test/files/neg/t6666c.flags delete mode 100644 test/files/neg/t6675.flags delete mode 100644 test/files/neg/t6675b.flags delete mode 100644 test/files/neg/t6680a.flags delete mode 100644 test/files/neg/t6902.flags delete mode 100644 test/files/neg/t6963a.flags delete mode 100644 test/files/neg/t7014.flags delete mode 100644 test/files/neg/t7020.flags delete mode 100644 test/files/neg/t7110.flags delete mode 100644 test/files/neg/t7171.flags delete mode 100644 test/files/neg/t7171b.flags delete mode 100644 test/files/neg/t7187.flags delete mode 100644 test/files/neg/t7285.flags delete mode 100644 test/files/neg/t7290.flags delete mode 100644 test/files/neg/t7292-deprecation.flags delete mode 100644 test/files/neg/t7292-removal.flags delete mode 100644 test/files/neg/t7369.flags delete mode 100644 test/files/neg/t7494-after-terminal/sample_2.flags delete mode 100644 test/files/neg/t7494-before-parser/sample_2.flags delete mode 100644 test/files/neg/t7494-multi-right-after/sample_2.flags delete mode 100644 test/files/neg/t7494-no-options/sample_2.flags delete mode 100644 test/files/neg/t7494-right-after-before/sample_2.flags delete mode 100644 test/files/neg/t7494-right-after-terminal/sample_2.flags delete mode 100644 test/files/neg/t7605-deprecation.flags delete mode 100644 test/files/neg/t7622-cyclic-dependency/sample_2.flags delete mode 100644 test/files/neg/t7622-missing-dependency/sample_2.flags delete mode 100644 test/files/neg/t7622-missing-required.flags delete mode 100644 test/files/neg/t7622-multi-followers/sample_2.flags delete mode 100644 test/files/neg/t7623.flags delete mode 100644 test/files/neg/t7629-view-bounds-deprecation.flags delete mode 100644 test/files/neg/t7669.flags delete mode 100644 test/files/neg/t7721.flags delete mode 100644 test/files/neg/t7756b.flags delete mode 100644 test/files/neg/t7783.flags delete mode 100644 test/files/neg/t7848-interp-warn.flags delete mode 100644 test/files/neg/t7860.flags delete mode 100644 test/files/neg/t7984.flags delete mode 100644 test/files/neg/t8015-ffb.flags delete mode 100644 test/files/neg/t8035-deprecated.flags delete mode 100644 test/files/neg/t8035-no-adapted-args.flags delete mode 100644 test/files/neg/t8035-removed.flags delete mode 100644 test/files/neg/t8265.flags delete mode 100644 test/files/neg/t8417.flags delete mode 100644 test/files/neg/t8430.flags delete mode 100644 test/files/neg/t8450.flags delete mode 100644 test/files/neg/t8525.flags delete mode 100644 test/files/neg/t8597.flags delete mode 100644 test/files/neg/t8597b.flags delete mode 100644 test/files/neg/t8610-arg.flags delete mode 100644 test/files/neg/t8610.flags delete mode 100644 test/files/neg/t8685.flags delete mode 100644 test/files/neg/t8700a.flags delete mode 100644 test/files/neg/t8700b.flags delete mode 100644 test/files/neg/t8704.flags delete mode 100644 test/files/neg/t8731.flags delete mode 100644 test/files/neg/t8736-c.flags delete mode 100644 test/files/neg/t9127.flags delete mode 100644 test/files/neg/t9398.flags delete mode 100644 test/files/neg/t9617/Test.flags delete mode 100644 test/files/neg/t9636.flags delete mode 100644 test/files/neg/t9675.flags delete mode 100644 test/files/neg/t9684.flags delete mode 100644 test/files/neg/t9834.flags delete mode 100644 test/files/neg/t9847.flags delete mode 100644 test/files/neg/t9953.flags delete mode 100644 test/files/neg/trait_fields_deprecated_overriding.flags delete mode 100644 test/files/neg/unchecked-abstract.flags delete mode 100644 test/files/neg/unchecked-impossible.flags delete mode 100644 test/files/neg/unchecked-knowable.flags delete mode 100644 test/files/neg/unchecked-refinement.flags delete mode 100644 test/files/neg/unchecked-suppress.flags delete mode 100644 test/files/neg/unchecked.flags delete mode 100644 test/files/neg/unchecked2.flags delete mode 100644 test/files/neg/unchecked3.flags delete mode 100644 test/files/neg/unit-returns-value.flags delete mode 100644 test/files/neg/unreachablechar.flags delete mode 100644 test/files/neg/virtpatmat_exhaust_big.flags delete mode 100644 test/files/neg/virtpatmat_exhaust_compound.flags delete mode 100644 test/files/neg/virtpatmat_reach_null.flags delete mode 100644 test/files/neg/virtpatmat_reach_sealed_unsealed.flags delete mode 100644 test/files/neg/virtpatmat_unreach_select.flags delete mode 100644 test/files/neg/warn-inferred-any.flags delete mode 100644 test/files/neg/warn-unused-implicits.flags delete mode 100644 test/files/neg/warn-unused-imports.flags delete mode 100644 test/files/neg/warn-unused-locals.flags delete mode 100644 test/files/neg/warn-unused-params.flags delete mode 100644 test/files/neg/warn-unused-patvars.flags delete mode 100644 test/files/neg/warn-unused-privates.flags delete mode 100644 test/files/pos/annotated-treecopy.flags delete mode 100644 test/files/pos/attachments-typed-another-ident.flags delete mode 100644 test/files/pos/attachments-typed-ident.flags delete mode 100644 test/files/pos/case-object-add-serializable.flags delete mode 100644 test/files/pos/classtag-pos.flags delete mode 100644 test/files/pos/comp-rec-test.flags delete mode 100644 test/files/pos/cycle-jsoup.flags delete mode 100644 test/files/pos/cycle.flags delete mode 100644 test/files/pos/debug-reset-local-attrs.flags delete mode 100644 test/files/pos/dotless-targs-ranged.flags delete mode 100644 test/files/pos/dotless-targs.flags delete mode 100644 test/files/pos/exhaust_alternatives.flags delete mode 100644 test/files/pos/existential-slow-compile1.flags delete mode 100644 test/files/pos/generic-sigs.flags delete mode 100644 test/files/pos/hkarray.flags delete mode 100644 test/files/pos/implicit-anyval-2.10.flags delete mode 100644 test/files/pos/infer_override_def_args.flags delete mode 100644 test/files/pos/infersingle.flags delete mode 100644 test/files/pos/inline-access-levels.flags delete mode 100644 test/files/pos/java-import-static-from-subclass.flags delete mode 100644 test/files/pos/macro-deprecate-dont-touch-backquotedidents.flags delete mode 100644 test/files/pos/native-warning.flags delete mode 100644 test/files/pos/nonlocal-unchecked.flags delete mode 100644 test/files/pos/override-object-yes.flags delete mode 100644 test/files/pos/package-ob-case.flags delete mode 100644 test/files/pos/patmat-hk.flags delete mode 100644 test/files/pos/patmat-suppress.flags delete mode 100644 test/files/pos/polymorphic-case-class.flags delete mode 100644 test/files/pos/proj-rec-test.flags delete mode 100644 test/files/pos/rangepos-anonapply.flags delete mode 100644 test/files/pos/rangepos-patmat.flags delete mode 100644 test/files/pos/rangepos.flags delete mode 100644 test/files/pos/setter-not-implicit.flags delete mode 100644 test/files/pos/t10093.flags delete mode 100644 test/files/pos/t10185.flags delete mode 100644 test/files/pos/t10195.flags delete mode 100644 test/files/pos/t10195b.flags delete mode 100644 test/files/pos/t10197.flags delete mode 100644 test/files/pos/t10213.flags delete mode 100644 test/files/pos/t10238.flags delete mode 100644 test/files/pos/t10270.flags delete mode 100644 test/files/pos/t10288.flags delete mode 100644 test/files/pos/t10296-before.flags delete mode 100644 test/files/pos/t10296.flags delete mode 100644 test/files/pos/t10372.flags delete mode 100644 test/files/pos/t10394.flags delete mode 100644 test/files/pos/t10623.flags delete mode 100644 test/files/pos/t10643.flags delete mode 100644 test/files/pos/t10644.flags delete mode 100644 test/files/pos/t10763.flags delete mode 100644 test/files/pos/t11538.flags delete mode 100644 test/files/pos/t11917.flags delete mode 100644 test/files/pos/t1439.flags delete mode 100644 test/files/pos/t1803.flags delete mode 100644 test/files/pos/t2066-2.10-compat.flags delete mode 100644 test/files/pos/t2712-1.flags delete mode 100644 test/files/pos/t2712-2.flags delete mode 100644 test/files/pos/t2712-3.flags delete mode 100644 test/files/pos/t2712-4.flags delete mode 100644 test/files/pos/t2712-5.flags delete mode 100644 test/files/pos/t2712-6.flags delete mode 100644 test/files/pos/t2712-7.flags delete mode 100644 test/files/pos/t2799.flags delete mode 100644 test/files/pos/t3234.flags delete mode 100644 test/files/pos/t3368.flags delete mode 100644 test/files/pos/t3420.flags delete mode 100644 test/files/pos/t3495.flags delete mode 100644 test/files/pos/t3960.flags delete mode 100644 test/files/pos/t4020.flags delete mode 100644 test/files/pos/t4494.flags delete mode 100644 test/files/pos/t4649.flags delete mode 100644 test/files/pos/t4744.flags delete mode 100644 test/files/pos/t4840.flags delete mode 100644 test/files/pos/t4911.flags delete mode 100644 test/files/pos/t5029.flags delete mode 100644 test/files/pos/t5165b.flags delete mode 100644 test/files/pos/t5175.flags delete mode 100644 test/files/pos/t5542.flags delete mode 100644 test/files/pos/t5639.flags delete mode 100644 test/files/pos/t5683.flags delete mode 100644 test/files/pos/t5706.flags delete mode 100644 test/files/pos/t5809.flags delete mode 100644 test/files/pos/t5818.flags delete mode 100644 test/files/pos/t5897.flags delete mode 100644 test/files/pos/t5899.flags delete mode 100644 test/files/pos/t5930.flags delete mode 100644 test/files/pos/t5932.flags delete mode 100644 test/files/pos/t5954c.flags delete mode 100644 test/files/pos/t5954d.flags delete mode 100644 test/files/pos/t5968.flags delete mode 100644 test/files/pos/t6008.flags delete mode 100644 test/files/pos/t6022.flags delete mode 100644 test/files/pos/t6047.flags delete mode 100644 test/files/pos/t6091.flags delete mode 100644 test/files/pos/t6123-explaintypes-implicits.flags delete mode 100644 test/files/pos/t6146.flags delete mode 100644 test/files/pos/t6162-inheritance.flags delete mode 100644 test/files/pos/t6210.flags delete mode 100644 test/files/pos/t6260.flags delete mode 100644 test/files/pos/t6275.flags delete mode 100644 test/files/pos/t6537.flags delete mode 100644 test/files/pos/t6595.flags delete mode 100644 test/files/pos/t6675.flags delete mode 100644 test/files/pos/t6771.flags delete mode 100644 test/files/pos/t6891.flags delete mode 100644 test/files/pos/t6895b-2.flags delete mode 100644 test/files/pos/t6895b.flags delete mode 100644 test/files/pos/t6896.flags delete mode 100644 test/files/pos/t6942.flags delete mode 100644 test/files/pos/t6963c.flags delete mode 100644 test/files/pos/t6978.flags delete mode 100644 test/files/pos/t6994.flags delete mode 100644 test/files/pos/t7011.flags delete mode 100644 test/files/pos/t7183.flags delete mode 100644 test/files/pos/t7232.flags delete mode 100644 test/files/pos/t7232b.flags delete mode 100644 test/files/pos/t7232c.flags delete mode 100644 test/files/pos/t7232d.flags delete mode 100644 test/files/pos/t7285a.flags delete mode 100644 test/files/pos/t7315.flags delete mode 100644 test/files/pos/t7369.flags delete mode 100644 test/files/pos/t7427.flags delete mode 100644 test/files/pos/t7433.flags delete mode 100644 test/files/pos/t7551.flags delete mode 100644 test/files/pos/t7649.flags delete mode 100644 test/files/pos/t7683-stop-after-parser/sample_2.flags delete mode 100644 test/files/pos/t7750.flags delete mode 100644 test/files/pos/t7864.flags delete mode 100644 test/files/pos/t8001.flags delete mode 100644 test/files/pos/t8013.flags delete mode 100644 test/files/pos/t8040.flags delete mode 100644 test/files/pos/t8064.flags delete mode 100644 test/files/pos/t8064b.flags delete mode 100644 test/files/pos/t8157-2.10.flags delete mode 100644 test/files/pos/t8363.flags delete mode 100644 test/files/pos/t8410.flags delete mode 100644 test/files/pos/t8523.flags delete mode 100644 test/files/pos/t8546.flags delete mode 100644 test/files/pos/t8578.flags delete mode 100644 test/files/pos/t8596.flags delete mode 100644 test/files/pos/t8617.flags delete mode 100644 test/files/pos/t8736-b.flags delete mode 100644 test/files/pos/t8736.flags delete mode 100644 test/files/pos/t8781/Test_2.flags delete mode 100644 test/files/pos/t8828.flags delete mode 100644 test/files/pos/t8861.flags delete mode 100644 test/files/pos/t8934a/Test_2.flags delete mode 100644 test/files/pos/t8954.flags delete mode 100644 test/files/pos/t8965.flags delete mode 100644 test/files/pos/t8999.flags delete mode 100644 test/files/pos/t9020.flags delete mode 100644 test/files/pos/t9111-inliner-workaround.flags delete mode 100644 test/files/pos/t9178b.flags delete mode 100644 test/files/pos/t9220.flags delete mode 100644 test/files/pos/t9285.flags delete mode 100644 test/files/pos/t9369.flags delete mode 100644 test/files/pos/t9370/sample_2.flags delete mode 100644 test/files/pos/t9399.flags delete mode 100644 test/files/pos/t9411a.flags delete mode 100644 test/files/pos/t9411b.flags delete mode 100644 test/files/pos/t9630.flags delete mode 100644 test/files/pos/unchecked-a.flags delete mode 100644 test/files/pos/value-class-override-no-spec.flags delete mode 100644 test/files/pos/virtpatmat_alts_subst.flags delete mode 100644 test/files/pos/virtpatmat_binding_opt.flags delete mode 100644 test/files/pos/virtpatmat_castbinder.flags delete mode 100644 test/files/pos/virtpatmat_exhaust_unchecked.flags delete mode 100644 test/files/pos/virtpatmat_exist1.flags delete mode 100644 test/files/pos/virtpatmat_exist2.flags delete mode 100644 test/files/pos/virtpatmat_exist3.flags delete mode 100644 test/files/pos/virtpatmat_gadt_array.flags delete mode 100644 test/files/pos/virtpatmat_infer_single_1.flags delete mode 100644 test/files/pos/virtpatmat_instof_valuetype.flags delete mode 100644 test/files/pos/virtpatmat_obj_in_case.flags delete mode 100644 test/files/pos/warn-unused-params-not-implicits.flags delete mode 100644 test/files/pos/xlint1.flags delete mode 100644 test/files/pos/z1730.flags delete mode 100644 test/files/presentation/ide-t1000976.flags delete mode 100644 test/files/presentation/t8085.flags delete mode 100644 test/files/presentation/t8085b.flags delete mode 100644 test/files/run/abstype_implicits.flags delete mode 100644 test/files/run/anyval-box-types.flags delete mode 100644 test/files/run/applydynamic_sip.flags rename test/files/{jvm/t10512a.flags => run/bcodeInlinerMixed.check} (100%) delete mode 100644 test/files/run/bcodeInlinerMixed.flags delete mode 100644 test/files/run/checked.flags delete mode 100644 test/files/run/checkinit.flags delete mode 100644 test/files/run/delambdafy-dependent-on-param-subst.flags delete mode 100644 test/files/run/deprecate-early-type-defs.flags delete mode 100644 test/files/run/disable-assertions.flags delete mode 100644 test/files/run/elidable-opt.flags delete mode 100644 test/files/run/elidable.flags delete mode 100644 test/files/run/finalvar.flags delete mode 100644 test/files/run/hk-typevar-unification.flags delete mode 100644 test/files/run/indy-meth-refs-b.flags delete mode 100644 test/files/run/indy-meth-refs-c.flags delete mode 100644 test/files/run/indy-meth-refs-d.flags delete mode 100644 test/files/run/indy-meth-refs-e.flags delete mode 100644 test/files/run/indy-meth-refs-f.flags delete mode 100644 test/files/run/indy-meth-refs-g.flags delete mode 100644 test/files/run/indy-meth-refs-h.flags delete mode 100644 test/files/run/indy-meth-refs-i.flags delete mode 100644 test/files/run/indy-meth-refs.flags delete mode 100644 test/files/run/inferred-type-constructors-hou.flags delete mode 100644 test/files/run/interop_typetags_are_manifests.flags delete mode 100644 test/files/run/kmpSliceSearch.flags delete mode 100644 test/files/run/lambda-serialization-meth-ref.flags delete mode 100644 test/files/run/literals.flags delete mode 100644 test/files/run/macro-abort-fresh.flags delete mode 100644 test/files/run/macro-basic-ma-md-mi.flags delete mode 100644 test/files/run/macro-basic-ma-mdmi.flags delete mode 100644 test/files/run/macro-basic-mamd-mi.flags delete mode 100644 test/files/run/macro-bodyexpandstoimpl.flags delete mode 100644 test/files/run/macro-bundle-toplevel.flags delete mode 100644 test/files/run/macro-def-path-dependent.flags delete mode 100644 test/files/run/macro-duplicate.flags delete mode 100644 test/files/run/macro-enclosures.flags delete mode 100644 test/files/run/macro-expand-implicit-argument.flags delete mode 100644 test/files/run/macro-expand-implicit-macro-has-implicit.flags delete mode 100644 test/files/run/macro-expand-implicit-macro-is-implicit.flags delete mode 100644 test/files/run/macro-expand-implicit-macro-is-val.flags delete mode 100644 test/files/run/macro-expand-multiple-arglists.flags delete mode 100644 test/files/run/macro-expand-nullary-generic.flags delete mode 100644 test/files/run/macro-expand-nullary-nongeneric.flags delete mode 100644 test/files/run/macro-expand-overload.flags delete mode 100644 test/files/run/macro-expand-override.flags delete mode 100644 test/files/run/macro-expand-recursive.flags delete mode 100644 test/files/run/macro-expand-tparams-bounds.flags delete mode 100644 test/files/run/macro-expand-tparams-explicit.flags delete mode 100644 test/files/run/macro-expand-tparams-implicit.flags delete mode 100644 test/files/run/macro-expand-tparams-prefix.flags delete mode 100644 test/files/run/macro-expand-unapply-a.flags delete mode 100644 test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags delete mode 100644 test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags delete mode 100644 test/files/run/macro-expand-varargs-explicit-over-varargs.flags delete mode 100644 test/files/run/macro-expand-varargs-implicit-over-nonvarargs.flags delete mode 100644 test/files/run/macro-expand-varargs-implicit-over-varargs.flags delete mode 100644 test/files/run/macro-impl-default-params.flags delete mode 100644 test/files/run/macro-impl-rename-context.flags delete mode 100644 test/files/run/macro-impl-tparam-only-in-impl.flags delete mode 100644 test/files/run/macro-impl-tparam-typetag-is-optional.flags delete mode 100644 test/files/run/macro-implicit-decorator.flags delete mode 100644 test/files/run/macro-invalidret-doesnt-conform-to-def-rettype.flags delete mode 100644 test/files/run/macro-invalidret-nontypeable.flags delete mode 100644 test/files/run/macro-invalidusage-badret.flags delete mode 100644 test/files/run/macro-invalidusage-partialapplication-with-tparams.flags delete mode 100644 test/files/run/macro-invalidusage-partialapplication.flags delete mode 100644 test/files/run/macro-openmacros.flags delete mode 100644 test/files/run/macro-parse-position.flags delete mode 100644 test/files/run/macro-quasiinvalidbody-c.flags delete mode 100644 test/files/run/macro-range.flags delete mode 100644 test/files/run/macro-rangepos-args.flags delete mode 100644 test/files/run/macro-rangepos-subpatterns.flags delete mode 100644 test/files/run/macro-reflective-ma-normal-mdmi.flags delete mode 100644 test/files/run/macro-reify-basic.flags delete mode 100644 test/files/run/macro-reify-freevars.flags delete mode 100644 test/files/run/macro-reify-ref-to-packageless.flags delete mode 100644 test/files/run/macro-reify-splice-outside-reify.flags delete mode 100644 test/files/run/macro-reify-staticXXX.flags delete mode 100644 test/files/run/macro-reify-tagful-a.flags delete mode 100644 test/files/run/macro-reify-tagless-a.flags delete mode 100644 test/files/run/macro-reify-type.flags delete mode 100644 test/files/run/macro-reify-unreify.flags delete mode 100644 test/files/run/macro-settings.flags delete mode 100644 test/files/run/macro-sip19-revised.flags delete mode 100644 test/files/run/macro-sip19.flags delete mode 100644 test/files/run/macro-term-declared-in-annotation.flags delete mode 100644 test/files/run/macro-term-declared-in-anonymous.flags delete mode 100644 test/files/run/macro-term-declared-in-block.flags delete mode 100644 test/files/run/macro-term-declared-in-class-class.flags delete mode 100644 test/files/run/macro-term-declared-in-class-object.flags delete mode 100644 test/files/run/macro-term-declared-in-class.flags delete mode 100644 test/files/run/macro-term-declared-in-default-param.flags delete mode 100644 test/files/run/macro-term-declared-in-implicit-class.flags delete mode 100644 test/files/run/macro-term-declared-in-method.flags delete mode 100644 test/files/run/macro-term-declared-in-object-class.flags delete mode 100644 test/files/run/macro-term-declared-in-object-object.flags delete mode 100644 test/files/run/macro-term-declared-in-object.flags delete mode 100644 test/files/run/macro-term-declared-in-package-object.flags delete mode 100644 test/files/run/macro-term-declared-in-refinement.flags delete mode 100644 test/files/run/macro-term-declared-in-trait.flags delete mode 100644 test/files/run/macro-typecheck-implicitsdisabled.flags delete mode 100644 test/files/run/macro-typecheck-macrosdisabled.flags delete mode 100644 test/files/run/macro-typecheck-macrosdisabled2.flags delete mode 100644 test/files/run/macro-undetparams-consfromsls.flags delete mode 100644 test/files/run/macro-undetparams-implicitval.flags delete mode 100644 test/files/run/macro-undetparams-macroitself.flags delete mode 100644 test/files/run/macro-vampire-false-warning.flags delete mode 100644 test/files/run/macroPlugins-isBlackbox/Test_3.flags delete mode 100644 test/files/run/macroPlugins-macroArgs/Test_3.flags delete mode 100644 test/files/run/macroPlugins-macroExpand.flags delete mode 100644 test/files/run/macroPlugins-macroExpand/Test_3.flags delete mode 100644 test/files/run/macroPlugins-macroRuntime/Test_3.flags delete mode 100644 test/files/run/macroPlugins-typedMacroBody.flags delete mode 100644 test/files/run/macroPlugins-typedMacroBody/Macros_2.flags delete mode 100644 test/files/run/manifests-undeprecated-in-2.10.0.flags delete mode 100644 test/files/run/nothingTypeDce.flags delete mode 100644 test/files/run/nothingTypeNoOpt.flags delete mode 100644 test/files/run/primitive-sigs-2-new.flags delete mode 100644 test/files/run/primitive-sigs-2-old.flags delete mode 100644 test/files/run/pure-warning-post-macro.flags delete mode 100644 test/files/run/synchronized.flags delete mode 100644 test/files/run/t10067.flags delete mode 100644 test/files/run/t10097.flags delete mode 100644 test/files/run/t10283.flags delete mode 100644 test/files/run/t10439.flags delete mode 100644 test/files/run/t10692.flags delete mode 100644 test/files/run/t11255.flags delete mode 100644 test/files/run/t1167.flags delete mode 100644 test/files/run/t1503_future.flags delete mode 100644 test/files/run/t1987.flags delete mode 100644 test/files/run/t2106.flags delete mode 100644 test/files/run/t2251.flags delete mode 100644 test/files/run/t2251b.flags delete mode 100644 test/files/run/t3038b.flags delete mode 100644 test/files/run/t3038d.flags delete mode 100644 test/files/run/t3235-minimal.flags delete mode 100644 test/files/run/t3509.flags delete mode 100644 test/files/run/t3518.flags delete mode 100644 test/files/run/t3569.flags delete mode 100644 test/files/run/t3895.flags delete mode 100644 test/files/run/t3897.flags delete mode 100644 test/files/run/t4072.flags delete mode 100644 test/files/run/t4201.flags delete mode 100644 test/files/run/t4285.flags delete mode 100644 test/files/run/t4317.flags delete mode 100644 test/files/run/t4536.flags delete mode 100644 test/files/run/t4742.flags delete mode 100644 test/files/run/t4935.flags delete mode 100644 test/files/run/t5040.flags delete mode 100644 test/files/run/t5568.flags delete mode 100644 test/files/run/t5648.flags delete mode 100644 test/files/run/t5676.flags delete mode 100644 test/files/run/t5704.flags delete mode 100644 test/files/run/t5713.flags delete mode 100644 test/files/run/t5753_1.flags delete mode 100644 test/files/run/t5753_2.flags delete mode 100644 test/files/run/t5830.flags delete mode 100644 test/files/run/t5857.flags delete mode 100644 test/files/run/t5903a.flags delete mode 100644 test/files/run/t5903b.flags delete mode 100644 test/files/run/t5903c.flags delete mode 100644 test/files/run/t5903d.flags delete mode 100644 test/files/run/t5905-features.flags delete mode 100644 test/files/run/t6102.flags delete mode 100644 test/files/run/t6188.flags delete mode 100644 test/files/run/t6327.flags delete mode 100644 test/files/run/t6394a.flags delete mode 100644 test/files/run/t6394b.flags delete mode 100644 test/files/run/t6541.flags delete mode 100644 test/files/run/t6663.flags delete mode 100644 test/files/run/t6731.flags delete mode 100644 test/files/run/t7171.flags delete mode 100644 test/files/run/t7341.flags delete mode 100644 test/files/run/t7407.flags delete mode 100644 test/files/run/t7459b-optimize.flags delete mode 100644 test/files/run/t7582.flags delete mode 100644 test/files/run/t7582b.flags delete mode 100644 test/files/run/t7584.flags delete mode 100644 test/files/run/t7852.flags delete mode 100644 test/files/run/t7974.flags delete mode 100644 test/files/run/t8017.flags delete mode 100644 test/files/run/t8266-octal-interp.flags delete mode 100644 test/files/run/t8570.flags delete mode 100644 test/files/run/t8570a.flags delete mode 100644 test/files/run/t8601-closure-elim.flags delete mode 100644 test/files/run/t8601.flags delete mode 100644 test/files/run/t8601b.flags delete mode 100644 test/files/run/t8601c.flags delete mode 100644 test/files/run/t8601d.flags delete mode 100644 test/files/run/t8601e.flags delete mode 100644 test/files/run/t8610.flags delete mode 100644 test/files/run/t8611a.flags delete mode 100644 test/files/run/t8611b.flags delete mode 100644 test/files/run/t8611c.flags delete mode 100644 test/files/run/t8888.flags delete mode 100644 test/files/run/t8925.flags delete mode 100644 test/files/run/t9003.flags delete mode 100644 test/files/run/t9029.flags delete mode 100644 test/files/run/t9178a.flags create mode 100644 test/files/run/t9403.check delete mode 100644 test/files/run/t9403.flags delete mode 100644 test/files/run/t9489.flags delete mode 100644 test/files/run/t9656.flags delete mode 100644 test/files/run/virtpatmat_apply.flags delete mode 100644 test/files/run/virtpatmat_casting.flags delete mode 100644 test/files/run/virtpatmat_extends_product.flags delete mode 100644 test/files/run/virtpatmat_literal.flags delete mode 100644 test/files/run/virtpatmat_nested_lists.flags delete mode 100644 test/files/run/virtpatmat_npe.flags delete mode 100644 test/files/run/virtpatmat_opt_sharing.flags delete mode 100644 test/files/run/virtpatmat_partial.flags delete mode 100644 test/files/run/virtpatmat_staging.flags delete mode 100644 test/files/run/virtpatmat_stringinterp.flags delete mode 100644 test/files/run/virtpatmat_switch.flags delete mode 100644 test/files/run/virtpatmat_tailcalls_verifyerror.flags delete mode 100644 test/files/run/virtpatmat_try.flags delete mode 100644 test/files/run/virtpatmat_typed.flags delete mode 100644 test/files/run/virtpatmat_typetag.flags delete mode 100644 test/files/run/virtpatmat_unapply.flags delete mode 100644 test/files/run/virtpatmat_unapplyprod.flags delete mode 100644 test/files/run/virtpatmat_unapplyseq.flags delete mode 100644 test/files/run/wacky-value-classes.flags delete mode 100644 test/files/specialized/spec-patmatch.flags diff --git a/src/partest/scala/tools/partest/PartestDefaults.scala b/src/partest/scala/tools/partest/PartestDefaults.scala index f92da68b90d0..266a113e2995 100644 --- a/src/partest/scala/tools/partest/PartestDefaults.scala +++ b/src/partest/scala/tools/partest/PartestDefaults.scala @@ -40,7 +40,7 @@ object PartestDefaults { def waitTime = Duration(prop("partest.timeout") getOrElse "4 hours") def printDurationThreshold = java.lang.Integer.getInteger("partest.print.duration.threshold.ms", 5000) - //def timeout = "1200000" // per-test timeout + def migrateFlagsFiles = false // probe for the named executable private def jdkexec(name: String): Option[String] = { diff --git a/src/partest/scala/tools/partest/nest/Runner.scala b/src/partest/scala/tools/partest/nest/Runner.scala index cd6ce2a1b537..e4efc4cc5f82 100644 --- a/src/partest/scala/tools/partest/nest/Runner.scala +++ b/src/partest/scala/tools/partest/nest/Runner.scala @@ -66,7 +66,7 @@ case class TestInfo(testFile: File) { } /** Run a single test. */ -class Runner(val testInfo: TestInfo, val suiteRunner: AbstractRunner) { +class Runner(val testInfo: TestInfo, val suiteRunner: AbstractRunner) { runner => private val stopwatch = new Stopwatch() import testInfo._ @@ -453,16 +453,17 @@ class Runner(val testInfo: TestInfo, val suiteRunner: AbstractRunner) { def newCompiler = new DirectCompiler(this) def attemptCompile(sources: List[File]): TestState = { - // TODO: Deferred until 2.12.x is ready to lose its flags files, & possibly flags file support entirely - //val badflags = (testFile :: (if (testFile.isDirectory) sources else Nil)).map(_.changeExtension("flags")).find(_.exists) - //if (badflags.isDefined) genFail(s"unexpected flags file ${badflags.get} (use source comment // scalac: -Wfatal-warnings)") - //else { - val state = newCompiler.compile(flagsForCompilation(sources), sources) - if (!state.isOk) - _transcript.append("\n" + logFile.fileContents) - - state - //} + (testFile :: (if (testFile.isDirectory) sources else Nil)).map(_.changeExtension("flags")).find(_.exists()) match { + // TODO: Deferred until the remaining 2.12 tests work without their flags files + //case Some(flagsFile) => + //genFail(s"unexpected flags file $flagsFile (use source comment // scalac: -Xfatal-warnings)") + case _ => + val state = newCompiler.compile(flagsForCompilation(sources), sources) + if (!state.isOk) + pushTranscript(s"$EOL${logFile.fileContents}") + + state + } } // all sources in a round may contribute flags via .flags files or // scalac: -flags @@ -525,8 +526,27 @@ class Runner(val testInfo: TestInfo, val suiteRunner: AbstractRunner) { lazy val result = { pushTranscript(description) ; attemptCompile(fs) } } - def compilationRounds(file: File): List[CompileRound] = - groupedFiles(sources(file)).map(mixedCompileGroup).flatten + def compilationRounds(file: File): List[CompileRound] = { + val sources = runner.sources(file) + + if (PartestDefaults.migrateFlagsFiles) { + def writeFlags(f: File, flags: List[String]) = + if (flags.nonEmpty) f.writeAll((s"// scalac: ${ojoin(flags: _*)}" +: f.fileLines).map(_ + EOL): _*) + val flags = readOptionsFile(flagsFile) + sources.filter(_.isScala).foreach { + case `testFile` => + writeFlags(testFile, flags) + flagsFile.delete() + case f => + val more = f.changeExtension("flags") + writeFlags(f, flags ::: readOptionsFile(more)) + more.delete() + } + } + + groupedFiles(sources).flatMap(mixedCompileGroup) + } + def mixedCompileGroup(allFiles: List[File]): List[CompileRound] = { val (scalaFiles, javaFiles) = allFiles partition (_.isScala) val round1 = if (scalaFiles.isEmpty) None else Some(ScalaAndJava(allFiles)) diff --git a/test/async/jvm/anf.flags b/test/async/jvm/anf.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/anf.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/anf.scala b/test/async/jvm/anf.scala index cd2c0361298f..2f65f902ae8f 100644 --- a/test/async/jvm/anf.scala +++ b/test/async/jvm/anf.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.anf.AnfTransformSpec]) package scala.async.run.anf { diff --git a/test/async/jvm/await0.flags b/test/async/jvm/await0.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/await0.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/await0.scala b/test/async/jvm/await0.scala index b7ce497bfefd..0327edf3b6fe 100644 --- a/test/async/jvm/await0.scala +++ b/test/async/jvm/await0.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.await0.Await0Spec]) package scala.async.run.await0 { diff --git a/test/async/jvm/block0.flags b/test/async/jvm/block0.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/block0.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/block0.scala b/test/async/jvm/block0.scala index 861ee6c46aac..babdc9377454 100644 --- a/test/async/jvm/block0.scala +++ b/test/async/jvm/block0.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.block0.AsyncSpec]) package scala.async.run.block0 { diff --git a/test/async/jvm/block1.flags b/test/async/jvm/block1.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/block1.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/block1.scala b/test/async/jvm/block1.scala index 27fc7d49b6fc..97c5a5191dc1 100644 --- a/test/async/jvm/block1.scala +++ b/test/async/jvm/block1.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.block1.Block1Spec]) package scala.async.run.block1 { diff --git a/test/async/jvm/completable-future.flags b/test/async/jvm/completable-future.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/completable-future.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/completable-future.scala b/test/async/jvm/completable-future.scala index fdc7614ff7f3..4f1b8bb64948 100644 --- a/test/async/jvm/completable-future.scala +++ b/test/async/jvm/completable-future.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import java.util.concurrent._ import scala.tools.partest.async.CompletableFutureAwait._ @@ -16,4 +17,4 @@ object Test { val result = f.get() assert(result == 100, result) } -} \ No newline at end of file +} diff --git a/test/async/jvm/concurrent_AfterRefchecksIssue.flags b/test/async/jvm/concurrent_AfterRefchecksIssue.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_AfterRefchecksIssue.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_AfterRefchecksIssue.scala b/test/async/jvm/concurrent_AfterRefchecksIssue.scala index d401b787ed5a..ac0f87941f74 100644 --- a/test/async/jvm/concurrent_AfterRefchecksIssue.scala +++ b/test/async/jvm/concurrent_AfterRefchecksIssue.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._, ExecutionContext.Implicits.global, scala.tools.partest.async.Async._ trait Factory[T] { diff --git a/test/async/jvm/concurrent_ArrayIndexOutOfBoundIssue.flags b/test/async/jvm/concurrent_ArrayIndexOutOfBoundIssue.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_ArrayIndexOutOfBoundIssue.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_ArrayIndexOutOfBoundIssue.scala b/test/async/jvm/concurrent_ArrayIndexOutOfBoundIssue.scala index 92dd3f70221e..68329b297e76 100644 --- a/test/async/jvm/concurrent_ArrayIndexOutOfBoundIssue.scala +++ b/test/async/jvm/concurrent_ArrayIndexOutOfBoundIssue.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._ import ExecutionContext.Implicits.global import scala.tools.partest.async.Async._ diff --git a/test/async/jvm/concurrent_GenericTypeBoundaryIssue.flags b/test/async/jvm/concurrent_GenericTypeBoundaryIssue.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_GenericTypeBoundaryIssue.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_GenericTypeBoundaryIssue.scala b/test/async/jvm/concurrent_GenericTypeBoundaryIssue.scala index defa019b43ff..13d3edab6c7c 100644 --- a/test/async/jvm/concurrent_GenericTypeBoundaryIssue.scala +++ b/test/async/jvm/concurrent_GenericTypeBoundaryIssue.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import Test.test import scala.concurrent._ diff --git a/test/async/jvm/concurrent_MatchEndIssue.flags b/test/async/jvm/concurrent_MatchEndIssue.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_MatchEndIssue.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_MatchEndIssue.scala b/test/async/jvm/concurrent_MatchEndIssue.scala index 175a4a912e00..c6de6522ed04 100644 --- a/test/async/jvm/concurrent_MatchEndIssue.scala +++ b/test/async/jvm/concurrent_MatchEndIssue.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._ import ExecutionContext.Implicits.global import scala.tools.partest.async.Async._ diff --git a/test/async/jvm/concurrent_NegativeArraySizeException.flags b/test/async/jvm/concurrent_NegativeArraySizeException.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_NegativeArraySizeException.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_NegativeArraySizeException.scala b/test/async/jvm/concurrent_NegativeArraySizeException.scala index 3fdff3d2e9f6..8669a1bf782f 100644 --- a/test/async/jvm/concurrent_NegativeArraySizeException.scala +++ b/test/async/jvm/concurrent_NegativeArraySizeException.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._ import ExecutionContext.Implicits.global import scala.tools.partest.async.Async._ diff --git a/test/async/jvm/concurrent_NegativeArraySizeExceptionFine1.flags b/test/async/jvm/concurrent_NegativeArraySizeExceptionFine1.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_NegativeArraySizeExceptionFine1.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_NegativeArraySizeExceptionFine1.scala b/test/async/jvm/concurrent_NegativeArraySizeExceptionFine1.scala index fda8b0331289..87b9e81367f5 100644 --- a/test/async/jvm/concurrent_NegativeArraySizeExceptionFine1.scala +++ b/test/async/jvm/concurrent_NegativeArraySizeExceptionFine1.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._ import ExecutionContext.Implicits.global import scala.tools.partest.async.Async._ diff --git a/test/async/jvm/concurrent_ReturnTupleIssue.flags b/test/async/jvm/concurrent_ReturnTupleIssue.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_ReturnTupleIssue.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_ReturnTupleIssue.scala b/test/async/jvm/concurrent_ReturnTupleIssue.scala index b0cc78d1e9f9..9369a9607dd8 100644 --- a/test/async/jvm/concurrent_ReturnTupleIssue.scala +++ b/test/async/jvm/concurrent_ReturnTupleIssue.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._ import ExecutionContext.Implicits.global import scala.tools.partest.async.Async._ diff --git a/test/async/jvm/concurrent_fetch.flags b/test/async/jvm/concurrent_fetch.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_fetch.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_fetch.scala b/test/async/jvm/concurrent_fetch.scala index ef246e3fb5f1..92f2f7b7c464 100644 --- a/test/async/jvm/concurrent_fetch.scala +++ b/test/async/jvm/concurrent_fetch.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent.{Await, Future, duration} import scala.concurrent.ExecutionContext.Implicits.global import scala.tools.partest.async.Async.{async, await} diff --git a/test/async/jvm/concurrent_patternAlternative.flags b/test/async/jvm/concurrent_patternAlternative.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_patternAlternative.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_patternAlternative.scala b/test/async/jvm/concurrent_patternAlternative.scala index c8baa10adc14..1db0f3d729b7 100644 --- a/test/async/jvm/concurrent_patternAlternative.scala +++ b/test/async/jvm/concurrent_patternAlternative.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._ import ExecutionContext.Implicits.global import scala.tools.partest.async.Async._ diff --git a/test/async/jvm/concurrent_patternAlternativeBothAnnotations.flags b/test/async/jvm/concurrent_patternAlternativeBothAnnotations.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_patternAlternativeBothAnnotations.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_patternAlternativeBothAnnotations.scala b/test/async/jvm/concurrent_patternAlternativeBothAnnotations.scala index 6e077edca592..78bf6858ae10 100644 --- a/test/async/jvm/concurrent_patternAlternativeBothAnnotations.scala +++ b/test/async/jvm/concurrent_patternAlternativeBothAnnotations.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._ import ExecutionContext.Implicits.global import scala.tools.partest.async.Async._ diff --git a/test/async/jvm/concurrent_polymorphicMethod.check b/test/async/jvm/concurrent_polymorphicMethod.check index d0926f1ea991..44b16a26e9ba 100644 --- a/test/async/jvm/concurrent_polymorphicMethod.check +++ b/test/async/jvm/concurrent_polymorphicMethod.check @@ -1,3 +1,3 @@ -concurrent_polymorphicMethod.scala:16: warning: unreachable code +concurrent_polymorphicMethod.scala:17: warning: unreachable code case _ if false => ???; ^ diff --git a/test/async/jvm/concurrent_polymorphicMethod.flags b/test/async/jvm/concurrent_polymorphicMethod.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_polymorphicMethod.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_polymorphicMethod.scala b/test/async/jvm/concurrent_polymorphicMethod.scala index 3d5a8d74c7d9..fb5226734a71 100644 --- a/test/async/jvm/concurrent_polymorphicMethod.scala +++ b/test/async/jvm/concurrent_polymorphicMethod.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._ import ExecutionContext.Implicits.global import scala.tools.partest.async.Async._ diff --git a/test/async/jvm/concurrent_shadowing.check b/test/async/jvm/concurrent_shadowing.check index f9715003cd51..1a68bc7ba04d 100644 --- a/test/async/jvm/concurrent_shadowing.check +++ b/test/async/jvm/concurrent_shadowing.check @@ -1,3 +1,3 @@ -concurrent_shadowing.scala:18: warning: a pure expression does nothing in statement position +concurrent_shadowing.scala:19: warning: a pure expression does nothing in statement position case _ => foo; () ^ diff --git a/test/async/jvm/concurrent_shadowing.flags b/test/async/jvm/concurrent_shadowing.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_shadowing.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_shadowing.scala b/test/async/jvm/concurrent_shadowing.scala index 185176e8d1e5..25b9c34caa0d 100644 --- a/test/async/jvm/concurrent_shadowing.scala +++ b/test/async/jvm/concurrent_shadowing.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._ import ExecutionContext.Implicits.global import scala.tools.partest.async.Async._ diff --git a/test/async/jvm/concurrent_shadowing0.flags b/test/async/jvm/concurrent_shadowing0.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_shadowing0.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_shadowing0.scala b/test/async/jvm/concurrent_shadowing0.scala index e47eafa5ceb6..1888578d77fd 100644 --- a/test/async/jvm/concurrent_shadowing0.scala +++ b/test/async/jvm/concurrent_shadowing0.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._ import ExecutionContext.Implicits.global import scala.tools.partest.async.Async._ diff --git a/test/async/jvm/concurrent_shadowing2.flags b/test/async/jvm/concurrent_shadowing2.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_shadowing2.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_shadowing2.scala b/test/async/jvm/concurrent_shadowing2.scala index b24a0f263e88..9066d4a3e37b 100644 --- a/test/async/jvm/concurrent_shadowing2.scala +++ b/test/async/jvm/concurrent_shadowing2.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._ import ExecutionContext.Implicits.global import scala.tools.partest.async.Async._ diff --git a/test/async/jvm/concurrent_shadowingRefinedTypes.flags b/test/async/jvm/concurrent_shadowingRefinedTypes.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_shadowingRefinedTypes.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_shadowingRefinedTypes.scala b/test/async/jvm/concurrent_shadowingRefinedTypes.scala index 4e711e4d43aa..fa785ed175df 100644 --- a/test/async/jvm/concurrent_shadowingRefinedTypes.scala +++ b/test/async/jvm/concurrent_shadowingRefinedTypes.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._ import ExecutionContext.Implicits.global import scala.tools.partest.async.Async._ diff --git a/test/async/jvm/concurrent_test0.flags b/test/async/jvm/concurrent_test0.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/concurrent_test0.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/concurrent_test0.scala b/test/async/jvm/concurrent_test0.scala index bfafe3f192fd..850f67f52b46 100644 --- a/test/async/jvm/concurrent_test0.scala +++ b/test/async/jvm/concurrent_test0.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync /* * Scala (https://www.scala-lang.org) * diff --git a/test/async/jvm/exceptions.flags b/test/async/jvm/exceptions.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/exceptions.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/exceptions.scala b/test/async/jvm/exceptions.scala index 9596d15358f9..45b328f942fa 100644 --- a/test/async/jvm/exceptions.scala +++ b/test/async/jvm/exceptions.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.exceptions.ExceptionsSpec]) package scala.async.run.exceptions { diff --git a/test/async/jvm/futures.check b/test/async/jvm/futures.check index e0d860861a0c..d479d8987613 100644 --- a/test/async/jvm/futures.check +++ b/test/async/jvm/futures.check @@ -1,12 +1,12 @@ -futures.scala:120: warning: match may not be exhaustive. +futures.scala:121: warning: match may not be exhaustive. It would fail on the following input: Failure(_) f2 onComplete { case Success(_) => throw new ThrowableTest("dispatcher receive") } ^ -futures.scala:127: warning: match may not be exhaustive. +futures.scala:128: warning: match may not be exhaustive. It would fail on the following input: Failure(_) f2 onComplete { case Success(_) => throw new ThrowableTest("current thread receive") } ^ -futures.scala:172: warning: match may not be exhaustive. +futures.scala:173: warning: match may not be exhaustive. It would fail on the following input: Req((x: T forSome x not in (Int, String))) def asyncReq[T](req: Req[T]) = req match { ^ diff --git a/test/async/jvm/futures.flags b/test/async/jvm/futures.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/futures.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/futures.scala b/test/async/jvm/futures.scala index baae0ad08c2f..04f2df8bcd56 100644 --- a/test/async/jvm/futures.scala +++ b/test/async/jvm/futures.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.futures.FutureSpec]) package scala.async { diff --git a/test/async/jvm/hygiene.flags b/test/async/jvm/hygiene.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/hygiene.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/hygiene.scala b/test/async/jvm/hygiene.scala index a5141abf04e9..0baa4fe18a20 100644 --- a/test/async/jvm/hygiene.scala +++ b/test/async/jvm/hygiene.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.hygiene.HygieneSpec]) package scala.async.run.hygiene { diff --git a/test/async/jvm/ifelse0.flags b/test/async/jvm/ifelse0.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/ifelse0.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/ifelse0.scala b/test/async/jvm/ifelse0.scala index 909d705ca2d3..ec7ba81aab75 100644 --- a/test/async/jvm/ifelse0.scala +++ b/test/async/jvm/ifelse0.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.ifelse0.IfElseSpec]) package scala.async.run.ifelse0 { diff --git a/test/async/jvm/ifelse0_while.flags b/test/async/jvm/ifelse0_while.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/ifelse0_while.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/ifelse0_while.scala b/test/async/jvm/ifelse0_while.scala index 0e6c1b1e0b47..34eb581b3194 100644 --- a/test/async/jvm/ifelse0_while.scala +++ b/test/async/jvm/ifelse0_while.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.ifelse0.WhileSpec]) package scala.async.run.ifelse0 { diff --git a/test/async/jvm/ifelse1.flags b/test/async/jvm/ifelse1.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/ifelse1.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/ifelse1.scala b/test/async/jvm/ifelse1.scala index 7cefcf674354..9216b69b43fb 100644 --- a/test/async/jvm/ifelse1.scala +++ b/test/async/jvm/ifelse1.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.ifelse1.IfElse1Spec]) package scala.async.run.ifelse1 { diff --git a/test/async/jvm/ifelse2.flags b/test/async/jvm/ifelse2.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/ifelse2.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/ifelse2.scala b/test/async/jvm/ifelse2.scala index 8c18b11ddae0..4f2803dbf2de 100644 --- a/test/async/jvm/ifelse2.scala +++ b/test/async/jvm/ifelse2.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.ifelse2.IfElse2Spec]) package scala.async.run.ifelse2 { diff --git a/test/async/jvm/ifelse3.flags b/test/async/jvm/ifelse3.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/ifelse3.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/ifelse3.scala b/test/async/jvm/ifelse3.scala index ade9ebe80020..0521c5716a78 100644 --- a/test/async/jvm/ifelse3.scala +++ b/test/async/jvm/ifelse3.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.ifelse3.IfElse3Spec]) package scala.async.run.ifelse3 { diff --git a/test/async/jvm/ifelse4.flags b/test/async/jvm/ifelse4.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/ifelse4.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/ifelse4.scala b/test/async/jvm/ifelse4.scala index ec7fe890ef6a..aed1783261e8 100644 --- a/test/async/jvm/ifelse4.scala +++ b/test/async/jvm/ifelse4.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.ifelse4.IfElse4Spec]) package scala.async.run.ifelse4 { diff --git a/test/async/jvm/lazyval.flags b/test/async/jvm/lazyval.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/lazyval.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/lazyval.scala b/test/async/jvm/lazyval.scala index 9d08d4ffd0f6..d3ed6fb0ad24 100644 --- a/test/async/jvm/lazyval.scala +++ b/test/async/jvm/lazyval.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.lazyval.LazyValSpec]) package scala.async.run.lazyval { diff --git a/test/async/jvm/live.flags b/test/async/jvm/live.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/live.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/live.scala b/test/async/jvm/live.scala index e4dc2c37dcf7..6361f23f9b20 100644 --- a/test/async/jvm/live.scala +++ b/test/async/jvm/live.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.live.LiveVariablesSpec]) package scala.async.run.live { diff --git a/test/async/jvm/localclasses.flags b/test/async/jvm/localclasses.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/localclasses.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/localclasses.scala b/test/async/jvm/localclasses.scala index 7f3191675a1f..8326f5704d28 100644 --- a/test/async/jvm/localclasses.scala +++ b/test/async/jvm/localclasses.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.neg.LocalClasses0Spec]) package scala.async.neg { diff --git a/test/async/jvm/match0.flags b/test/async/jvm/match0.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/match0.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/match0.scala b/test/async/jvm/match0.scala index 8b4309a7c6e6..533eb2efb4da 100644 --- a/test/async/jvm/match0.scala +++ b/test/async/jvm/match0.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.match0.MatchSpec]) package scala.async.run.match0 { diff --git a/test/async/jvm/nesteddef.flags b/test/async/jvm/nesteddef.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/nesteddef.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/nesteddef.scala b/test/async/jvm/nesteddef.scala index 15e804dcd5e3..1edb01e221af 100644 --- a/test/async/jvm/nesteddef.scala +++ b/test/async/jvm/nesteddef.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.nesteddef.NestedDef]) package scala.async.run.nesteddef { diff --git a/test/async/jvm/noawait.flags b/test/async/jvm/noawait.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/noawait.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/noawait.scala b/test/async/jvm/noawait.scala index 323b48462c84..a78446e898b8 100644 --- a/test/async/jvm/noawait.scala +++ b/test/async/jvm/noawait.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.noawait.NoAwaitSpec]) package scala.async.run.noawait { diff --git a/test/async/jvm/stackoverflow.flags b/test/async/jvm/stackoverflow.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/stackoverflow.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/stackoverflow.scala b/test/async/jvm/stackoverflow.scala index 37bf09b3bbdc..74de6caadf60 100644 --- a/test/async/jvm/stackoverflow.scala +++ b/test/async/jvm/stackoverflow.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._ import scala.concurrent.duration._ import ExecutionContext.Implicits.global diff --git a/test/async/jvm/syncOptimization.flags b/test/async/jvm/syncOptimization.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/syncOptimization.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/syncOptimization.scala b/test/async/jvm/syncOptimization.scala index 9570a2a0d18d..342db5010970 100644 --- a/test/async/jvm/syncOptimization.scala +++ b/test/async/jvm/syncOptimization.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.tools.partest.async.Async._ import scala.concurrent._ import scala.concurrent.duration._ diff --git a/test/async/jvm/toughtype.flags b/test/async/jvm/toughtype.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/jvm/toughtype.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/jvm/toughtype.scala b/test/async/jvm/toughtype.scala index 09052b365763..22f5b893b009 100644 --- a/test/async/jvm/toughtype.scala +++ b/test/async/jvm/toughtype.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync object Test extends scala.tools.partest.JUnitTest(classOf[scala.async.run.toughtype.ToughTypeSpec]) package scala.async.run.toughtype { diff --git a/test/async/neg/ill-nested-await.check b/test/async/neg/ill-nested-await.check index 3fa72873188b..683f821350e0 100644 --- a/test/async/neg/ill-nested-await.check +++ b/test/async/neg/ill-nested-await.check @@ -1,40 +1,40 @@ -ill-nested-await.scala:15: error: await must not be used under a nested method. +ill-nested-await.scala:16: error: await must not be used under a nested method. async { foo(0)(await(f(0))) } ^ -ill-nested-await.scala:20: error: await must not be used under a nested object. +ill-nested-await.scala:21: error: await must not be used under a nested object. async { object Nested { await(f(false)) } } ^ -ill-nested-await.scala:25: error: await must not be used under a nested trait. +ill-nested-await.scala:26: error: await must not be used under a nested trait. async { trait Nested { await(f(false)) } } ^ -ill-nested-await.scala:30: error: await must not be used under a nested class. +ill-nested-await.scala:31: error: await must not be used under a nested class. async { class Nested { await(f(false)) } } ^ -ill-nested-await.scala:35: error: await must not be used under a nested method. +ill-nested-await.scala:36: error: await must not be used under a nested method. async { () => { await(f(false)) } } ^ -ill-nested-await.scala:40: error: await must not be used under a nested function. +ill-nested-await.scala:41: error: await must not be used under a nested function. async { { case 0 => { await(f(false)) } } : PartialFunction[Int, Boolean] } ^ -ill-nested-await.scala:45: error: await must not be used under a try/catch. +ill-nested-await.scala:46: error: await must not be used under a try/catch. async { try { await(f(false)) } catch { case _: Throwable => } } ^ -ill-nested-await.scala:50: error: await must not be used under a try/catch. +ill-nested-await.scala:51: error: await must not be used under a try/catch. async { try { () } catch { case _: Throwable => await(f(false)) } } ^ -ill-nested-await.scala:55: error: await must not be used under a try/catch. +ill-nested-await.scala:56: error: await must not be used under a try/catch. async { try { () } finally { await(f(false)) } } ^ -ill-nested-await.scala:60: error: await must not be used under a nested method. +ill-nested-await.scala:61: error: await must not be used under a nested method. async { def foo = await(f(false)) } ^ -ill-nested-await.scala:69: error: await must not be used under a lazy val initializer. +ill-nested-await.scala:70: error: await must not be used under a lazy val initializer. def foo(): Any = async { val x = { lazy val y = await(f(0)); y } } ^ -ill-nested-await.scala:75: error: await must not be used under a nested method. +ill-nested-await.scala:76: error: await must not be used under a nested method. async { fooAsByNameLambda(await(f(""))) } ^ -ill-nested-await.scala:9: error: `await` must be enclosed in an `async` block +ill-nested-await.scala:10: error: `await` must be enclosed in an `async` block await[Any](f(null)) ^ 13 errors found diff --git a/test/async/neg/ill-nested-await.flags b/test/async/neg/ill-nested-await.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/neg/ill-nested-await.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/neg/ill-nested-await.scala b/test/async/neg/ill-nested-await.scala index afb5656d1bee..956ee0aba9bd 100644 --- a/test/async/neg/ill-nested-await.scala +++ b/test/async/neg/ill-nested-await.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.concurrent._ import ExecutionContext.Implicits.global import scala.tools.partest.async.Async._ diff --git a/test/async/neg/naked_await.check b/test/async/neg/naked_await.check index e09a175ed9b4..ba1250f4d64b 100644 --- a/test/async/neg/naked_await.check +++ b/test/async/neg/naked_await.check @@ -1,7 +1,7 @@ -naked_await.scala:8: error: await must not be used under a nested method. +naked_await.scala:9: error: await must not be used under a nested method. def foo = await(Future(3)) ^ -naked_await.scala:10: error: `await` must be enclosed in an `async` block +naked_await.scala:11: error: `await` must be enclosed in an `async` block await(Future(4)) ^ two errors found diff --git a/test/async/neg/naked_await.flags b/test/async/neg/naked_await.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/neg/naked_await.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/neg/naked_await.scala b/test/async/neg/naked_await.scala index 3c09117b4788..73cb96f6cadf 100644 --- a/test/async/neg/naked_await.scala +++ b/test/async/neg/naked_await.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.tools.partest.async.Async._ import scala.concurrent.{ExecutionContext, Future} diff --git a/test/async/neg/stark_naked_await.check b/test/async/neg/stark_naked_await.check index 322467db1175..b79a4131923d 100644 --- a/test/async/neg/stark_naked_await.check +++ b/test/async/neg/stark_naked_await.check @@ -1,4 +1,4 @@ -stark_naked_await.scala:6: error: `await` must be enclosed in an `async` block +stark_naked_await.scala:7: error: `await` must be enclosed in an `async` block await(Future(4)) ^ one error found diff --git a/test/async/neg/stark_naked_await.flags b/test/async/neg/stark_naked_await.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/neg/stark_naked_await.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/neg/stark_naked_await.scala b/test/async/neg/stark_naked_await.scala index 753f636fe2dd..dc184bf8e637 100644 --- a/test/async/neg/stark_naked_await.scala +++ b/test/async/neg/stark_naked_await.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.tools.partest.async.Async._ import scala.concurrent.{ExecutionContext, Future} diff --git a/test/async/run/booleans.flags b/test/async/run/booleans.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/run/booleans.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/run/booleans.scala b/test/async/run/booleans.scala index 22be02b6dfbf..2f29c0a0ac2b 100644 --- a/test/async/run/booleans.scala +++ b/test/async/run/booleans.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.tools.partest.async.OptionAwait._ import org.junit.Assert._ diff --git a/test/async/run/edge-cases.flags b/test/async/run/edge-cases.flags deleted file mode 100644 index decae4aaa064..000000000000 --- a/test/async/run/edge-cases.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync \ No newline at end of file diff --git a/test/async/run/edge-cases.scala b/test/async/run/edge-cases.scala index 37d76e8f9eb1..21ce019c29cf 100644 --- a/test/async/run/edge-cases.scala +++ b/test/async/run/edge-cases.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.tools.partest.async.OptionAwait._ import org.junit.Assert._ diff --git a/test/async/run/lambda.flags b/test/async/run/lambda.flags deleted file mode 100644 index e071b133c07a..000000000000 --- a/test/async/run/lambda.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync diff --git a/test/async/run/lambda.scala b/test/async/run/lambda.scala index 51d3449a6b87..e5bc312f6ea0 100644 --- a/test/async/run/lambda.scala +++ b/test/async/run/lambda.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.tools.partest.async.OptionAwait._ //import org.junit.Assert._ diff --git a/test/async/run/output.flags b/test/async/run/output.flags deleted file mode 100644 index decae4aaa064..000000000000 --- a/test/async/run/output.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync \ No newline at end of file diff --git a/test/async/run/output.scala b/test/async/run/output.scala index fab8152c2b32..0984f0f1cd34 100644 --- a/test/async/run/output.scala +++ b/test/async/run/output.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.tools.partest.async.{OutputAwait, Output} import scala.collection.immutable import OutputAwait._ diff --git a/test/async/run/smoketest.flags b/test/async/run/smoketest.flags deleted file mode 100644 index decae4aaa064..000000000000 --- a/test/async/run/smoketest.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync \ No newline at end of file diff --git a/test/async/run/smoketest.scala b/test/async/run/smoketest.scala index 713256b7fd04..563eb54c6408 100644 --- a/test/async/run/smoketest.scala +++ b/test/async/run/smoketest.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.tools.partest.async.OptionAwait._ import org.junit.Assert._ @@ -65,4 +66,4 @@ object Test { } }) } -} \ No newline at end of file +} diff --git a/test/async/run/value-class.flags b/test/async/run/value-class.flags deleted file mode 100644 index decae4aaa064..000000000000 --- a/test/async/run/value-class.flags +++ /dev/null @@ -1 +0,0 @@ --Xasync \ No newline at end of file diff --git a/test/async/run/value-class.scala b/test/async/run/value-class.scala index 7d8ff1a2467f..454bee15aaa6 100644 --- a/test/async/run/value-class.scala +++ b/test/async/run/value-class.scala @@ -1,3 +1,4 @@ +// scalac: -Xasync import scala.tools.partest.async.OptionAwait._ import org.junit.Assert._ diff --git a/test/files/instrumented/inline-in-constructors.flags b/test/files/instrumented/inline-in-constructors.flags deleted file mode 100644 index 0d25de8ef6a9..000000000000 --- a/test/files/instrumented/inline-in-constructors.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** diff --git a/test/files/instrumented/inline-in-constructors/assert_1.scala b/test/files/instrumented/inline-in-constructors/assert_1.scala index a03757b89c47..df25b72726bd 100644 --- a/test/files/instrumented/inline-in-constructors/assert_1.scala +++ b/test/files/instrumented/inline-in-constructors/assert_1.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** package instrumented object MyPredef { diff --git a/test/files/instrumented/inline-in-constructors/bar_2.scala b/test/files/instrumented/inline-in-constructors/bar_2.scala index 418dac5a6769..6c23832f87fb 100644 --- a/test/files/instrumented/inline-in-constructors/bar_2.scala +++ b/test/files/instrumented/inline-in-constructors/bar_2.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** package instrumented /** Class that uses assert compiled in previous compiler run so we check if diff --git a/test/files/instrumented/inline-in-constructors/test_3.scala b/test/files/instrumented/inline-in-constructors/test_3.scala index 949e9945e781..2f8b98cf25b9 100644 --- a/test/files/instrumented/inline-in-constructors/test_3.scala +++ b/test/files/instrumented/inline-in-constructors/test_3.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** import scala.tools.partest.instrumented.Instrumentation._ import instrumented._ diff --git a/test/files/jvm/annotations.check b/test/files/jvm/annotations.check index d0e36da050ac..a8600108124f 100644 --- a/test/files/jvm/annotations.check +++ b/test/files/jvm/annotations.check @@ -1,4 +1,4 @@ -Test_2.scala:7: warning: class remote in package scala is deprecated (since 2.12.0): extend java.rmi.Remote instead and add @throws[java.rmi.RemoteException] to public methods +Test_2.scala:8: warning: class remote in package scala is deprecated (since 2.12.0): extend java.rmi.Remote instead and add @throws[java.rmi.RemoteException] to public methods def foo: Unit = () ^ class java.rmi.RemoteException diff --git a/test/files/jvm/annotations.flags b/test/files/jvm/annotations.flags deleted file mode 100644 index c36e713ab84b..000000000000 --- a/test/files/jvm/annotations.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation \ No newline at end of file diff --git a/test/files/jvm/annotations/Test_2.scala b/test/files/jvm/annotations/Test_2.scala index dd3e4fd5f88f..d46bae58d525 100644 --- a/test/files/jvm/annotations/Test_2.scala +++ b/test/files/jvm/annotations/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation import scala.language.{ higherKinds, reflectiveCalls } diff --git a/test/files/jvm/bytecode-test-example.flags b/test/files/jvm/bytecode-test-example.flags deleted file mode 100644 index 213d7425d189..000000000000 --- a/test/files/jvm/bytecode-test-example.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:none diff --git a/test/files/jvm/bytecode-test-example/Foo_1.scala b/test/files/jvm/bytecode-test-example/Foo_1.scala index 4f679d156fb8..c20115ac9bc1 100644 --- a/test/files/jvm/bytecode-test-example/Foo_1.scala +++ b/test/files/jvm/bytecode-test-example/Foo_1.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:none class Foo_1 { def foo(x: AnyRef): Int = { val bool = x == null diff --git a/test/files/jvm/bytecode-test-example/Test.scala b/test/files/jvm/bytecode-test-example/Test.scala index 0da54d5bde4d..af0e91e448e6 100644 --- a/test/files/jvm/bytecode-test-example/Test.scala +++ b/test/files/jvm/bytecode-test-example/Test.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:none import scala.tools.partest.BytecodeTest import scala.tools.nsc.util.JavaClassPath diff --git a/test/files/jvm/matchbox.flags b/test/files/jvm/matchbox.flags deleted file mode 100644 index c5c0127aa26f..000000000000 --- a/test/files/jvm/matchbox.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:method \ No newline at end of file diff --git a/test/files/jvm/matchbox/Test.scala b/test/files/jvm/matchbox/Test.scala index 2e336fbdaa83..867b9a09cdd0 100644 --- a/test/files/jvm/matchbox/Test.scala +++ b/test/files/jvm/matchbox/Test.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:method import scala.tools.partest.BytecodeTest import scala.tools.asm import asm.ClassReader @@ -40,4 +41,4 @@ object Test extends BytecodeTest { println(s"$boxunbox $checkcast $instanceof") } } -} \ No newline at end of file +} diff --git a/test/files/jvm/matchbox/matchbox_1.scala b/test/files/jvm/matchbox/matchbox_1.scala index bd839b53cc11..ab86d11330ef 100644 --- a/test/files/jvm/matchbox/matchbox_1.scala +++ b/test/files/jvm/matchbox/matchbox_1.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:method object Matchbox { import scala.{specialized => sp} @@ -27,4 +28,4 @@ object Matchbox { case (x: Int, y: Long) => x + y case _ => 20 } -} \ No newline at end of file +} diff --git a/test/files/jvm/t10512a.scala b/test/files/jvm/t10512a.scala index a91eee80e6d7..93704cb1e2c9 100644 --- a/test/files/jvm/t10512a.scala +++ b/test/files/jvm/t10512a.scala @@ -40,4 +40,4 @@ object Test extends App { import JsonEncoderInstances._ implicitly[JsonEncoder[List[String]]].encode("" :: Nil) -} \ No newline at end of file +} diff --git a/test/files/jvm/t8582.check b/test/files/jvm/t8582.check index 0a23cb0c9385..1a96d9a8614a 100644 --- a/test/files/jvm/t8582.check +++ b/test/files/jvm/t8582.check @@ -1,4 +1,4 @@ -t8582.scala:17: warning: class BeanInfo in package beans is deprecated (since 2.12.0): the generation of BeanInfo classes is no longer supported +t8582.scala:18: warning: class BeanInfo in package beans is deprecated (since 2.12.0): the generation of BeanInfo classes is no longer supported class C1 ^ getClass on module gives module class diff --git a/test/files/jvm/t8582.flags b/test/files/jvm/t8582.flags deleted file mode 100644 index dcc59ebe32ef..000000000000 --- a/test/files/jvm/t8582.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation diff --git a/test/files/jvm/t8582.scala b/test/files/jvm/t8582.scala index e9a01f901664..fdecef8e4000 100644 --- a/test/files/jvm/t8582.scala +++ b/test/files/jvm/t8582.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation import scala.tools.partest.BytecodeTest import scala.collection.JavaConverters._ diff --git a/test/files/jvm/unreachable/Foo_1.check b/test/files/jvm/unreachable/Foo_1.check new file mode 100644 index 000000000000..4e41284c58a0 --- /dev/null +++ b/test/files/jvm/unreachable/Foo_1.check @@ -0,0 +1,36 @@ +java.lang.ClassNotFoundException: Test + at java.net.URLClassLoader.findClass(URLClassLoader.java:382) + at java.lang.ClassLoader.loadClass(ClassLoader.java:419) + at java.lang.ClassLoader.loadClass(ClassLoader.java:352) + at scala.tools.partest.nest.Runner.$anonfun$execTestInProcess$2(Runner.scala:251) + at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62) + at scala.Console$.withOut(Console.scala:167) + at scala.tools.partest.nest.StreamCapture$.$anonfun$capturingOutErr$2(StreamCapture.scala:44) + at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62) + at scala.Console$.withErr(Console.scala:196) + at scala.tools.partest.nest.StreamCapture$.$anonfun$capturingOutErr$1(StreamCapture.scala:43) + at scala.tools.partest.nest.StreamCapture$.savingSystem(StreamCapture.scala:22) + at scala.tools.partest.nest.StreamCapture$.capturingOutErr(StreamCapture.scala:38) + at scala.tools.partest.nest.Runner.$anonfun$execTestInProcess$1(Runner.scala:250) + at scala.tools.partest.nest.StreamCapture$.withExtraProperties(StreamCapture.scala:68) + at scala.tools.partest.nest.Runner.run$2(Runner.scala:246) + at scala.tools.partest.nest.Runner.$anonfun$execTestInProcess$3(Runner.scala:273) + at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) + at scala.tools.partest.nest.TrapExit$.apply(TrapExit.scala:28) + at scala.tools.partest.nest.Runner.execTestInProcess(Runner.scala:273) + at scala.tools.partest.nest.Runner.exec$1(Runner.scala:675) + at scala.tools.partest.nest.Runner.$anonfun$runRunTest$1(Runner.scala:677) + at scala.tools.partest.TestState.andAlso(TestState.scala:33) + at scala.tools.partest.nest.Runner.$anonfun$runTestCommon$1(Runner.scala:577) + at scala.tools.partest.nest.Runner.runInContext(Runner.scala:438) + at scala.tools.partest.nest.Runner.runTestCommon(Runner.scala:574) + at scala.tools.partest.nest.Runner.runRunTest(Runner.scala:677) + at scala.tools.partest.nest.Runner.run(Runner.scala:666) + at scala.tools.partest.nest.AbstractRunner.liftedTree1$1(AbstractRunner.scala:310) + at scala.tools.partest.nest.AbstractRunner.runTest(AbstractRunner.scala:310) + at scala.tools.partest.nest.AbstractRunner.$anonfun$runTestsForFiles$2(AbstractRunner.scala:335) + at scala.tools.partest.package$$anon$2.call(package.scala:141) + at java.util.concurrent.FutureTask.run(FutureTask.java:266) + at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) + at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) + at java.lang.Thread.run(Thread.java:748) diff --git a/test/files/jvm/unreachable/Foo_1.flags b/test/files/jvm/unreachable/Foo_1.flags deleted file mode 100644 index d0a417b3c888..000000000000 --- a/test/files/jvm/unreachable/Foo_1.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:default \ No newline at end of file diff --git a/test/files/jvm/unreachable/Foo_1.scala b/test/files/jvm/unreachable/Foo_1.scala index 600b96bb18a6..0f95941db05f 100644 --- a/test/files/jvm/unreachable/Foo_1.scala +++ b/test/files/jvm/unreachable/Foo_1.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:default import scala.sys.error class Foo_1 { diff --git a/test/files/neg/abstract-explaintypes.check b/test/files/neg/abstract-explaintypes.check index e303b45a3251..8bf8f10320b9 100644 --- a/test/files/neg/abstract-explaintypes.check +++ b/test/files/neg/abstract-explaintypes.check @@ -1,11 +1,11 @@ -abstract-explaintypes.scala:6: error: type mismatch; +abstract-explaintypes.scala:7: error: type mismatch; found : A required: A.this.T def foo2: T = bar().baz(); ^ A <: A.this.T? false -abstract-explaintypes.scala:9: error: type mismatch; +abstract-explaintypes.scala:10: error: type mismatch; found : A required: A.this.T def foo5: T = baz().baz(); diff --git a/test/files/neg/abstract-explaintypes.flags b/test/files/neg/abstract-explaintypes.flags deleted file mode 100644 index b36707c7cfcf..000000000000 --- a/test/files/neg/abstract-explaintypes.flags +++ /dev/null @@ -1 +0,0 @@ --explaintypes diff --git a/test/files/neg/abstract-explaintypes.scala b/test/files/neg/abstract-explaintypes.scala index f8ecae16fa73..bf6b3a6ea363 100644 --- a/test/files/neg/abstract-explaintypes.scala +++ b/test/files/neg/abstract-explaintypes.scala @@ -1,3 +1,4 @@ +// scalac: -explaintypes trait A { type T <: A; def baz(): A; diff --git a/test/files/neg/abstract-inaccessible.check b/test/files/neg/abstract-inaccessible.check index 739620a4cead..e5f3917b7049 100644 --- a/test/files/neg/abstract-inaccessible.check +++ b/test/files/neg/abstract-inaccessible.check @@ -1,12 +1,12 @@ -abstract-inaccessible.scala:5: warning: method implementMe in trait YourTrait references private[foo] trait Bippy. +abstract-inaccessible.scala:6: warning: method implementMe in trait YourTrait references private[foo] trait Bippy. Classes which cannot access Bippy may be unable to provide a concrete implementation of implementMe. def implementMe(f: Int => (String, Bippy)): Unit ^ -abstract-inaccessible.scala:6: warning: method overrideMe in trait YourTrait references private[foo] trait Bippy. +abstract-inaccessible.scala:7: warning: method overrideMe in trait YourTrait references private[foo] trait Bippy. Classes which cannot access Bippy may be unable to override overrideMe. def overrideMe[T <: Bippy](x: T): T = x ^ -abstract-inaccessible.scala:7: warning: method overrideMeAlso in trait YourTrait references private[foo] trait Bippy. +abstract-inaccessible.scala:8: warning: method overrideMeAlso in trait YourTrait references private[foo] trait Bippy. Classes which cannot access Bippy may be unable to override overrideMeAlso. def overrideMeAlso(x: Map[Int, Set[Bippy]]) = x.keys.head ^ diff --git a/test/files/neg/abstract-inaccessible.flags b/test/files/neg/abstract-inaccessible.flags deleted file mode 100644 index ea7773e2557b..000000000000 --- a/test/files/neg/abstract-inaccessible.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xlint:inaccessible diff --git a/test/files/neg/abstract-inaccessible.scala b/test/files/neg/abstract-inaccessible.scala index 02b458016f25..fc67770e3d84 100644 --- a/test/files/neg/abstract-inaccessible.scala +++ b/test/files/neg/abstract-inaccessible.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:inaccessible package foo { private[foo] trait Bippy { } diff --git a/test/files/neg/aladdin1055.check b/test/files/neg/aladdin1055.check index 41782ae987ee..b0e686184572 100644 --- a/test/files/neg/aladdin1055.check +++ b/test/files/neg/aladdin1055.check @@ -1,4 +1,4 @@ -Test_1.scala:2: warning: match may not be exhaustive. +Test_1.scala:3: warning: match may not be exhaustive. It would fail on the following input: (_ : this.) def foo(t: A.T) = t match { ^ diff --git a/test/files/neg/aladdin1055.flags b/test/files/neg/aladdin1055.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/aladdin1055.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/aladdin1055/A.scala b/test/files/neg/aladdin1055/A.scala index 862336e30cb1..79d915321d7a 100644 --- a/test/files/neg/aladdin1055/A.scala +++ b/test/files/neg/aladdin1055/A.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object A { sealed trait T { def f: Int } class TT extends T { def f = 0 } diff --git a/test/files/neg/aladdin1055/Test_1.scala b/test/files/neg/aladdin1055/Test_1.scala index 39d9b1dc980d..4e2fb0c3ba14 100644 --- a/test/files/neg/aladdin1055/Test_1.scala +++ b/test/files/neg/aladdin1055/Test_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { def foo(t: A.T) = t match { case a: A.TT => 0 diff --git a/test/files/neg/applydynamic_sip.check b/test/files/neg/applydynamic_sip.check index 43602a126c11..6487b34067f7 100644 --- a/test/files/neg/applydynamic_sip.check +++ b/test/files/neg/applydynamic_sip.check @@ -1,86 +1,86 @@ -applydynamic_sip.scala:7: error: applyDynamic does not support passing a vararg parameter +applydynamic_sip.scala:8: error: applyDynamic does not support passing a vararg parameter qual.sel(a, a2: _*) ^ -applydynamic_sip.scala:7: error: value applyDynamic is not a member of Dynamic +applydynamic_sip.scala:8: error: value applyDynamic is not a member of Dynamic error after rewriting to Test.this.qual.("sel") possible cause: maybe a wrong Dynamic method signature? qual.sel(a, a2: _*) ^ -applydynamic_sip.scala:8: error: applyDynamicNamed does not support passing a vararg parameter +applydynamic_sip.scala:9: error: applyDynamicNamed does not support passing a vararg parameter qual.sel(arg = a, a2: _*) ^ -applydynamic_sip.scala:8: error: value applyDynamicNamed is not a member of Dynamic +applydynamic_sip.scala:9: error: value applyDynamicNamed is not a member of Dynamic error after rewriting to Test.this.qual.("sel") possible cause: maybe a wrong Dynamic method signature? qual.sel(arg = a, a2: _*) ^ -applydynamic_sip.scala:8: error: not found: value arg +applydynamic_sip.scala:9: error: not found: value arg qual.sel(arg = a, a2: _*) ^ -applydynamic_sip.scala:9: error: applyDynamicNamed does not support passing a vararg parameter +applydynamic_sip.scala:10: error: applyDynamicNamed does not support passing a vararg parameter qual.sel(arg, arg2 = "a2", a2: _*) ^ -applydynamic_sip.scala:9: error: value applyDynamicNamed is not a member of Dynamic +applydynamic_sip.scala:10: error: value applyDynamicNamed is not a member of Dynamic error after rewriting to Test.this.qual.("sel") possible cause: maybe a wrong Dynamic method signature? qual.sel(arg, arg2 = "a2", a2: _*) ^ -applydynamic_sip.scala:9: error: not found: value arg +applydynamic_sip.scala:10: error: not found: value arg qual.sel(arg, arg2 = "a2", a2: _*) ^ -applydynamic_sip.scala:9: error: not found: value arg2 +applydynamic_sip.scala:10: error: not found: value arg2 qual.sel(arg, arg2 = "a2", a2: _*) ^ -applydynamic_sip.scala:18: error: type mismatch; +applydynamic_sip.scala:19: error: type mismatch; found : String("sel") required: Int error after rewriting to Test.this.bad1.selectDynamic("sel") possible cause: maybe a wrong Dynamic method signature? bad1.sel ^ -applydynamic_sip.scala:19: error: type mismatch; +applydynamic_sip.scala:20: error: type mismatch; found : String("sel") required: Int error after rewriting to Test.this.bad1.applyDynamic("sel") possible cause: maybe a wrong Dynamic method signature? bad1.sel(1) ^ -applydynamic_sip.scala:20: error: type mismatch; +applydynamic_sip.scala:21: error: type mismatch; found : String("sel") required: Int error after rewriting to Test.this.bad1.applyDynamicNamed("sel") possible cause: maybe a wrong Dynamic method signature? bad1.sel(a = 1) ^ -applydynamic_sip.scala:20: error: reassignment to val +applydynamic_sip.scala:21: error: reassignment to val bad1.sel(a = 1) ^ -applydynamic_sip.scala:21: error: type mismatch; +applydynamic_sip.scala:22: error: type mismatch; found : String("sel") required: Int error after rewriting to Test.this.bad1.updateDynamic("sel") possible cause: maybe a wrong Dynamic method signature? bad1.sel = 1 ^ -applydynamic_sip.scala:29: error: Int does not take parameters +applydynamic_sip.scala:30: error: Int does not take parameters error after rewriting to Test.this.bad2.selectDynamic("sel") possible cause: maybe a wrong Dynamic method signature? bad2.sel ^ -applydynamic_sip.scala:30: error: Int does not take parameters +applydynamic_sip.scala:31: error: Int does not take parameters error after rewriting to Test.this.bad2.applyDynamic("sel") possible cause: maybe a wrong Dynamic method signature? bad2.sel(1) ^ -applydynamic_sip.scala:31: error: Int does not take parameters +applydynamic_sip.scala:32: error: Int does not take parameters error after rewriting to Test.this.bad2.applyDynamicNamed("sel") possible cause: maybe a wrong Dynamic method signature? bad2.sel(a = 1) ^ -applydynamic_sip.scala:31: error: reassignment to val +applydynamic_sip.scala:32: error: reassignment to val bad2.sel(a = 1) ^ -applydynamic_sip.scala:32: error: Int does not take parameters +applydynamic_sip.scala:33: error: Int does not take parameters error after rewriting to Test.this.bad2.updateDynamic("sel") possible cause: maybe a wrong Dynamic method signature? bad2.sel = 1 diff --git a/test/files/neg/applydynamic_sip.flags b/test/files/neg/applydynamic_sip.flags deleted file mode 100644 index 1141f975075d..000000000000 --- a/test/files/neg/applydynamic_sip.flags +++ /dev/null @@ -1 +0,0 @@ --language:dynamics diff --git a/test/files/neg/applydynamic_sip.scala b/test/files/neg/applydynamic_sip.scala index ee4432ebe604..1d09bfabafe6 100644 --- a/test/files/neg/applydynamic_sip.scala +++ b/test/files/neg/applydynamic_sip.scala @@ -1,3 +1,4 @@ +// scalac: -language:dynamics object Test extends App { val qual: Dynamic = ??? val expr = "expr" diff --git a/test/files/neg/bad-advice.check b/test/files/neg/bad-advice.check index 03b3e4f616ae..dbb1775b74eb 100644 --- a/test/files/neg/bad-advice.check +++ b/test/files/neg/bad-advice.check @@ -1,4 +1,4 @@ -bad-advice.scala:4: error: pattern type is incompatible with expected type; +bad-advice.scala:5: error: pattern type is incompatible with expected type; found : Bip.type required: Int case Bip => true diff --git a/test/files/neg/bad-advice.flags b/test/files/neg/bad-advice.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/bad-advice.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/bad-advice.scala b/test/files/neg/bad-advice.scala index b1955330d7ed..f3e22376c998 100644 --- a/test/files/neg/bad-advice.scala +++ b/test/files/neg/bad-advice.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Bip object Test { def f(x: Int) = x match { diff --git a/test/files/neg/badtok-1-212.check b/test/files/neg/badtok-1-212.check index e3e1fc0efff5..7e3d7cbdfdf1 100644 --- a/test/files/neg/badtok-1-212.check +++ b/test/files/neg/badtok-1-212.check @@ -1,16 +1,16 @@ -badtok-1-212.scala:2: error: unclosed character literal (or use " not ' for string literal) +badtok-1-212.scala:3: error: unclosed character literal (or use " not ' for string literal) '42' ^ -badtok-1-212.scala:2: error: unclosed character literal (or use " not ' for string literal) +badtok-1-212.scala:3: error: unclosed character literal (or use " not ' for string literal) '42' ^ -badtok-1-212.scala:6: warning: deprecated syntax for character literal (use '\'' for single quote) +badtok-1-212.scala:7: warning: deprecated syntax for character literal (use '\'' for single quote) ''' ^ -badtok-1-212.scala:8: error: empty character literal +badtok-1-212.scala:9: error: empty character literal ''; ^ -badtok-1-212.scala:10: error: unclosed character literal +badtok-1-212.scala:11: error: unclosed character literal ' ^ one warning found diff --git a/test/files/neg/badtok-1-212.flags b/test/files/neg/badtok-1-212.flags deleted file mode 100644 index 34e1a0cfb4e0..000000000000 --- a/test/files/neg/badtok-1-212.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.12 -deprecation -Xfatal-warnings diff --git a/test/files/neg/badtok-1-212.scala b/test/files/neg/badtok-1-212.scala index 08966adb7d09..0d1bd5f64db6 100644 --- a/test/files/neg/badtok-1-212.scala +++ b/test/files/neg/badtok-1-212.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.12 -deprecation -Xfatal-warnings // bug 989 '42' diff --git a/test/files/neg/badtok-1.check b/test/files/neg/badtok-1.check index 7b8bfbbafc1b..d795c6c34aa2 100644 --- a/test/files/neg/badtok-1.check +++ b/test/files/neg/badtok-1.check @@ -1,31 +1,31 @@ -badtok-1.scala:2: error: unclosed character literal (or use " not ' for string literal) +badtok-1.scala:3: error: unclosed character literal (or use " not ' for string literal) '42' ^ -badtok-1.scala:2: error: unclosed character literal (or use " not ' for string literal) +badtok-1.scala:3: error: unclosed character literal (or use " not ' for string literal) '42' ^ -badtok-1.scala:6: error: empty character literal (use '\'' for single quote) +badtok-1.scala:7: error: empty character literal (use '\'' for single quote) ''' ^ -badtok-1.scala:6: error: unclosed character literal (or use " not ' for string literal) +badtok-1.scala:7: error: unclosed character literal (or use " not ' for string literal) ''' ^ -badtok-1.scala:8: error: empty character literal +badtok-1.scala:9: error: empty character literal ''; ^ -badtok-1.scala:11: error: unclosed character literal (or use " for string literal "''abc") +badtok-1.scala:12: error: unclosed character literal (or use " for string literal "''abc") 'abc' ^ -badtok-1.scala:13: error: unclosed character literal (or use " for string literal "utf_8") +badtok-1.scala:14: error: unclosed character literal (or use " for string literal "utf_8") 'utf_8' ^ -badtok-1.scala:15: error: unclosed character literal (or use " not ' for string literal) +badtok-1.scala:16: error: unclosed character literal (or use " not ' for string literal) 'utf-8' ^ -badtok-1.scala:17: error: unclosed character literal +badtok-1.scala:18: error: unclosed character literal ' ^ -badtok-1.scala:11: error: expected class or object definition +badtok-1.scala:12: error: expected class or object definition 'abc' ^ 10 errors found diff --git a/test/files/neg/badtok-1.flags b/test/files/neg/badtok-1.flags deleted file mode 100644 index 0c78115b8727..000000000000 --- a/test/files/neg/badtok-1.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 -deprecation -Xfatal-warnings diff --git a/test/files/neg/badtok-1.scala b/test/files/neg/badtok-1.scala index 88351d0cebca..a6f4e51eef1e 100644 --- a/test/files/neg/badtok-1.scala +++ b/test/files/neg/badtok-1.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 -deprecation -Xfatal-warnings // bug 989 '42' diff --git a/test/files/neg/beanInfoDeprecation.check b/test/files/neg/beanInfoDeprecation.check index a91cdabae2ac..e46e912a9b7b 100644 --- a/test/files/neg/beanInfoDeprecation.check +++ b/test/files/neg/beanInfoDeprecation.check @@ -1,4 +1,4 @@ -beanInfoDeprecation.scala:2: warning: class BeanInfo in package beans is deprecated (since 2.12.0): the generation of BeanInfo classes is no longer supported +beanInfoDeprecation.scala:3: warning: class BeanInfo in package beans is deprecated (since 2.12.0): the generation of BeanInfo classes is no longer supported class C ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/beanInfoDeprecation.flags b/test/files/neg/beanInfoDeprecation.flags deleted file mode 100644 index c6bfaf1f64a4..000000000000 --- a/test/files/neg/beanInfoDeprecation.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings diff --git a/test/files/neg/beanInfoDeprecation.scala b/test/files/neg/beanInfoDeprecation.scala index c7e3a86202d0..efabd555506d 100644 --- a/test/files/neg/beanInfoDeprecation.scala +++ b/test/files/neg/beanInfoDeprecation.scala @@ -1,2 +1,3 @@ +// scalac: -deprecation -Xfatal-warnings @scala.beans.BeanInfo class C diff --git a/test/files/neg/case-collision-multifile.check b/test/files/neg/case-collision-multifile.check index f8970cd754f0..0f5ae64566f2 100644 --- a/test/files/neg/case-collision-multifile.check +++ b/test/files/neg/case-collision-multifile.check @@ -1,4 +1,4 @@ -two.scala:1: warning: Generated class hotDog differs only in case from HotDog (defined in one.scala). +two.scala:2: warning: Generated class hotDog differs only in case from HotDog (defined in one.scala). Such classes will overwrite one another on case-insensitive filesystems. class hotDog ^ diff --git a/test/files/neg/case-collision-multifile.flags b/test/files/neg/case-collision-multifile.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/case-collision-multifile.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/case-collision-multifile/one.scala b/test/files/neg/case-collision-multifile/one.scala index 7c9cb4fec892..2836f2e6dd2c 100644 --- a/test/files/neg/case-collision-multifile/one.scala +++ b/test/files/neg/case-collision-multifile/one.scala @@ -1 +1,2 @@ -class HotDog \ No newline at end of file +// scalac: -Xfatal-warnings +class HotDog diff --git a/test/files/neg/case-collision-multifile/two.scala b/test/files/neg/case-collision-multifile/two.scala index 61616181f0c8..30364a562886 100644 --- a/test/files/neg/case-collision-multifile/two.scala +++ b/test/files/neg/case-collision-multifile/two.scala @@ -1 +1,2 @@ -class hotDog \ No newline at end of file +// scalac: -Xfatal-warnings +class hotDog diff --git a/test/files/neg/case-collision.check b/test/files/neg/case-collision.check index e5ce041d073d..0f53c00470c0 100644 --- a/test/files/neg/case-collision.check +++ b/test/files/neg/case-collision.check @@ -1,24 +1,24 @@ -case-collision.scala:5: warning: Generated class foo.BIPPY differs only in case from foo.Bippy. +case-collision.scala:6: warning: Generated class foo.BIPPY differs only in case from foo.Bippy. Such classes will overwrite one another on case-insensitive filesystems. class BIPPY ^ -case-collision.scala:8: warning: Generated class foo.DINGO$ differs only in case from foo.Dingo$. +case-collision.scala:9: warning: Generated class foo.DINGO$ differs only in case from foo.Dingo$. Such classes will overwrite one another on case-insensitive filesystems. object DINGO ^ -case-collision.scala:8: warning: Generated class foo.DINGO differs only in case from foo.Dingo. +case-collision.scala:9: warning: Generated class foo.DINGO differs only in case from foo.Dingo. Such classes will overwrite one another on case-insensitive filesystems. object DINGO ^ -case-collision.scala:11: warning: Generated class foo.HyRaX$ differs only in case from foo.Hyrax$. +case-collision.scala:12: warning: Generated class foo.HyRaX$ differs only in case from foo.Hyrax$. Such classes will overwrite one another on case-insensitive filesystems. object HyRaX ^ -case-collision.scala:11: warning: Generated class foo.HyRaX differs only in case from foo.Hyrax. +case-collision.scala:12: warning: Generated class foo.HyRaX differs only in case from foo.Hyrax. Such classes will overwrite one another on case-insensitive filesystems. object HyRaX ^ -case-collision.scala:14: warning: Generated class foo.wackO differs only in case from foo.Wacko. +case-collision.scala:15: warning: Generated class foo.wackO differs only in case from foo.Wacko. Such classes will overwrite one another on case-insensitive filesystems. object wackO ^ diff --git a/test/files/neg/case-collision.flags b/test/files/neg/case-collision.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/case-collision.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/case-collision.scala b/test/files/neg/case-collision.scala index bbfe469bf372..e640e88cf75c 100644 --- a/test/files/neg/case-collision.scala +++ b/test/files/neg/case-collision.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings package foo class Bippy @@ -11,4 +12,4 @@ case class Hyrax() object HyRaX class Wacko -object wackO \ No newline at end of file +object wackO diff --git a/test/files/neg/catch-all.check b/test/files/neg/catch-all.check index aaf51480c33a..e11915904074 100644 --- a/test/files/neg/catch-all.check +++ b/test/files/neg/catch-all.check @@ -1,10 +1,10 @@ -catch-all.scala:2: warning: This catches all Throwables. If this is really intended, use `case _ : Throwable` to clear this warning. +catch-all.scala:3: warning: This catches all Throwables. If this is really intended, use `case _ : Throwable` to clear this warning. try { "warn" } catch { case _ => } ^ -catch-all.scala:4: warning: This catches all Throwables. If this is really intended, use `case x : Throwable` to clear this warning. +catch-all.scala:5: warning: This catches all Throwables. If this is really intended, use `case x : Throwable` to clear this warning. try { "warn" } catch { case x => } ^ -catch-all.scala:6: warning: This catches all Throwables. If this is really intended, use `case x : Throwable` to clear this warning. +catch-all.scala:7: warning: This catches all Throwables. If this is really intended, use `case x : Throwable` to clear this warning. try { "warn" } catch { case _: RuntimeException => ; case x => } ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/catch-all.flags b/test/files/neg/catch-all.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/catch-all.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/catch-all.scala b/test/files/neg/catch-all.scala index c05be7704441..67d63d006297 100644 --- a/test/files/neg/catch-all.scala +++ b/test/files/neg/catch-all.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object CatchAll { try { "warn" } catch { case _ => } diff --git a/test/files/neg/check-dead.check b/test/files/neg/check-dead.check index 2150a942bf89..7d4fc0901948 100644 --- a/test/files/neg/check-dead.check +++ b/test/files/neg/check-dead.check @@ -1,13 +1,13 @@ -check-dead.scala:7: warning: dead code following this construct +check-dead.scala:8: warning: dead code following this construct def z1 = y1(throw new Exception) // should warn ^ -check-dead.scala:10: warning: dead code following this construct +check-dead.scala:11: warning: dead code following this construct def z2 = y2(throw new Exception) // should warn ^ -check-dead.scala:29: warning: dead code following this construct +check-dead.scala:30: warning: dead code following this construct throw new Exception // should warn ^ -check-dead.scala:33: warning: dead code following this construct +check-dead.scala:34: warning: dead code following this construct throw new Exception // should warn ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/check-dead.flags b/test/files/neg/check-dead.flags deleted file mode 100644 index c7d406c649e8..000000000000 --- a/test/files/neg/check-dead.flags +++ /dev/null @@ -1 +0,0 @@ --Ywarn-dead-code -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/check-dead.scala b/test/files/neg/check-dead.scala index 2d5bccb21d00..f0f1db1cdda6 100644 --- a/test/files/neg/check-dead.scala +++ b/test/files/neg/check-dead.scala @@ -1,3 +1,4 @@ +// scalac: -Ywarn-dead-code -Xfatal-warnings object Other { def oops(msg: String = "xxx"): Nothing = throw new Exception(msg) // should not warn } diff --git a/test/files/neg/checksensible.check b/test/files/neg/checksensible.check index 899ecffd14ab..49d1fd1ebd79 100644 --- a/test/files/neg/checksensible.check +++ b/test/files/neg/checksensible.check @@ -1,118 +1,118 @@ -checksensible.scala:45: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want. +checksensible.scala:46: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want. signature: Any.==(x$1: Any): Boolean given arguments: after adaptation: Any.==((): Unit) () == () ^ -checksensible.scala:48: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want. +checksensible.scala:49: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want. signature: Object.!=(x$1: Any): Boolean given arguments: after adaptation: Object.!=((): Unit) scala.runtime.BoxedUnit.UNIT != () ^ -checksensible.scala:49: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want. +checksensible.scala:50: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want. signature: Any.!=(x$1: Any): Boolean given arguments: after adaptation: Any.!=((): Unit) (scala.runtime.BoxedUnit.UNIT: java.io.Serializable) != () // shouldn't warn ^ -checksensible.scala:13: warning: comparing a fresh object using `eq' will always yield false +checksensible.scala:14: warning: comparing a fresh object using `eq' will always yield false (new AnyRef) eq (new AnyRef) ^ -checksensible.scala:14: warning: comparing a fresh object using `ne' will always yield true +checksensible.scala:15: warning: comparing a fresh object using `ne' will always yield true (new AnyRef) ne (new AnyRef) ^ -checksensible.scala:15: warning: comparing a fresh object using `eq' will always yield false +checksensible.scala:16: warning: comparing a fresh object using `eq' will always yield false Shmoopie eq (new AnyRef) ^ -checksensible.scala:16: warning: comparing a fresh object using `eq' will always yield false +checksensible.scala:17: warning: comparing a fresh object using `eq' will always yield false (Shmoopie: AnyRef) eq (new AnyRef) ^ -checksensible.scala:17: warning: comparing a fresh object using `eq' will always yield false +checksensible.scala:18: warning: comparing a fresh object using `eq' will always yield false (new AnyRef) eq Shmoopie ^ -checksensible.scala:18: warning: comparing a fresh object using `eq' will always yield false +checksensible.scala:19: warning: comparing a fresh object using `eq' will always yield false (new AnyRef) eq null ^ -checksensible.scala:19: warning: comparing a fresh object using `eq' will always yield false +checksensible.scala:20: warning: comparing a fresh object using `eq' will always yield false null eq new AnyRef ^ -checksensible.scala:26: warning: comparing values of types Unit and Int using `==' will always yield false +checksensible.scala:27: warning: comparing values of types Unit and Int using `==' will always yield false (c = 1) == 0 ^ -checksensible.scala:27: warning: comparing values of types Int and Unit using `==' will always yield false +checksensible.scala:28: warning: comparing values of types Int and Unit using `==' will always yield false 0 == (c = 1) ^ -checksensible.scala:29: warning: comparing values of types Int and String using `==' will always yield false +checksensible.scala:30: warning: comparing values of types Int and String using `==' will always yield false 1 == "abc" ^ -checksensible.scala:33: warning: comparing values of types Some[Int] and Int using `==' will always yield false +checksensible.scala:34: warning: comparing values of types Some[Int] and Int using `==' will always yield false Some(1) == 1 // as above ^ -checksensible.scala:38: warning: comparing a fresh object using `==' will always yield false +checksensible.scala:39: warning: comparing a fresh object using `==' will always yield false new AnyRef == 1 ^ -checksensible.scala:41: warning: comparing values of types Int and Boolean using `==' will always yield false +checksensible.scala:42: warning: comparing values of types Int and Boolean using `==' will always yield false 1 == (new java.lang.Boolean(true)) ^ -checksensible.scala:43: warning: comparing values of types Int and Boolean using `!=' will always yield true +checksensible.scala:44: warning: comparing values of types Int and Boolean using `!=' will always yield true 1 != true ^ -checksensible.scala:44: warning: comparing values of types Unit and Boolean using `==' will always yield false +checksensible.scala:45: warning: comparing values of types Unit and Boolean using `==' will always yield false () == true ^ -checksensible.scala:45: warning: comparing values of types Unit and Unit using `==' will always yield true +checksensible.scala:46: warning: comparing values of types Unit and Unit using `==' will always yield true () == () ^ -checksensible.scala:46: warning: comparing values of types Unit and Unit using `==' will always yield true +checksensible.scala:47: warning: comparing values of types Unit and Unit using `==' will always yield true () == println ^ -checksensible.scala:47: warning: comparing values of types Unit and scala.runtime.BoxedUnit using `==' will always yield true +checksensible.scala:48: warning: comparing values of types Unit and scala.runtime.BoxedUnit using `==' will always yield true () == scala.runtime.BoxedUnit.UNIT // these should warn for always being true/false ^ -checksensible.scala:48: warning: comparing values of types scala.runtime.BoxedUnit and Unit using `!=' will always yield false +checksensible.scala:49: warning: comparing values of types scala.runtime.BoxedUnit and Unit using `!=' will always yield false scala.runtime.BoxedUnit.UNIT != () ^ -checksensible.scala:51: warning: comparing values of types Int and Unit using `!=' will always yield true +checksensible.scala:52: warning: comparing values of types Int and Unit using `!=' will always yield true (1 != println) ^ -checksensible.scala:52: warning: comparing values of types Int and Symbol using `!=' will always yield true +checksensible.scala:53: warning: comparing values of types Int and Symbol using `!=' will always yield true (1 != 'sym) ^ -checksensible.scala:58: warning: comparing a fresh object using `==' will always yield false +checksensible.scala:59: warning: comparing a fresh object using `==' will always yield false ((x: Int) => x + 1) == null ^ -checksensible.scala:59: warning: comparing a fresh object using `==' will always yield false +checksensible.scala:60: warning: comparing a fresh object using `==' will always yield false Bep == ((_: Int) + 1) ^ -checksensible.scala:61: warning: comparing a fresh object using `==' will always yield false +checksensible.scala:62: warning: comparing a fresh object using `==' will always yield false new Object == new Object ^ -checksensible.scala:62: warning: comparing a fresh object using `==' will always yield false +checksensible.scala:63: warning: comparing a fresh object using `==' will always yield false new Object == "abc" ^ -checksensible.scala:63: warning: comparing a fresh object using `!=' will always yield true +checksensible.scala:64: warning: comparing a fresh object using `!=' will always yield true new Exception() != new Exception() ^ -checksensible.scala:66: warning: comparing values of types Int and Null using `==' will always yield false +checksensible.scala:67: warning: comparing values of types Int and Null using `==' will always yield false if (foo.length == null) "plante" else "plante pas" ^ -checksensible.scala:71: warning: comparing values of types Bip and Bop using `==' will always yield false +checksensible.scala:72: warning: comparing values of types Bip and Bop using `==' will always yield false (x1 == x2) ^ -checksensible.scala:81: warning: comparing values of types EqEqRefTest.this.C3 and EqEqRefTest.this.Z1 using `==' will always yield false +checksensible.scala:82: warning: comparing values of types EqEqRefTest.this.C3 and EqEqRefTest.this.Z1 using `==' will always yield false c3 == z1 ^ -checksensible.scala:82: warning: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `==' will always yield false +checksensible.scala:83: warning: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `==' will always yield false z1 == c3 ^ -checksensible.scala:83: warning: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `!=' will always yield true +checksensible.scala:84: warning: comparing values of types EqEqRefTest.this.Z1 and EqEqRefTest.this.C3 using `!=' will always yield true z1 != c3 ^ -checksensible.scala:84: warning: comparing values of types EqEqRefTest.this.C3 and String using `!=' will always yield true +checksensible.scala:85: warning: comparing values of types EqEqRefTest.this.C3 and String using `!=' will always yield true c3 != "abc" ^ -checksensible.scala:95: warning: comparing values of types Unit and Int using `!=' will always yield true +checksensible.scala:96: warning: comparing values of types Unit and Int using `!=' will always yield true while ((c = in.read) != -1) ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/checksensible.flags b/test/files/neg/checksensible.flags deleted file mode 100644 index 65faf53579c2..000000000000 --- a/test/files/neg/checksensible.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -deprecation \ No newline at end of file diff --git a/test/files/neg/checksensible.scala b/test/files/neg/checksensible.scala index b6083f75e4ab..e4d467130c7f 100644 --- a/test/files/neg/checksensible.scala +++ b/test/files/neg/checksensible.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -deprecation final class Bip { def <=(other: Bop) = true } final class Bop { } object Bep { } diff --git a/test/files/neg/choices.flags b/test/files/neg/choices.flags deleted file mode 100644 index 9718467d4ca2..000000000000 --- a/test/files/neg/choices.flags +++ /dev/null @@ -1 +0,0 @@ --Yresolve-term-conflict diff --git a/test/files/neg/choices.scala b/test/files/neg/choices.scala index 8827494874cb..976f695261e6 100644 --- a/test/files/neg/choices.scala +++ b/test/files/neg/choices.scala @@ -1,3 +1,4 @@ +// scalac: -Yresolve-term-conflict object Test { def main(args: Array[String]): Unit = { diff --git a/test/files/neg/classmanifests_new_deprecations.check b/test/files/neg/classmanifests_new_deprecations.check index ed6f42d00ceb..889826873445 100644 --- a/test/files/neg/classmanifests_new_deprecations.check +++ b/test/files/neg/classmanifests_new_deprecations.check @@ -1,25 +1,25 @@ -classmanifests_new_deprecations.scala:2: warning: type ClassManifest in object Predef is deprecated (since 2.10.0): use `scala.reflect.ClassTag` instead +classmanifests_new_deprecations.scala:3: warning: type ClassManifest in object Predef is deprecated (since 2.10.0): use `scala.reflect.ClassTag` instead def cm1[T: ClassManifest] = ??? ^ -classmanifests_new_deprecations.scala:3: warning: type ClassManifest in object Predef is deprecated (since 2.10.0): use `scala.reflect.ClassTag` instead +classmanifests_new_deprecations.scala:4: warning: type ClassManifest in object Predef is deprecated (since 2.10.0): use `scala.reflect.ClassTag` instead def cm2[T](implicit evidence$1: ClassManifest[T]) = ??? ^ -classmanifests_new_deprecations.scala:4: warning: type ClassManifest in object Predef is deprecated (since 2.10.0): use `scala.reflect.ClassTag` instead +classmanifests_new_deprecations.scala:5: warning: type ClassManifest in object Predef is deprecated (since 2.10.0): use `scala.reflect.ClassTag` instead val cm3: ClassManifest[Int] = null ^ -classmanifests_new_deprecations.scala:6: warning: type ClassManifest in package reflect is deprecated (since 2.10.0): use scala.reflect.ClassTag instead +classmanifests_new_deprecations.scala:7: warning: type ClassManifest in package reflect is deprecated (since 2.10.0): use scala.reflect.ClassTag instead def rcm1[T: scala.reflect.ClassManifest] = ??? ^ -classmanifests_new_deprecations.scala:7: warning: type ClassManifest in package reflect is deprecated (since 2.10.0): use scala.reflect.ClassTag instead +classmanifests_new_deprecations.scala:8: warning: type ClassManifest in package reflect is deprecated (since 2.10.0): use scala.reflect.ClassTag instead def rcm2[T](implicit evidence$1: scala.reflect.ClassManifest[T]) = ??? ^ -classmanifests_new_deprecations.scala:8: warning: type ClassManifest in package reflect is deprecated (since 2.10.0): use scala.reflect.ClassTag instead +classmanifests_new_deprecations.scala:9: warning: type ClassManifest in package reflect is deprecated (since 2.10.0): use scala.reflect.ClassTag instead val rcm3: scala.reflect.ClassManifest[Int] = null ^ -classmanifests_new_deprecations.scala:10: warning: type ClassManifest in object Predef is deprecated (since 2.10.0): use `scala.reflect.ClassTag` instead +classmanifests_new_deprecations.scala:11: warning: type ClassManifest in object Predef is deprecated (since 2.10.0): use `scala.reflect.ClassTag` instead type CM[T] = ClassManifest[T] ^ -classmanifests_new_deprecations.scala:15: warning: type ClassManifest in package reflect is deprecated (since 2.10.0): use scala.reflect.ClassTag instead +classmanifests_new_deprecations.scala:16: warning: type ClassManifest in package reflect is deprecated (since 2.10.0): use scala.reflect.ClassTag instead type RCM[T] = scala.reflect.ClassManifest[T] ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/classmanifests_new_deprecations.flags b/test/files/neg/classmanifests_new_deprecations.flags deleted file mode 100644 index c6bfaf1f64a4..000000000000 --- a/test/files/neg/classmanifests_new_deprecations.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings diff --git a/test/files/neg/classmanifests_new_deprecations.scala b/test/files/neg/classmanifests_new_deprecations.scala index 563a0bc19724..172df6887813 100644 --- a/test/files/neg/classmanifests_new_deprecations.scala +++ b/test/files/neg/classmanifests_new_deprecations.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings object Test extends App { def cm1[T: ClassManifest] = ??? def cm2[T](implicit evidence$1: ClassManifest[T]) = ??? @@ -34,4 +35,4 @@ object Test extends App { def arm1[T: RM] = ??? def arm2[T](implicit evidence$1: RM[T]) = ??? val arm3: RM[Int] = null -} \ No newline at end of file +} diff --git a/test/files/neg/constructor-init-order.check b/test/files/neg/constructor-init-order.check index 9ab6ac592313..7d2dbf735736 100644 --- a/test/files/neg/constructor-init-order.check +++ b/test/files/neg/constructor-init-order.check @@ -1,7 +1,7 @@ -constructor-init-order.scala:7: warning: Reference to uninitialized value baz +constructor-init-order.scala:8: warning: Reference to uninitialized value baz val bar1 = baz // warn ^ -constructor-init-order.scala:17: warning: Reference to uninitialized variable baz +constructor-init-order.scala:18: warning: Reference to uninitialized variable baz var bar1 = baz // warn ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/constructor-init-order.flags b/test/files/neg/constructor-init-order.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/constructor-init-order.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/constructor-init-order.scala b/test/files/neg/constructor-init-order.scala index fe8fec87adde..898189f2cec0 100644 --- a/test/files/neg/constructor-init-order.scala +++ b/test/files/neg/constructor-init-order.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings trait Foo0 { val quux1: String val quux2 = quux1 // warning here is "future work" diff --git a/test/files/neg/cycle-bounds.check b/test/files/neg/cycle-bounds.check index d924838aecaa..749fbcc9d820 100644 --- a/test/files/neg/cycle-bounds.check +++ b/test/files/neg/cycle-bounds.check @@ -1,4 +1,4 @@ -cycle-bounds.scala:5: error: illegal cyclic reference involving type T +cycle-bounds.scala:6: error: illegal cyclic reference involving type T class NotOk[T <: Comparable[_ <: T]] ^ one error found diff --git a/test/files/neg/cycle-bounds.flags b/test/files/neg/cycle-bounds.flags deleted file mode 100644 index ca20f55172e9..000000000000 --- a/test/files/neg/cycle-bounds.flags +++ /dev/null @@ -1 +0,0 @@ --Ybreak-cycles diff --git a/test/files/neg/cycle-bounds.scala b/test/files/neg/cycle-bounds.scala index 0b43bc703eac..bb495cfbfe70 100644 --- a/test/files/neg/cycle-bounds.scala +++ b/test/files/neg/cycle-bounds.scala @@ -1,3 +1,4 @@ +// scalac: -Ybreak-cycles // This should be allowed class Ok[T <: Comparable[_ >: T]] diff --git a/test/files/neg/delayed-init-ref.check b/test/files/neg/delayed-init-ref.check index 854427466998..8d93f2a92c22 100644 --- a/test/files/neg/delayed-init-ref.check +++ b/test/files/neg/delayed-init-ref.check @@ -1,13 +1,13 @@ -delayed-init-ref.scala:17: warning: Selecting value vall from object O, which extends scala.DelayedInit, is likely to yield an uninitialized value +delayed-init-ref.scala:18: warning: Selecting value vall from object O, which extends scala.DelayedInit, is likely to yield an uninitialized value println(O.vall) // warn ^ -delayed-init-ref.scala:19: warning: Selecting value vall from object O, which extends scala.DelayedInit, is likely to yield an uninitialized value +delayed-init-ref.scala:20: warning: Selecting value vall from object O, which extends scala.DelayedInit, is likely to yield an uninitialized value println(vall) // warn ^ -delayed-init-ref.scala:28: warning: trait DelayedInit in package scala is deprecated (since 2.11.0): DelayedInit semantics can be surprising. Support for `App` will continue. See the release notes for more details: https://github.com/scala/scala/releases/tag/v2.11.0 +delayed-init-ref.scala:29: warning: trait DelayedInit in package scala is deprecated (since 2.11.0): DelayedInit semantics can be surprising. Support for `App` will continue. See the release notes for more details: https://github.com/scala/scala/releases/tag/v2.11.0 trait Before extends DelayedInit { ^ -delayed-init-ref.scala:40: warning: Selecting value foo from trait UserContext, which extends scala.DelayedInit, is likely to yield an uninitialized value +delayed-init-ref.scala:41: warning: Selecting value foo from trait UserContext, which extends scala.DelayedInit, is likely to yield an uninitialized value println({locally(()); this}.foo) // warn (spurious, but we can't discriminate) ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/delayed-init-ref.flags b/test/files/neg/delayed-init-ref.flags deleted file mode 100644 index 88a3e4c676eb..000000000000 --- a/test/files/neg/delayed-init-ref.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xlint -Xfatal-warnings diff --git a/test/files/neg/delayed-init-ref.scala b/test/files/neg/delayed-init-ref.scala index f2aa804e28f9..b545ff097998 100644 --- a/test/files/neg/delayed-init-ref.scala +++ b/test/files/neg/delayed-init-ref.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xlint -Xfatal-warnings trait T { val traitVal = "" } diff --git a/test/files/neg/deprecated-target.flags b/test/files/neg/deprecated-target.flags deleted file mode 100644 index 458ded8123b5..000000000000 --- a/test/files/neg/deprecated-target.flags +++ /dev/null @@ -1 +0,0 @@ --target:jvm-1.7 -deprecation -Xfatal-warnings diff --git a/test/files/neg/deprecated-target.scala b/test/files/neg/deprecated-target.scala index 9dccdd5e5954..7ac29a4efe89 100644 --- a/test/files/neg/deprecated-target.scala +++ b/test/files/neg/deprecated-target.scala @@ -1 +1,2 @@ -class C \ No newline at end of file +// scalac: -target:jvm-1.7 -deprecation -Xfatal-warnings +class C diff --git a/test/files/neg/exhausting.check b/test/files/neg/exhausting.check index 619849693cb7..eaa8517764e6 100644 --- a/test/files/neg/exhausting.check +++ b/test/files/neg/exhausting.check @@ -1,24 +1,24 @@ -exhausting.scala:21: warning: match may not be exhaustive. +exhausting.scala:22: warning: match may not be exhaustive. It would fail on the following inputs: List(_), List(_, _, _) def fail1[T](xs: List[T]) = xs match { ^ -exhausting.scala:27: warning: match may not be exhaustive. +exhausting.scala:28: warning: match may not be exhaustive. It would fail on the following input: Nil def fail2[T](xs: List[T]) = xs match { ^ -exhausting.scala:32: warning: match may not be exhaustive. +exhausting.scala:33: warning: match may not be exhaustive. It would fail on the following input: List((x: Int forSome x not in (1, 2))) def fail3a(xs: List[Int]) = xs match { ^ -exhausting.scala:39: warning: match may not be exhaustive. +exhausting.scala:40: warning: match may not be exhaustive. It would fail on the following input: Bar3 def fail3[T](x: Foo[T]) = x match { ^ -exhausting.scala:47: warning: match may not be exhaustive. +exhausting.scala:48: warning: match may not be exhaustive. It would fail on the following inputs: (Bar1, Bar2), (Bar1, Bar3), (Bar2, Bar1), (Bar2, Bar2) def fail4[T <: AnyRef](xx: (Foo[T], Foo[T])) = xx match { ^ -exhausting.scala:56: warning: match may not be exhaustive. +exhausting.scala:57: warning: match may not be exhaustive. It would fail on the following inputs: (Bar1, Bar2), (Bar1, Bar3), (Bar2, Bar1), (Bar2, Bar2) def fail5[T](xx: (Foo[T], Foo[T])) = xx match { ^ diff --git a/test/files/neg/exhausting.flags b/test/files/neg/exhausting.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/exhausting.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/exhausting.scala b/test/files/neg/exhausting.scala index c00569c91d0b..7df5aa16aa6d 100644 --- a/test/files/neg/exhausting.scala +++ b/test/files/neg/exhausting.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { sealed abstract class Foo[T] case object Bar1 extends Foo[Int] diff --git a/test/files/neg/for-comprehension-old.check b/test/files/neg/for-comprehension-old.check index 1ecaf12af45c..b863c59538f1 100644 --- a/test/files/neg/for-comprehension-old.check +++ b/test/files/neg/for-comprehension-old.check @@ -1,25 +1,25 @@ -for-comprehension-old.scala:3: warning: val keyword in for comprehension is deprecated +for-comprehension-old.scala:4: warning: val keyword in for comprehension is deprecated for (x <- 1 to 5 ; val y = x) yield x+y // fail ^ -for-comprehension-old.scala:5: warning: val keyword in for comprehension is deprecated +for-comprehension-old.scala:6: warning: val keyword in for comprehension is deprecated for (val x <- 1 to 5 ; val y = x) yield x+y // fail ^ -for-comprehension-old.scala:8: warning: val keyword in for comprehension is deprecated +for-comprehension-old.scala:9: warning: val keyword in for comprehension is deprecated for (z <- 1 to 2 ; x <- 1 to 5 ; val y = x) yield x+y // fail ^ -for-comprehension-old.scala:10: warning: val keyword in for comprehension is deprecated +for-comprehension-old.scala:11: warning: val keyword in for comprehension is deprecated for (z <- 1 to 2 ; val x <- 1 to 5 ; val y = x) yield x+y // fail ^ -for-comprehension-old.scala:4: error: val in for comprehension must be followed by assignment +for-comprehension-old.scala:5: error: val in for comprehension must be followed by assignment for (val x <- 1 to 5 ; y = x) yield x+y // fail ^ -for-comprehension-old.scala:5: error: val in for comprehension must be followed by assignment +for-comprehension-old.scala:6: error: val in for comprehension must be followed by assignment for (val x <- 1 to 5 ; val y = x) yield x+y // fail ^ -for-comprehension-old.scala:9: error: val in for comprehension must be followed by assignment +for-comprehension-old.scala:10: error: val in for comprehension must be followed by assignment for (z <- 1 to 2 ; val x <- 1 to 5 ; y = x) yield x+y // fail ^ -for-comprehension-old.scala:10: error: val in for comprehension must be followed by assignment +for-comprehension-old.scala:11: error: val in for comprehension must be followed by assignment for (z <- 1 to 2 ; val x <- 1 to 5 ; val y = x) yield x+y // fail ^ four warnings found diff --git a/test/files/neg/for-comprehension-old.flags b/test/files/neg/for-comprehension-old.flags deleted file mode 100644 index dcc59ebe32ef..000000000000 --- a/test/files/neg/for-comprehension-old.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation diff --git a/test/files/neg/for-comprehension-old.scala b/test/files/neg/for-comprehension-old.scala index 10ae363bde7d..73bbb7acd25a 100644 --- a/test/files/neg/for-comprehension-old.scala +++ b/test/files/neg/for-comprehension-old.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation class A { for (x <- 1 to 5 ; y = x) yield x+y // ok for (x <- 1 to 5 ; val y = x) yield x+y // fail diff --git a/test/files/neg/forgot-interpolator.check b/test/files/neg/forgot-interpolator.check index 8e75350518ed..502447d91520 100644 --- a/test/files/neg/forgot-interpolator.check +++ b/test/files/neg/forgot-interpolator.check @@ -1,25 +1,25 @@ -forgot-interpolator.scala:4: warning: possible missing interpolator: detected interpolated identifier `$bippy` +forgot-interpolator.scala:5: warning: possible missing interpolator: detected interpolated identifier `$bippy` def f = "Put the $bippy in the $bippy!" // warn 1 ^ -forgot-interpolator.scala:14: warning: possible missing interpolator: detected an interpolated expression +forgot-interpolator.scala:15: warning: possible missing interpolator: detected an interpolated expression def f = """Put the ${println("bippy")} in the bippy!""" // warn 2 ^ -forgot-interpolator.scala:30: warning: possible missing interpolator: detected interpolated identifier `$beppo` +forgot-interpolator.scala:31: warning: possible missing interpolator: detected interpolated identifier `$beppo` def f = "$beppo was a marx bros who saw dollars." // warn 3 ^ -forgot-interpolator.scala:34: warning: possible missing interpolator: detected interpolated identifier `$aleppo` +forgot-interpolator.scala:35: warning: possible missing interpolator: detected interpolated identifier `$aleppo` def f = "$aleppo is a pepper and a city." // warn 4 ^ -forgot-interpolator.scala:47: warning: possible missing interpolator: detected interpolated identifier `$hippo` +forgot-interpolator.scala:48: warning: possible missing interpolator: detected interpolated identifier `$hippo` def h = "$hippo takes an implicit" // warn 6 ^ -forgot-interpolator.scala:88: warning: possible missing interpolator: detected interpolated identifier `$groucho` +forgot-interpolator.scala:89: warning: possible missing interpolator: detected interpolated identifier `$groucho` def f2 = "I salute $groucho" // warn 7 ^ -forgot-interpolator.scala:89: warning: possible missing interpolator: detected interpolated identifier `$dingo` +forgot-interpolator.scala:90: warning: possible missing interpolator: detected interpolated identifier `$dingo` def f3 = "I even salute $dingo" // warn 8 ^ -forgot-interpolator.scala:90: warning: possible missing interpolator: detected interpolated identifier `$calico` +forgot-interpolator.scala:91: warning: possible missing interpolator: detected interpolated identifier `$calico` def f4 = "I also salute $calico" // warn 9 ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/forgot-interpolator.flags b/test/files/neg/forgot-interpolator.flags deleted file mode 100644 index b0d7bc25cb56..000000000000 --- a/test/files/neg/forgot-interpolator.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint:missing-interpolator -Xfatal-warnings diff --git a/test/files/neg/forgot-interpolator.scala b/test/files/neg/forgot-interpolator.scala index ca1ac308211f..4cf99828acfa 100644 --- a/test/files/neg/forgot-interpolator.scala +++ b/test/files/neg/forgot-interpolator.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint:missing-interpolator -Xfatal-warnings class A { val bippy = 123 diff --git a/test/files/neg/gadts2-strict.check b/test/files/neg/gadts2-strict.check index 960b35ed2f83..173683b8b22d 100644 --- a/test/files/neg/gadts2-strict.check +++ b/test/files/neg/gadts2-strict.check @@ -1,4 +1,4 @@ -gadts2-strict.scala:14: error: type mismatch; +gadts2-strict.scala:15: error: type mismatch; found : Test.MyDouble required: a case NumTerm(n) => c.x = MyDouble(1.0) diff --git a/test/files/neg/gadts2-strict.flags b/test/files/neg/gadts2-strict.flags deleted file mode 100644 index 19243266d108..000000000000 --- a/test/files/neg/gadts2-strict.flags +++ /dev/null @@ -1 +0,0 @@ --Xstrict-inference \ No newline at end of file diff --git a/test/files/neg/gadts2-strict.scala b/test/files/neg/gadts2-strict.scala index 54978b77128b..aecd9d63c482 100644 --- a/test/files/neg/gadts2-strict.scala +++ b/test/files/neg/gadts2-strict.scala @@ -1,3 +1,4 @@ +// scalac: -Xstrict-inference // A copy of pos/gadts2, which must fail under -Xstrict-inference. object Test { diff --git a/test/files/neg/gadts2.check b/test/files/neg/gadts2.check index dc21f3f52c88..229944f70e6c 100644 --- a/test/files/neg/gadts2.check +++ b/test/files/neg/gadts2.check @@ -1,4 +1,4 @@ -gadts2.scala:7: error: type mismatch; +gadts2.scala:8: error: type mismatch; found : String("abc") required: B (s1: Super[Any]) match { case Sub(f) => f("abc") } diff --git a/test/files/neg/gadts2.flags b/test/files/neg/gadts2.flags deleted file mode 100644 index 19243266d108..000000000000 --- a/test/files/neg/gadts2.flags +++ /dev/null @@ -1 +0,0 @@ --Xstrict-inference \ No newline at end of file diff --git a/test/files/neg/gadts2.scala b/test/files/neg/gadts2.scala index 156944b8d9d2..77d334340b5e 100644 --- a/test/files/neg/gadts2.scala +++ b/test/files/neg/gadts2.scala @@ -1,3 +1,4 @@ +// scalac: -Xstrict-inference trait Super[+A] case class Sub[B](f: B => B) extends Super[B] diff --git a/test/files/neg/hk-typevar-unification.check b/test/files/neg/hk-typevar-unification.check index 96dfedda4eaf..7748dbee4bed 100644 --- a/test/files/neg/hk-typevar-unification.check +++ b/test/files/neg/hk-typevar-unification.check @@ -1,20 +1,20 @@ -hk-typevar-unification.scala:14: error: inferred kinds of the type arguments ([_ <: B]Foo[_]) do not conform to the expected kinds of the type parameters (type F). +hk-typevar-unification.scala:15: error: inferred kinds of the type arguments ([_ <: B]Foo[_]) do not conform to the expected kinds of the type parameters (type F). [_ <: B]Foo[_]'s type parameters do not match type F's expected parameters: type _ (in class Foo)'s bounds <: B are stricter than type _'s declared bounds >: Nothing <: Any f(tcFoo) ^ -hk-typevar-unification.scala:14: error: type mismatch; +hk-typevar-unification.scala:15: error: type mismatch; found : TC[Foo] required: TC[F] f(tcFoo) ^ -hk-typevar-unification.scala:17: error: inferred kinds of the type arguments ([_ <: B]Foo[_]) do not conform to the expected kinds of the type parameters (type F). +hk-typevar-unification.scala:18: error: inferred kinds of the type arguments ([_ <: B]Foo[_]) do not conform to the expected kinds of the type parameters (type F). [_ <: B]Foo[_]'s type parameters do not match type F's expected parameters: type _ (in class Foo) is invariant, but type _ is declared covariant type _ (in class Foo)'s bounds <: B are stricter than type _'s declared bounds >: Nothing <: Any g(tcFoo) ^ -hk-typevar-unification.scala:17: error: type mismatch; +hk-typevar-unification.scala:18: error: type mismatch; found : TC[Foo] required: TC[F] g(tcFoo) diff --git a/test/files/neg/hk-typevar-unification.flags b/test/files/neg/hk-typevar-unification.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/neg/hk-typevar-unification.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/neg/hk-typevar-unification.scala b/test/files/neg/hk-typevar-unification.scala index abc22db48924..f79329395424 100644 --- a/test/files/neg/hk-typevar-unification.scala +++ b/test/files/neg/hk-typevar-unification.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 class A class B trait TC[F[_ <: A]] diff --git a/test/files/neg/implicit-ambiguous-invalid.check b/test/files/neg/implicit-ambiguous-invalid.check index 68b607c4c28d..c3b8cb84329c 100644 --- a/test/files/neg/implicit-ambiguous-invalid.check +++ b/test/files/neg/implicit-ambiguous-invalid.check @@ -1,4 +1,4 @@ -implicit-ambiguous-invalid.scala:5: warning: Invalid implicitAmbiguous message for method neqAmbig1 in object Test: +implicit-ambiguous-invalid.scala:6: warning: Invalid implicitAmbiguous message for method neqAmbig1 in object Test: The type parameter B referenced in the message of the @implicitAmbiguous annotation is not defined by method neqAmbig1. implicit def neqAmbig1[A] : A =!= A = null ^ diff --git a/test/files/neg/implicit-ambiguous-invalid.flags b/test/files/neg/implicit-ambiguous-invalid.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/implicit-ambiguous-invalid.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/implicit-ambiguous-invalid.scala b/test/files/neg/implicit-ambiguous-invalid.scala index f8f9da655f4f..08feb3539720 100644 --- a/test/files/neg/implicit-ambiguous-invalid.scala +++ b/test/files/neg/implicit-ambiguous-invalid.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { trait =!=[C, D] diff --git a/test/files/neg/implicit-shadow.check b/test/files/neg/implicit-shadow.check index 042fca867a03..3e801cac807c 100644 --- a/test/files/neg/implicit-shadow.check +++ b/test/files/neg/implicit-shadow.check @@ -1,11 +1,11 @@ -implicit-shadow.scala:4: is not a valid implicit value for Int(1) => ?{def isEmpty: ?} because: +implicit-shadow.scala:5: is not a valid implicit value for Int(1) => ?{def isEmpty: ?} because: reference to i2s is ambiguous; it is imported twice in the same scope by import C._ and import B._ 1.isEmpty ^ -implicit-shadow.scala:4: error: value isEmpty is not a member of Int +implicit-shadow.scala:5: error: value isEmpty is not a member of Int 1.isEmpty ^ one error found diff --git a/test/files/neg/implicit-shadow.flags b/test/files/neg/implicit-shadow.flags deleted file mode 100644 index 44842a9d65c6..000000000000 --- a/test/files/neg/implicit-shadow.flags +++ /dev/null @@ -1 +0,0 @@ --Xlog-implicits diff --git a/test/files/neg/implicit-shadow.scala b/test/files/neg/implicit-shadow.scala index ffd34b640837..cab23c8b4a7a 100644 --- a/test/files/neg/implicit-shadow.scala +++ b/test/files/neg/implicit-shadow.scala @@ -1,3 +1,4 @@ +// scalac: -Xlog-implicits object Test { import B._, C._ @@ -10,4 +11,4 @@ trait A { object B extends A -object C extends A \ No newline at end of file +object C extends A diff --git a/test/files/neg/implicitly-self.check b/test/files/neg/implicitly-self.check index d9b411ab67c2..a7f4a56fbc24 100644 --- a/test/files/neg/implicitly-self.check +++ b/test/files/neg/implicitly-self.check @@ -1,13 +1,13 @@ -implicitly-self.scala:5: warning: Implicit resolves to enclosing method c +implicitly-self.scala:6: warning: Implicit resolves to enclosing method c implicit def c: Char = implicitly[Char] ^ -implicitly-self.scala:6: warning: Implicit resolves to enclosing value s +implicitly-self.scala:7: warning: Implicit resolves to enclosing value s implicit val s: String = implicitly[String] ^ -implicitly-self.scala:8: warning: Implicit resolves to enclosing value t +implicitly-self.scala:9: warning: Implicit resolves to enclosing value t def f = implicitly[Int] ^ -implicitly-self.scala:11: warning: Implicit resolves to enclosing object tcString +implicitly-self.scala:12: warning: Implicit resolves to enclosing object tcString implicit object tcString extends TC[String] { def ix = implicitly[TC[String]].ix + 1 } ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/implicitly-self.flags b/test/files/neg/implicitly-self.flags deleted file mode 100644 index 3561bb51ccd2..000000000000 --- a/test/files/neg/implicitly-self.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Ywarn-self-implicit diff --git a/test/files/neg/implicitly-self.scala b/test/files/neg/implicitly-self.scala index 8293b521e59b..0fa2d64b2f05 100644 --- a/test/files/neg/implicitly-self.scala +++ b/test/files/neg/implicitly-self.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ywarn-self-implicit trait TC[T] { def ix: Int } diff --git a/test/files/neg/inlineIndyLambdaPrivate.check b/test/files/neg/inlineIndyLambdaPrivate.check index dbd142f59e33..0b82ca7f19b9 100644 --- a/test/files/neg/inlineIndyLambdaPrivate.check +++ b/test/files/neg/inlineIndyLambdaPrivate.check @@ -1,4 +1,4 @@ -Test_2.scala:2: warning: A_1::test()Ljava/lang/String; could not be inlined: +Test_2.scala:3: warning: A_1::test()Ljava/lang/String; could not be inlined: The callee A_1::test()Ljava/lang/String; contains the instruction INVOKEDYNAMIC m()LA_1$Fun; [ // handle kind 0x6 : INVOKESTATIC java/lang/invoke/LambdaMetafactory.metafactory(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; diff --git a/test/files/neg/inlineIndyLambdaPrivate.flags b/test/files/neg/inlineIndyLambdaPrivate.flags deleted file mode 100644 index ef6616151cc9..000000000000 --- a/test/files/neg/inlineIndyLambdaPrivate.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** -Yopt-inline-heuristics:everything -opt-warnings:_ -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/inlineIndyLambdaPrivate/Test_2.scala b/test/files/neg/inlineIndyLambdaPrivate/Test_2.scala index dd59c05176cb..8200ff5241cc 100644 --- a/test/files/neg/inlineIndyLambdaPrivate/Test_2.scala +++ b/test/files/neg/inlineIndyLambdaPrivate/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** -Yopt-inline-heuristics:everything -opt-warnings:_ -Xfatal-warnings class Test { def foo = A_1.test } diff --git a/test/files/neg/inlineMaxSize.check b/test/files/neg/inlineMaxSize.check index 9d790e154caf..b66b845bfbb6 100644 --- a/test/files/neg/inlineMaxSize.check +++ b/test/files/neg/inlineMaxSize.check @@ -1,4 +1,4 @@ -inlineMaxSize.scala:7: warning: C::i()I is annotated @inline but could not be inlined: +inlineMaxSize.scala:8: warning: C::i()I is annotated @inline but could not be inlined: The size of the callsite method C::j()I would exceed the JVM method size limit after inlining C::i()I. diff --git a/test/files/neg/inlineMaxSize.flags b/test/files/neg/inlineMaxSize.flags deleted file mode 100644 index 7e1efbda7fb3..000000000000 --- a/test/files/neg/inlineMaxSize.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method -opt:l:inline -opt-inline-from:** -opt-warnings -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/inlineMaxSize.scala b/test/files/neg/inlineMaxSize.scala index 9d2db1a35783..70192efd70bd 100644 --- a/test/files/neg/inlineMaxSize.scala +++ b/test/files/neg/inlineMaxSize.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method -opt:l:inline -opt-inline-from:** -opt-warnings -Xfatal-warnings // not a JUnit test because of https://github.com/scala-opt/scala/issues/23 class C { @inline final def f = 0 diff --git a/test/files/neg/java-import-non-existing-selector.flags b/test/files/neg/java-import-non-existing-selector.flags deleted file mode 100644 index 8c8cf255b979..000000000000 --- a/test/files/neg/java-import-non-existing-selector.flags +++ /dev/null @@ -1 +0,0 @@ --Ypickle-java diff --git a/test/files/neg/logImplicits.check b/test/files/neg/logImplicits.check index 2627ce99e5f5..02f21dbb47dc 100644 --- a/test/files/neg/logImplicits.check +++ b/test/files/neg/logImplicits.check @@ -1,19 +1,19 @@ -logImplicits.scala:2: applied implicit conversion from xs.type to ?{def size: ?} = implicit def byteArrayOps(xs: Array[Byte]): scala.collection.mutable.ArrayOps.ofByte +logImplicits.scala:3: applied implicit conversion from xs.type to ?{def size: ?} = implicit def byteArrayOps(xs: Array[Byte]): scala.collection.mutable.ArrayOps.ofByte def f(xs: Array[Byte]) = xs.size ^ -logImplicits.scala:7: applied implicit conversion from String("abc") to ?{def map: ?} = implicit def augmentString(x: String): scala.collection.immutable.StringOps +logImplicits.scala:8: applied implicit conversion from String("abc") to ?{def map: ?} = implicit def augmentString(x: String): scala.collection.immutable.StringOps def f = "abc" map (_ + 1) ^ -logImplicits.scala:15: inferred view from String("abc") to Int via C.this.convert: (p: String)Int +logImplicits.scala:16: inferred view from String("abc") to Int via C.this.convert: (p: String)Int math.max(122, x: Int) ^ -logImplicits.scala:19: applied implicit conversion from Int(1) to ?{def -> : ?} = implicit def ArrowAssoc[A](self: A): ArrowAssoc[A] +logImplicits.scala:20: applied implicit conversion from Int(1) to ?{def -> : ?} = implicit def ArrowAssoc[A](self: A): ArrowAssoc[A] def f = (1 -> 2) + "c" ^ -logImplicits.scala:19: applied implicit conversion from (Int, Int) to ?{def + : ?} = implicit def any2stringadd[A](self: A): any2stringadd[A] +logImplicits.scala:20: applied implicit conversion from (Int, Int) to ?{def + : ?} = implicit def any2stringadd[A](self: A): any2stringadd[A] def f = (1 -> 2) + "c" ^ -logImplicits.scala:22: error: class Un needs to be abstract, since method unimplemented is not defined +logImplicits.scala:23: error: class Un needs to be abstract, since method unimplemented is not defined class Un { ^ one error found diff --git a/test/files/neg/logImplicits.flags b/test/files/neg/logImplicits.flags deleted file mode 100644 index 97e5ae94efe4..000000000000 --- a/test/files/neg/logImplicits.flags +++ /dev/null @@ -1 +0,0 @@ --Xlog-implicit-conversions \ No newline at end of file diff --git a/test/files/neg/logImplicits.scala b/test/files/neg/logImplicits.scala index caf827163c4e..d548128affc6 100644 --- a/test/files/neg/logImplicits.scala +++ b/test/files/neg/logImplicits.scala @@ -1,3 +1,4 @@ +// scalac: -Xlog-implicit-conversions class A { def f(xs: Array[Byte]) = xs.size def g(xs: Array[Byte]) = xs.length @@ -22,4 +23,4 @@ class D { class Un { // forcing post-typer failure, since we're only interested in the output from the above def unimplemented: Int -} \ No newline at end of file +} diff --git a/test/files/neg/macro-basic-mamdmi.check b/test/files/neg/macro-basic-mamdmi.check index 54743d4936da..d7d722586114 100644 --- a/test/files/neg/macro-basic-mamdmi.check +++ b/test/files/neg/macro-basic-mamdmi.check @@ -1,12 +1,12 @@ -Impls_Macros_Test_1.scala:33: error: macro implementation not found: foo +Impls_Macros_Test_1.scala:34: error: macro implementation not found: foo (the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them) println(foo(2) + Macros.bar(2) * new Macros().quux(4)) ^ -Impls_Macros_Test_1.scala:33: error: macro implementation not found: bar +Impls_Macros_Test_1.scala:34: error: macro implementation not found: bar (the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them) println(foo(2) + Macros.bar(2) * new Macros().quux(4)) ^ -Impls_Macros_Test_1.scala:33: error: macro implementation not found: quux +Impls_Macros_Test_1.scala:34: error: macro implementation not found: quux (the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them) println(foo(2) + Macros.bar(2) * new Macros().quux(4)) ^ diff --git a/test/files/neg/macro-basic-mamdmi.flags b/test/files/neg/macro-basic-mamdmi.flags deleted file mode 100644 index 5e5dd6ce794e..000000000000 --- a/test/files/neg/macro-basic-mamdmi.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros diff --git a/test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala b/test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala index 325bb7276f2d..982c12f11efd 100644 --- a/test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala +++ b/test/files/neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -31,4 +32,4 @@ class Macros { object Test extends App { import Macros.Shmacros._ println(foo(2) + Macros.bar(2) * new Macros().quux(4)) -} \ No newline at end of file +} diff --git a/test/files/neg/macro-blackbox-fundep-materialization.check b/test/files/neg/macro-blackbox-fundep-materialization.check index 3c03064a2ddc..b9185dc8315a 100644 --- a/test/files/neg/macro-blackbox-fundep-materialization.check +++ b/test/files/neg/macro-blackbox-fundep-materialization.check @@ -1,4 +1,4 @@ -Test_2.scala:7: error: type mismatch; +Test_2.scala:8: error: type mismatch; found : Iso[Test.Foo,(Int, String, Boolean)] required: Iso[Test.Foo,Nothing] Note: (Int, String, Boolean) >: Nothing, but trait Iso is invariant in type U. diff --git a/test/files/neg/macro-blackbox-fundep-materialization.flags b/test/files/neg/macro-blackbox-fundep-materialization.flags deleted file mode 100644 index 4c6cdb71e2fa..000000000000 --- a/test/files/neg/macro-blackbox-fundep-materialization.flags +++ /dev/null @@ -1 +0,0 @@ --Xlog-implicits \ No newline at end of file diff --git a/test/files/neg/macro-blackbox-fundep-materialization/Macros_1.scala b/test/files/neg/macro-blackbox-fundep-materialization/Macros_1.scala index 8d776388ee8a..f74898dcac93 100644 --- a/test/files/neg/macro-blackbox-fundep-materialization/Macros_1.scala +++ b/test/files/neg/macro-blackbox-fundep-materialization/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xlog-implicits import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context diff --git a/test/files/neg/macro-blackbox-fundep-materialization/Test_2.scala b/test/files/neg/macro-blackbox-fundep-materialization/Test_2.scala index 40ca1d549c5b..ccf51ca5e9ae 100644 --- a/test/files/neg/macro-blackbox-fundep-materialization/Test_2.scala +++ b/test/files/neg/macro-blackbox-fundep-materialization/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xlog-implicits // see the comments for macroExpand.onDelayed for an explanation of what's tested here object Test extends App { case class Foo(i: Int, s: String, b: Boolean) @@ -9,4 +10,4 @@ object Test extends App { typed[(Int, String, Boolean)](equiv) println(equiv) } -} \ No newline at end of file +} diff --git a/test/files/neg/macro-cyclic.check b/test/files/neg/macro-cyclic.check index 7978ec64a56d..7bc116a2988c 100644 --- a/test/files/neg/macro-cyclic.check +++ b/test/files/neg/macro-cyclic.check @@ -1,4 +1,4 @@ -Impls_Macros_1.scala:5: error: could not find implicit value for parameter e: SourceLocation +Impls_Macros_1.scala:6: error: could not find implicit value for parameter e: SourceLocation c.universe.reify { implicitly[SourceLocation] } ^ one error found diff --git a/test/files/neg/macro-cyclic.flags b/test/files/neg/macro-cyclic.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-cyclic.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-cyclic/Impls_Macros_1.scala b/test/files/neg/macro-cyclic/Impls_Macros_1.scala index ad6890144d5a..0710b42e6c10 100644 --- a/test/files/neg/macro-cyclic/Impls_Macros_1.scala +++ b/test/files/neg/macro-cyclic/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { diff --git a/test/files/neg/macro-deprecate-idents.check b/test/files/neg/macro-deprecate-idents.check index 795b90e9b46e..3bad77913ee0 100644 --- a/test/files/neg/macro-deprecate-idents.check +++ b/test/files/neg/macro-deprecate-idents.check @@ -1,67 +1,67 @@ -macro-deprecate-idents.scala:2: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:3: error: macro is now a reserved word; usage as an identifier is disallowed val macro = ??? ^ -macro-deprecate-idents.scala:6: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:7: error: macro is now a reserved word; usage as an identifier is disallowed var macro = ??? ^ -macro-deprecate-idents.scala:10: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:11: error: macro is now a reserved word; usage as an identifier is disallowed type macro = Int ^ -macro-deprecate-idents.scala:14: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:15: error: macro is now a reserved word; usage as an identifier is disallowed class macro ^ -macro-deprecate-idents.scala:18: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:19: error: macro is now a reserved word; usage as an identifier is disallowed class macro ^ -macro-deprecate-idents.scala:22: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:23: error: macro is now a reserved word; usage as an identifier is disallowed object macro ^ -macro-deprecate-idents.scala:26: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:27: error: macro is now a reserved word; usage as an identifier is disallowed object macro ^ -macro-deprecate-idents.scala:30: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:31: error: macro is now a reserved word; usage as an identifier is disallowed trait macro ^ -macro-deprecate-idents.scala:34: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:35: error: macro is now a reserved word; usage as an identifier is disallowed trait macro ^ -macro-deprecate-idents.scala:37: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:38: error: macro is now a reserved word; usage as an identifier is disallowed package macro { ^ -macro-deprecate-idents.scala:38: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:39: error: macro is now a reserved word; usage as an identifier is disallowed package macro.bar { ^ -macro-deprecate-idents.scala:43: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:44: error: macro is now a reserved word; usage as an identifier is disallowed package macro.foo { ^ -macro-deprecate-idents.scala:48: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:49: error: macro is now a reserved word; usage as an identifier is disallowed val Some(macro) = Some(42) ^ -macro-deprecate-idents.scala:49: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:50: error: macro is now a reserved word; usage as an identifier is disallowed macro match { ^ -macro-deprecate-idents.scala:50: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:51: error: macro is now a reserved word; usage as an identifier is disallowed case macro => println(macro) ^ -macro-deprecate-idents.scala:50: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:51: error: macro is now a reserved word; usage as an identifier is disallowed case macro => println(macro) ^ -macro-deprecate-idents.scala:55: error: macro is now a reserved word; usage as an identifier is disallowed +macro-deprecate-idents.scala:56: error: macro is now a reserved word; usage as an identifier is disallowed def macro = 2 ^ -macro-deprecate-idents.scala:3: error: '=' expected but '}' found. +macro-deprecate-idents.scala:4: error: '=' expected but '}' found. } ^ -macro-deprecate-idents.scala:7: error: '=' expected but '}' found. +macro-deprecate-idents.scala:8: error: '=' expected but '}' found. } ^ -macro-deprecate-idents.scala:42: error: '{' expected. +macro-deprecate-idents.scala:43: error: '{' expected. package foo { ^ -macro-deprecate-idents.scala:45: error: '{' expected but '}' found. +macro-deprecate-idents.scala:46: error: '{' expected but '}' found. } ^ -macro-deprecate-idents.scala:52: error: ')' expected but '}' found. +macro-deprecate-idents.scala:53: error: ')' expected but '}' found. } ^ 22 errors found diff --git a/test/files/neg/macro-deprecate-idents.flags b/test/files/neg/macro-deprecate-idents.flags deleted file mode 100644 index c6bfaf1f64a4..000000000000 --- a/test/files/neg/macro-deprecate-idents.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings diff --git a/test/files/neg/macro-deprecate-idents.scala b/test/files/neg/macro-deprecate-idents.scala index 23c398e34168..ef08878e3e34 100644 --- a/test/files/neg/macro-deprecate-idents.scala +++ b/test/files/neg/macro-deprecate-idents.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings object Test1 { val macro = ??? } @@ -53,4 +54,4 @@ object Test12 { object Test13 { def macro = 2 -} \ No newline at end of file +} diff --git a/test/files/neg/macro-false-deprecation-warning.check b/test/files/neg/macro-false-deprecation-warning.check index 7d56505ec440..fe3d98982197 100644 --- a/test/files/neg/macro-false-deprecation-warning.check +++ b/test/files/neg/macro-false-deprecation-warning.check @@ -1,4 +1,4 @@ -Impls_Macros_1.scala:5: error: illegal start of simple expression +Impls_Macros_1.scala:6: error: illegal start of simple expression } ^ one error found diff --git a/test/files/neg/macro-false-deprecation-warning.flags b/test/files/neg/macro-false-deprecation-warning.flags deleted file mode 100644 index 59af162db6fb..000000000000 --- a/test/files/neg/macro-false-deprecation-warning.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros -deprecation \ No newline at end of file diff --git a/test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala b/test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala index a97dfd4ddf11..7639cbfa95ed 100644 --- a/test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala +++ b/test/files/neg/macro-false-deprecation-warning/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros -deprecation import scala.reflect.macros.blackbox.Context object Helper { diff --git a/test/files/neg/macro-incompatible-macro-engine-a/Macros_2.flags b/test/files/neg/macro-incompatible-macro-engine-a/Macros_2.flags deleted file mode 100644 index 966df731d030..000000000000 --- a/test/files/neg/macro-incompatible-macro-engine-a/Macros_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. \ No newline at end of file diff --git a/test/files/neg/macro-incompatible-macro-engine-a/Macros_2.scala b/test/files/neg/macro-incompatible-macro-engine-a/Macros_2.scala index 39708eee49c1..5b24ff5c7b11 100644 --- a/test/files/neg/macro-incompatible-macro-engine-a/Macros_2.scala +++ b/test/files/neg/macro-incompatible-macro-engine-a/Macros_2.scala @@ -1,7 +1,8 @@ +// scalac: -Xplugin:. import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context object Macros { def impl(c: Context) = c.universe.Literal(c.universe.Constant(())) def foo: Unit = macro impl -} \ No newline at end of file +} diff --git a/test/files/neg/macro-incompatible-macro-engine-b.check b/test/files/neg/macro-incompatible-macro-engine-b.check index 2a7510cf865d..be2e0afcf5a4 100644 --- a/test/files/neg/macro-incompatible-macro-engine-b.check +++ b/test/files/neg/macro-incompatible-macro-engine-b.check @@ -1,7 +1,7 @@ -Test_3.scala:2: error: macro cannot be expanded, because it was compiled by an incompatible macro engine (internal diagnostic: expected = v7.0 (implemented in Scala 2.11.0-M8), actual = vxxx (implemented in the incompatibleMacroEngine plugin)) +Test_3.scala:3: error: macro cannot be expanded, because it was compiled by an incompatible macro engine (internal diagnostic: expected = v7.0 (implemented in Scala 2.11.0-M8), actual = vxxx (implemented in the incompatibleMacroEngine plugin)) Macros.foo ^ -Test_3.scala:3: error: macro cannot be expanded, because it was compiled by an incompatible macro engine (internal diagnostic: expected = v7.0 (implemented in Scala 2.11.0-M8), actual = vxxx (implemented in the incompatibleMacroEngine plugin)) +Test_3.scala:4: error: macro cannot be expanded, because it was compiled by an incompatible macro engine (internal diagnostic: expected = v7.0 (implemented in Scala 2.11.0-M8), actual = vxxx (implemented in the incompatibleMacroEngine plugin)) Macros.foo ^ two errors found diff --git a/test/files/neg/macro-incompatible-macro-engine-b.flags b/test/files/neg/macro-incompatible-macro-engine-b.flags deleted file mode 100644 index 037a693bbd81..000000000000 --- a/test/files/neg/macro-incompatible-macro-engine-b.flags +++ /dev/null @@ -1 +0,0 @@ --Ymacro-debug-lite \ No newline at end of file diff --git a/test/files/neg/macro-incompatible-macro-engine-b/Macros_2.flags b/test/files/neg/macro-incompatible-macro-engine-b/Macros_2.flags deleted file mode 100644 index 966df731d030..000000000000 --- a/test/files/neg/macro-incompatible-macro-engine-b/Macros_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. \ No newline at end of file diff --git a/test/files/neg/macro-incompatible-macro-engine-b/Macros_2.scala b/test/files/neg/macro-incompatible-macro-engine-b/Macros_2.scala index 39708eee49c1..5b24ff5c7b11 100644 --- a/test/files/neg/macro-incompatible-macro-engine-b/Macros_2.scala +++ b/test/files/neg/macro-incompatible-macro-engine-b/Macros_2.scala @@ -1,7 +1,8 @@ +// scalac: -Xplugin:. import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context object Macros { def impl(c: Context) = c.universe.Literal(c.universe.Constant(())) def foo: Unit = macro impl -} \ No newline at end of file +} diff --git a/test/files/neg/macro-incompatible-macro-engine-b/Plugin_1.scala b/test/files/neg/macro-incompatible-macro-engine-b/Plugin_1.scala index 44ed91d2fb3b..8e727dae6989 100644 --- a/test/files/neg/macro-incompatible-macro-engine-b/Plugin_1.scala +++ b/test/files/neg/macro-incompatible-macro-engine-b/Plugin_1.scala @@ -32,4 +32,4 @@ class Plugin(val global: Global) extends NscPlugin { Some(result) } } -} \ No newline at end of file +} diff --git a/test/files/neg/macro-incompatible-macro-engine-b/Test_3.scala b/test/files/neg/macro-incompatible-macro-engine-b/Test_3.scala index 7e4fae52364e..5c327a4620c0 100644 --- a/test/files/neg/macro-incompatible-macro-engine-b/Test_3.scala +++ b/test/files/neg/macro-incompatible-macro-engine-b/Test_3.scala @@ -1,4 +1,5 @@ +// scalac: -Ymacro-debug-lite object Test extends App { Macros.foo Macros.foo -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidimpl.check b/test/files/neg/macro-invalidimpl.check index ea7d71c667dc..f3d35b3496fa 100644 --- a/test/files/neg/macro-invalidimpl.check +++ b/test/files/neg/macro-invalidimpl.check @@ -1,53 +1,53 @@ -Macros_Test_2.scala:5: error: macro implementation reference has wrong shape. required: +Macros_Test_2.scala:6: error: macro implementation reference has wrong shape. required: macro [].[[]] or macro [].[[]] def foo(x: Any) = macro impls.foo ^ -Macros_Test_2.scala:10: error: macro implementation reference has wrong shape. required: +Macros_Test_2.scala:11: error: macro implementation reference has wrong shape. required: macro [].[[]] or macro [].[[]] def foo(x: Any) = macro impls.foo ^ -Macros_Test_2.scala:18: error: macro implementation reference has wrong shape. required: +Macros_Test_2.scala:19: error: macro implementation reference has wrong shape. required: macro [].[[]] or macro [].[[]] def foo(x: Any) = macro Impls3.foo ^ -Macros_Test_2.scala:22: error: macro implementation reference has wrong shape. required: +Macros_Test_2.scala:23: error: macro implementation reference has wrong shape. required: macro [].[[]] or macro [].[[]] def foo(x: Any) = macro Impls4.foo ^ -Macros_Test_2.scala:26: error: ambiguous reference to overloaded definition, +Macros_Test_2.scala:27: error: ambiguous reference to overloaded definition, both method foo in object Impls5 of type (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Any], y: c.Expr[Any])Nothing and method foo in object Impls5 of type (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Any])Nothing match expected type ? def foo(x: Any) = macro Impls5.foo ^ -Macros_Test_2.scala:27: error: ambiguous reference to overloaded definition, +Macros_Test_2.scala:28: error: ambiguous reference to overloaded definition, both method foo in object Impls5 of type (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Any], y: c.Expr[Any])Nothing and method foo in object Impls5 of type (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Any])Nothing match expected type ? def foo(x: Any, y: Any) = macro Impls5.foo ^ -Macros_Test_2.scala:31: error: macro implementation has incompatible shape: +Macros_Test_2.scala:32: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Unit] or : (c: scala.reflect.macros.blackbox.Context): c.Tree found : (c: scala.reflect.macros.blackbox.Context)(): c.Expr[Unit] number of parameter sections differ def foo1 = macro Impls6.fooEmpty ^ -Macros_Test_2.scala:32: error: macro implementation has incompatible shape: +Macros_Test_2.scala:33: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context)(): c.Expr[Unit] or : (c: scala.reflect.macros.blackbox.Context)(): c.Tree found : (c: scala.reflect.macros.blackbox.Context): c.Expr[Unit] number of parameter sections differ def bar1() = macro Impls6.fooNullary ^ -Macros_Test_2.scala:36: error: type arguments [String] do not conform to method foo's type parameter bounds [U <: Int] +Macros_Test_2.scala:37: error: type arguments [String] do not conform to method foo's type parameter bounds [U <: Int] def foo = macro Impls7.foo[String] ^ -Macros_Test_2.scala:53: error: macro implementation must be public +Macros_Test_2.scala:54: error: macro implementation must be public def foo = macro Impls8.impl ^ 10 errors found diff --git a/test/files/neg/macro-invalidimpl.flags b/test/files/neg/macro-invalidimpl.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-invalidimpl.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-invalidimpl/Impls_1.scala b/test/files/neg/macro-invalidimpl/Impls_1.scala index a1c885a4bff2..01f658648550 100644 --- a/test/files/neg/macro-invalidimpl/Impls_1.scala +++ b/test/files/neg/macro-invalidimpl/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context class Impls1 { @@ -36,4 +37,4 @@ package foo { object Impls8 { private[foo] def impl(c: Context) = ??? } -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidimpl/Macros_Test_2.scala b/test/files/neg/macro-invalidimpl/Macros_Test_2.scala index 6760d9995956..1da5b415b1c5 100644 --- a/test/files/neg/macro-invalidimpl/Macros_Test_2.scala +++ b/test/files/neg/macro-invalidimpl/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros1 { @@ -52,4 +53,4 @@ package foo { object Test extends App { def foo = macro Impls8.impl } -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidret.check b/test/files/neg/macro-invalidret.check index a80329476f97..ca95604f3778 100644 --- a/test/files/neg/macro-invalidret.check +++ b/test/files/neg/macro-invalidret.check @@ -1,30 +1,30 @@ -Macros_Test_2.scala:2: error: macro implementation has incompatible shape: +Macros_Test_2.scala:3: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Any] or : (c: scala.reflect.macros.blackbox.Context): c.Tree found : (c: scala.reflect.macros.blackbox.Context): Int type mismatch for return type: Int does not conform to c.Expr[Any] def foo1 = macro Impls.foo1 ^ -Macros_Test_2.scala:3: error: macro implementation has incompatible shape: +Macros_Test_2.scala:4: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Any] or : (c: scala.reflect.macros.blackbox.Context): c.Tree found : (c: scala.reflect.macros.blackbox.Context): reflect.runtime.universe.Literal type mismatch for return type: reflect.runtime.universe.Literal does not conform to c.Expr[Any] def foo2 = macro Impls.foo2 ^ -Macros_Test_2.scala:6: error: macro defs must have explicitly specified return types +Macros_Test_2.scala:7: error: macro defs must have explicitly specified return types def foo5 = macro Impls.foo5 ^ -Macros_Test_2.scala:7: warning: macro defs must have explicitly specified return types (inference of Int from macro impl's c.Expr[Int] is deprecated and is going to stop working in 2.12) +Macros_Test_2.scala:8: warning: macro defs must have explicitly specified return types (inference of Int from macro impl's c.Expr[Int] is deprecated and is going to stop working in 2.12) def foo6 = macro Impls.foo6 ^ -Macros_Test_2.scala:14: error: exception during macro expansion: +Macros_Test_2.scala:15: error: exception during macro expansion: java.lang.NullPointerException - at Impls$.foo3(Impls_1.scala:7) + at Impls$.foo3(Impls_1.scala:8) foo3 ^ -Macros_Test_2.scala:15: error: macro implementation is missing +Macros_Test_2.scala:16: error: macro implementation is missing foo4 ^ one warning found diff --git a/test/files/neg/macro-invalidret.flags b/test/files/neg/macro-invalidret.flags deleted file mode 100644 index 946c53ec0e00..000000000000 --- a/test/files/neg/macro-invalidret.flags +++ /dev/null @@ -1,3 +0,0 @@ --language:experimental.macros --Xfatal-warnings --deprecation \ No newline at end of file diff --git a/test/files/neg/macro-invalidret/Impls_1.scala b/test/files/neg/macro-invalidret/Impls_1.scala index a52e8d8f3992..3845c4fa01f0 100644 --- a/test/files/neg/macro-invalidret/Impls_1.scala +++ b/test/files/neg/macro-invalidret/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros -Xfatal-warnings -deprecation import scala.reflect.macros.blackbox.Context import scala.reflect.runtime.{universe => ru} diff --git a/test/files/neg/macro-invalidret/Macros_Test_2.scala b/test/files/neg/macro-invalidret/Macros_Test_2.scala index 8840f492ab28..f0494ad6c75a 100644 --- a/test/files/neg/macro-invalidret/Macros_Test_2.scala +++ b/test/files/neg/macro-invalidret/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros -Xfatal-warnings -deprecation object Macros { def foo1 = macro Impls.foo1 def foo2 = macro Impls.foo2 @@ -15,4 +16,4 @@ object Test extends App { foo4 foo5 foo6 -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidshape.check b/test/files/neg/macro-invalidshape.check index 5093b87598df..1b701f7c1d94 100644 --- a/test/files/neg/macro-invalidshape.check +++ b/test/files/neg/macro-invalidshape.check @@ -1,19 +1,19 @@ -Macros_Test_2.scala:2: error: macro implementation reference has wrong shape. required: +Macros_Test_2.scala:3: error: macro implementation reference has wrong shape. required: macro [].[[]] or macro [].[[]] def foo1(x: Any) = macro 2 ^ -Macros_Test_2.scala:3: error: macro implementation reference has wrong shape. required: +Macros_Test_2.scala:4: error: macro implementation reference has wrong shape. required: macro [].[[]] or macro [].[[]] def foo2(x: Any) = macro Impls.foo(null)(null) ^ -Macros_Test_2.scala:4: error: missing argument list for method foo in object Impls +Macros_Test_2.scala:5: error: missing argument list for method foo in object Impls Unapplied methods are only converted to functions when a function type is expected. You can make this conversion explicit by writing `foo _` or `foo(_)(_)` instead of `foo`. def foo3(x: Any) = macro {2; Impls.foo} ^ -Macros_Test_2.scala:7: error: macro implementation reference has wrong shape. required: +Macros_Test_2.scala:8: error: macro implementation reference has wrong shape. required: macro [].[[]] or macro [].[[]] def foo = macro impl diff --git a/test/files/neg/macro-invalidshape.flags b/test/files/neg/macro-invalidshape.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-invalidshape.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-invalidshape/Impls_1.scala b/test/files/neg/macro-invalidshape/Impls_1.scala index acc6b52b7bf0..0e48a82c8d59 100644 --- a/test/files/neg/macro-invalidshape/Impls_1.scala +++ b/test/files/neg/macro-invalidshape/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { diff --git a/test/files/neg/macro-invalidshape/Macros_Test_2.scala b/test/files/neg/macro-invalidshape/Macros_Test_2.scala index 160bbf5f53cf..0ffe90be7faf 100644 --- a/test/files/neg/macro-invalidshape/Macros_Test_2.scala +++ b/test/files/neg/macro-invalidshape/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { def foo1(x: Any) = macro 2 def foo2(x: Any) = macro Impls.foo(null)(null) @@ -14,4 +15,4 @@ object Test extends App { foo1(42) foo2(42) foo3(42) -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidsig-params-badtype.check b/test/files/neg/macro-invalidsig-params-badtype.check index 159754c72e2d..77322aa26b40 100644 --- a/test/files/neg/macro-invalidsig-params-badtype.check +++ b/test/files/neg/macro-invalidsig-params-badtype.check @@ -1,4 +1,4 @@ -Impls_Macros_1.scala:8: error: macro implementation has incompatible shape: +Impls_Macros_1.scala:9: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int]): c.Expr[Nothing] or : (c: scala.reflect.macros.blackbox.Context)(x: c.Tree): c.Tree found : (c: scala.reflect.macros.blackbox.Context)(x: Int): Nothing diff --git a/test/files/neg/macro-invalidsig-params-badtype.flags b/test/files/neg/macro-invalidsig-params-badtype.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-invalidsig-params-badtype.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala index e549cc9576e8..e3b6c79675af 100644 --- a/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala +++ b/test/files/neg/macro-invalidsig-params-badtype/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { diff --git a/test/files/neg/macro-invalidsig.check b/test/files/neg/macro-invalidsig.check index 8898ffc3de61..dfb754629f76 100644 --- a/test/files/neg/macro-invalidsig.check +++ b/test/files/neg/macro-invalidsig.check @@ -1,85 +1,85 @@ -Macros_Test_2.scala:2: error: macro implementations cannot have implicit parameters other than WeakTypeTag evidences +Macros_Test_2.scala:3: error: macro implementations cannot have implicit parameters other than WeakTypeTag evidences def foo[U]: Int = macro Impls1.foo[U] ^ -Macros_Test_2.scala:6: error: macro implementation has incompatible shape: +Macros_Test_2.scala:7: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Nothing] or : (c: scala.reflect.macros.blackbox.Context): c.Tree found : : Nothing number of parameter sections differ def foo = macro Impls2.foo ^ -Macros_Test_2.scala:10: error: macro implementation has incompatible shape: +Macros_Test_2.scala:11: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Nothing] or : (c: scala.reflect.macros.blackbox.Context): c.Tree found : (c: scala.reflect.api.Universe): Nothing type mismatch for parameter c: scala.reflect.macros.blackbox.Context does not conform to scala.reflect.api.Universe def foo = macro Impls3.foo ^ -Macros_Test_2.scala:14: error: macro implementation has incompatible shape: +Macros_Test_2.scala:15: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Nothing] or : (c: scala.reflect.macros.blackbox.Context): c.Tree found : (cs: scala.reflect.macros.blackbox.Context*): Nothing types incompatible for parameter cs: corresponding is not a vararg parameter def foo = macro Impls4.foo ^ -Macros_Test_2.scala:18: error: macro implementation has incompatible shape: +Macros_Test_2.scala:19: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Any]): c.Expr[Nothing] or : (c: scala.reflect.macros.blackbox.Context)(x: c.Tree): c.Tree found : (c: scala.reflect.macros.blackbox.Context): Nothing number of parameter sections differ def foo(x: Any) = macro Impls5.foo ^ -Macros_Test_2.scala:22: error: macro implementations cannot have implicit parameters other than WeakTypeTag evidences +Macros_Test_2.scala:23: error: macro implementations cannot have implicit parameters other than WeakTypeTag evidences def foo[U](x: Int) = macro Impls6.foo[T, U] ^ -Macros_Test_2.scala:26: error: macro implementation has incompatible shape: +Macros_Test_2.scala:27: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int]): c.Expr[Nothing] or : (c: scala.reflect.macros.blackbox.Context)(x: c.Tree): c.Tree found : (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int], y: c.Expr[Int]): Nothing parameter lists have different length, found extra parameter y: c.Expr[Int] def foo(x: Int) = macro Impls7.foo ^ -Macros_Test_2.scala:30: error: macro implementation has incompatible shape: +Macros_Test_2.scala:31: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int]): c.Expr[Nothing] or : (c: scala.reflect.macros.blackbox.Context)(x: c.Tree): c.Tree found : (c: scala.reflect.macros.blackbox.Context)(x: c.universe.Symbol): Nothing type mismatch for parameter x: c.Expr[Int] does not conform to c.universe.Symbol def foo(x: Int) = macro Impls8.foo ^ -Macros_Test_2.scala:34: error: macro implementation has incompatible shape: +Macros_Test_2.scala:35: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Nothing] or : (c: scala.reflect.macros.blackbox.Context)(x: c.Tree, y: c.Tree): c.Tree found : (c: scala.reflect.macros.blackbox.Context)(xs: c.Expr[Int]*): Nothing parameter lists have different length, required extra parameter y: c.Expr[Int] def foo(x: Int, y: Int) = macro Impls9.foo ^ -Macros_Test_2.scala:38: error: macro implementation has incompatible shape: +Macros_Test_2.scala:39: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context)(x: c.Expr[Int], y: c.Expr[Int]): c.Expr[Nothing] or : (c: scala.reflect.macros.blackbox.Context)(x: c.Tree, y: c.Tree): c.Tree found : (c: scala.reflect.macros.blackbox.Context)(y: c.Expr[Int], x: c.Expr[Int]): Nothing parameter names differ: x != y def foo(x: Int, y: Int) = macro Impls10.foo ^ -Macros_Test_2.scala:42: error: macro implementation has incompatible shape: +Macros_Test_2.scala:43: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context): c.Expr[Nothing] or : (c: scala.reflect.macros.blackbox.Context): c.Tree found : (c: scala.reflect.macros.blackbox.Context)(U: c.universe.Type): Nothing number of parameter sections differ def foo[U] = macro Impls11.foo[U] ^ -Macros_Test_2.scala:46: error: type arguments [U] do not conform to method foo's type parameter bounds [U <: String] +Macros_Test_2.scala:47: error: type arguments [U] do not conform to method foo's type parameter bounds [U <: String] def foo[U] = macro Impls12.foo[U] ^ -Macros_Test_2.scala:50: error: type arguments [U] do not conform to method foo's type parameter bounds [U <: String] +Macros_Test_2.scala:51: error: type arguments [U] do not conform to method foo's type parameter bounds [U <: String] def foo[U <: Int] = macro Impls13.foo[U] ^ -Macros_Test_2.scala:54: error: macro implementation reference has too few type arguments for method foo: [U](c: scala.reflect.macros.blackbox.Context)(implicit evidence$4: c.WeakTypeTag[U])Nothing +Macros_Test_2.scala:55: error: macro implementation reference has too few type arguments for method foo: [U](c: scala.reflect.macros.blackbox.Context)(implicit evidence$4: c.WeakTypeTag[U])Nothing def foo = macro Impls14.foo ^ -Macros_Test_2.scala:59: error: macro implementation reference has too few type arguments for method foo: [T, U, V](c: scala.reflect.macros.blackbox.Context)(implicit evidence$5: c.WeakTypeTag[T], implicit evidence$6: c.WeakTypeTag[U], implicit V: c.WeakTypeTag[V])c.Expr[Unit] +Macros_Test_2.scala:60: error: macro implementation reference has too few type arguments for method foo: [T, U, V](c: scala.reflect.macros.blackbox.Context)(implicit evidence$5: c.WeakTypeTag[T], implicit evidence$6: c.WeakTypeTag[U], implicit V: c.WeakTypeTag[V])c.Expr[Unit] def foo15[V]: Unit = macro Impls15.foo ^ -Macros_Test_2.scala:60: error: wrong number of type parameters for method foo: [T, U, V](c: scala.reflect.macros.blackbox.Context)(implicit evidence$7: c.WeakTypeTag[T], implicit evidence$8: c.WeakTypeTag[U], implicit V: c.WeakTypeTag[V])c.Expr[Unit] +Macros_Test_2.scala:61: error: wrong number of type parameters for method foo: [T, U, V](c: scala.reflect.macros.blackbox.Context)(implicit evidence$7: c.WeakTypeTag[T], implicit evidence$8: c.WeakTypeTag[U], implicit V: c.WeakTypeTag[V])c.Expr[Unit] def foo16[V]: Unit = macro Impls16.foo[V] ^ 16 errors found diff --git a/test/files/neg/macro-invalidsig.flags b/test/files/neg/macro-invalidsig.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-invalidsig.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-invalidsig/Impls_1.scala b/test/files/neg/macro-invalidsig/Impls_1.scala index b0a391238003..1145676aaa9e 100644 --- a/test/files/neg/macro-invalidsig/Impls_1.scala +++ b/test/files/neg/macro-invalidsig/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.runtime.universe._ import scala.reflect.macros.blackbox.Context @@ -83,4 +84,4 @@ object Impls16 { println(V) c.Expr[Unit](q"()") } -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidsig/Macros_Test_2.scala b/test/files/neg/macro-invalidsig/Macros_Test_2.scala index 89a5302d8a2d..5272c81edf97 100644 --- a/test/files/neg/macro-invalidsig/Macros_Test_2.scala +++ b/test/files/neg/macro-invalidsig/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros1 { def foo[U]: Int = macro Impls1.foo[U] } @@ -80,4 +81,4 @@ object Test extends App { val outer2 = new outer1.C[String] outer2.foo15[Boolean] outer2.foo16[Boolean] -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidusage-badargs.check b/test/files/neg/macro-invalidusage-badargs.check index ee549c45cbeb..f68b9e172e77 100644 --- a/test/files/neg/macro-invalidusage-badargs.check +++ b/test/files/neg/macro-invalidusage-badargs.check @@ -1,19 +1,19 @@ -Macros_Test_2.scala:5: error: type mismatch; +Macros_Test_2.scala:6: error: type mismatch; found : String("42") required: Int foo("42") ^ -Macros_Test_2.scala:6: error: too few argument lists for macro invocation +Macros_Test_2.scala:7: error: too few argument lists for macro invocation foo ^ -Macros_Test_2.scala:7: error: Int does not take parameters +Macros_Test_2.scala:8: error: Int does not take parameters foo(4)(2) ^ -Macros_Test_2.scala:8: error: not enough arguments for macro method foo: (x: Int)Int. +Macros_Test_2.scala:9: error: not enough arguments for macro method foo: (x: Int)Int. Unspecified value parameter x. foo() ^ -Macros_Test_2.scala:9: error: too many arguments (2) for macro method foo: (x: Int)Int +Macros_Test_2.scala:10: error: too many arguments (2) for macro method foo: (x: Int)Int foo(4, 2) ^ 5 errors found diff --git a/test/files/neg/macro-invalidusage-badargs.flags b/test/files/neg/macro-invalidusage-badargs.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-invalidusage-badargs.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-invalidusage-badargs/Impls_1.scala b/test/files/neg/macro-invalidusage-badargs/Impls_1.scala index 8765cfbd5f2c..216780091f04 100644 --- a/test/files/neg/macro-invalidusage-badargs/Impls_1.scala +++ b/test/files/neg/macro-invalidusage-badargs/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { diff --git a/test/files/neg/macro-invalidusage-badargs/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-badargs/Macros_Test_2.scala index cf8accf94f1a..d419e80d97cc 100644 --- a/test/files/neg/macro-invalidusage-badargs/Macros_Test_2.scala +++ b/test/files/neg/macro-invalidusage-badargs/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { def foo(x: Int): Int = macro Impls.foo } import Macros._ @@ -7,4 +8,4 @@ object Test extends App { foo(4)(2) foo() foo(4, 2) -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidusage-badbounds.check b/test/files/neg/macro-invalidusage-badbounds.check index 277f407d3833..5def45b63db3 100644 --- a/test/files/neg/macro-invalidusage-badbounds.check +++ b/test/files/neg/macro-invalidusage-badbounds.check @@ -1,4 +1,4 @@ -Macros_Test_2.scala:7: error: type arguments [Int] do not conform to macro method foo's type parameter bounds [U <: String] +Macros_Test_2.scala:8: error: type arguments [Int] do not conform to macro method foo's type parameter bounds [U <: String] foo[Int] ^ one error found diff --git a/test/files/neg/macro-invalidusage-badbounds.flags b/test/files/neg/macro-invalidusage-badbounds.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-invalidusage-badbounds.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala b/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala index 1769da91e1eb..90e2157b8fd1 100644 --- a/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala +++ b/test/files/neg/macro-invalidusage-badbounds/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { diff --git a/test/files/neg/macro-invalidusage-badbounds/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-badbounds/Macros_Test_2.scala index 76397701f966..d3b2ade75dc0 100644 --- a/test/files/neg/macro-invalidusage-badbounds/Macros_Test_2.scala +++ b/test/files/neg/macro-invalidusage-badbounds/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { def foo[U <: String]: Unit = macro Impls.foo[U] } @@ -5,4 +6,4 @@ object Macros { object Test extends App { import Macros._ foo[Int] -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidusage-badtargs.check b/test/files/neg/macro-invalidusage-badtargs.check index 722ec03765c8..7c37cf88aaf2 100644 --- a/test/files/neg/macro-invalidusage-badtargs.check +++ b/test/files/neg/macro-invalidusage-badtargs.check @@ -1,16 +1,16 @@ -Macros_Test_2.scala:13: error: macro method foo1: (x: Int)Int does not take type parameters. +Macros_Test_2.scala:14: error: macro method foo1: (x: Int)Int does not take type parameters. foo1[String](42) ^ -Macros_Test_2.scala:14: error: wrong number of type parameters for macro method foo2: [T](x: Int)Int +Macros_Test_2.scala:15: error: wrong number of type parameters for macro method foo2: [T](x: Int)Int foo2[String, String](42) ^ -Macros_Test_2.scala:15: error: wrong number of type parameters for macro method foo3: [T, U](x: Int)Int +Macros_Test_2.scala:16: error: wrong number of type parameters for macro method foo3: [T, U](x: Int)Int foo3[String](42) ^ -Macros_Test_2.scala:16: error: String takes no type parameters, expected: one +Macros_Test_2.scala:17: error: String takes no type parameters, expected: one foo4[String](42) ^ -Macros_Test_2.scala:17: error: kinds of the type arguments (List) do not conform to the expected kinds of the type parameters (type T). +Macros_Test_2.scala:18: error: kinds of the type arguments (List) do not conform to the expected kinds of the type parameters (type T). List's type parameters do not match type T's expected parameters: type A has no type parameters, but type U has one foo5[List](42) diff --git a/test/files/neg/macro-invalidusage-badtargs.flags b/test/files/neg/macro-invalidusage-badtargs.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-invalidusage-badtargs.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-invalidusage-badtargs/Impls_1.scala b/test/files/neg/macro-invalidusage-badtargs/Impls_1.scala index 8765cfbd5f2c..216780091f04 100644 --- a/test/files/neg/macro-invalidusage-badtargs/Impls_1.scala +++ b/test/files/neg/macro-invalidusage-badtargs/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { diff --git a/test/files/neg/macro-invalidusage-badtargs/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-badtargs/Macros_Test_2.scala index 47e51bbf447b..e0dba1396848 100644 --- a/test/files/neg/macro-invalidusage-badtargs/Macros_Test_2.scala +++ b/test/files/neg/macro-invalidusage-badtargs/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.language.higherKinds object Macros { @@ -15,4 +16,4 @@ object Test extends App { foo3[String](42) foo4[String](42) foo5[List](42) -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidusage-methodvaluesyntax.check b/test/files/neg/macro-invalidusage-methodvaluesyntax.check index 10046b230563..244b5f1d3892 100644 --- a/test/files/neg/macro-invalidusage-methodvaluesyntax.check +++ b/test/files/neg/macro-invalidusage-methodvaluesyntax.check @@ -1,4 +1,4 @@ -Macros_Test_2.scala:6: error: macros cannot be eta-expanded +Macros_Test_2.scala:7: error: macros cannot be eta-expanded val firstClassFoo = Macros.foo _ ^ one error found diff --git a/test/files/neg/macro-invalidusage-methodvaluesyntax.flags b/test/files/neg/macro-invalidusage-methodvaluesyntax.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-invalidusage-methodvaluesyntax.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala b/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala index 776f8bf71c0a..472da347fabf 100644 --- a/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala +++ b/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -5,4 +6,4 @@ object Impls { import c.universe._ c.Expr[Unit](q"""println("it works")""") } -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidusage-methodvaluesyntax/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-methodvaluesyntax/Macros_Test_2.scala index 578aa45867d1..67e2d134eee1 100644 --- a/test/files/neg/macro-invalidusage-methodvaluesyntax/Macros_Test_2.scala +++ b/test/files/neg/macro-invalidusage-methodvaluesyntax/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { def foo: Unit = macro Impls.foo } @@ -5,4 +6,4 @@ object Macros { object Test extends App { val firstClassFoo = Macros.foo _ firstClassFoo -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidusage-nontypeable.check b/test/files/neg/macro-invalidusage-nontypeable.check index 88e6057e5e66..a5a396dd662f 100644 --- a/test/files/neg/macro-invalidusage-nontypeable.check +++ b/test/files/neg/macro-invalidusage-nontypeable.check @@ -1,4 +1,4 @@ -Test_2.scala:2: error: not found: value IDoNotExist +Test_2.scala:3: error: not found: value IDoNotExist Macros.foo ^ one error found diff --git a/test/files/neg/macro-invalidusage-nontypeable.flags b/test/files/neg/macro-invalidusage-nontypeable.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-invalidusage-nontypeable.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-invalidusage-nontypeable/Impls_Macros_1.scala b/test/files/neg/macro-invalidusage-nontypeable/Impls_Macros_1.scala index b6b96117433f..5d0160feb40b 100644 --- a/test/files/neg/macro-invalidusage-nontypeable/Impls_Macros_1.scala +++ b/test/files/neg/macro-invalidusage-nontypeable/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -10,4 +11,4 @@ object Impls { object Macros { def foo = macro Impls.foo -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidusage-nontypeable/Test_2.scala b/test/files/neg/macro-invalidusage-nontypeable/Test_2.scala index acfddae94215..61d157c9c572 100644 --- a/test/files/neg/macro-invalidusage-nontypeable/Test_2.scala +++ b/test/files/neg/macro-invalidusage-nontypeable/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { Macros.foo -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidusage-presuper.check b/test/files/neg/macro-invalidusage-presuper.check index c0b1ec024805..467d13cfd92f 100644 --- a/test/files/neg/macro-invalidusage-presuper.check +++ b/test/files/neg/macro-invalidusage-presuper.check @@ -1,4 +1,4 @@ -Macros_Test_2.scala:3: error: only concrete field definitions allowed in early object initialization section +Macros_Test_2.scala:4: error: only concrete field definitions allowed in early object initialization section class D extends { def x = macro impl } with AnyRef ^ one error found diff --git a/test/files/neg/macro-invalidusage-presuper.flags b/test/files/neg/macro-invalidusage-presuper.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-invalidusage-presuper.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-invalidusage-presuper/Impls_1.scala b/test/files/neg/macro-invalidusage-presuper/Impls_1.scala index ea98f01fa455..fa14445bd812 100644 --- a/test/files/neg/macro-invalidusage-presuper/Impls_1.scala +++ b/test/files/neg/macro-invalidusage-presuper/Impls_1.scala @@ -1,5 +1,6 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { def impl(c: Context) = { import c.universe._; c.Expr[Unit](q"()") } -} \ No newline at end of file +} diff --git a/test/files/neg/macro-invalidusage-presuper/Macros_Test_2.scala b/test/files/neg/macro-invalidusage-presuper/Macros_Test_2.scala index ff46a5915fdb..71193902ccd3 100644 --- a/test/files/neg/macro-invalidusage-presuper/Macros_Test_2.scala +++ b/test/files/neg/macro-invalidusage-presuper/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import Impls._ -class D extends { def x = macro impl } with AnyRef \ No newline at end of file +class D extends { def x = macro impl } with AnyRef diff --git a/test/files/neg/macro-noexpand.check b/test/files/neg/macro-noexpand.check index 2c176a99bec0..d8d81daedb33 100644 --- a/test/files/neg/macro-noexpand.check +++ b/test/files/neg/macro-noexpand.check @@ -1,4 +1,4 @@ -Macros_Test_2.scala:7: error: not found: value x +Macros_Test_2.scala:8: error: not found: value x foo(x) ^ one error found diff --git a/test/files/neg/macro-noexpand.flags b/test/files/neg/macro-noexpand.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-noexpand.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-noexpand/Impls_1.scala b/test/files/neg/macro-noexpand/Impls_1.scala index acc6b52b7bf0..0e48a82c8d59 100644 --- a/test/files/neg/macro-noexpand/Impls_1.scala +++ b/test/files/neg/macro-noexpand/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { diff --git a/test/files/neg/macro-noexpand/Macros_Test_2.scala b/test/files/neg/macro-noexpand/Macros_Test_2.scala index e783e2b53e7e..7a055ec04955 100644 --- a/test/files/neg/macro-noexpand/Macros_Test_2.scala +++ b/test/files/neg/macro-noexpand/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { def foo(x: Any) = macro Impls.foo } @@ -5,4 +6,4 @@ object Macros { object Test extends App { import Macros._ foo(x) -} \ No newline at end of file +} diff --git a/test/files/neg/macro-nontypeablebody.check b/test/files/neg/macro-nontypeablebody.check index 9f5831ab304c..3fa4949cba4d 100644 --- a/test/files/neg/macro-nontypeablebody.check +++ b/test/files/neg/macro-nontypeablebody.check @@ -1,4 +1,4 @@ -Macros_Test_2.scala:2: error: value foo2 is not a member of object Impls +Macros_Test_2.scala:3: error: value foo2 is not a member of object Impls def foo(x: Any) = macro Impls.foo2 ^ one error found diff --git a/test/files/neg/macro-nontypeablebody.flags b/test/files/neg/macro-nontypeablebody.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-nontypeablebody.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-nontypeablebody/Impls_1.scala b/test/files/neg/macro-nontypeablebody/Impls_1.scala index acc6b52b7bf0..0e48a82c8d59 100644 --- a/test/files/neg/macro-nontypeablebody/Impls_1.scala +++ b/test/files/neg/macro-nontypeablebody/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { diff --git a/test/files/neg/macro-nontypeablebody/Macros_Test_2.scala b/test/files/neg/macro-nontypeablebody/Macros_Test_2.scala index 203189397060..fb661610e5fd 100644 --- a/test/files/neg/macro-nontypeablebody/Macros_Test_2.scala +++ b/test/files/neg/macro-nontypeablebody/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { def foo(x: Any) = macro Impls.foo2 } @@ -5,4 +6,4 @@ object Macros { object Test extends App { import Macros._ foo(42) -} \ No newline at end of file +} diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-a.check b/test/files/neg/macro-override-macro-overrides-abstract-method-a.check index 6b5d3013bada..5baec777208f 100644 --- a/test/files/neg/macro-override-macro-overrides-abstract-method-a.check +++ b/test/files/neg/macro-override-macro-overrides-abstract-method-a.check @@ -1,4 +1,4 @@ -Impls_Macros_1.scala:12: error: overriding method foo in trait Foo of type (x: Int)Int; +Impls_Macros_1.scala:13: error: overriding method foo in trait Foo of type (x: Int)Int; macro method foo cannot be used here - term macros cannot override abstract methods def foo(x: Int): Int = macro Impls.impl ^ diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-a.flags b/test/files/neg/macro-override-macro-overrides-abstract-method-a.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-override-macro-overrides-abstract-method-a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala b/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala index 916b454463b6..09f9245148e6 100644 --- a/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala +++ b/test/files/neg/macro-override-macro-overrides-abstract-method-a/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-a/Test_2.scala b/test/files/neg/macro-override-macro-overrides-abstract-method-a/Test_2.scala index 7e3357ec28c6..f0b6eb9e6f34 100644 --- a/test/files/neg/macro-override-macro-overrides-abstract-method-a/Test_2.scala +++ b/test/files/neg/macro-override-macro-overrides-abstract-method-a/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { val designator: Macros.type = Macros designator.foo(42) -} \ No newline at end of file +} diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-b.check b/test/files/neg/macro-override-macro-overrides-abstract-method-b.check index c733555549ae..0db2fd81dc04 100644 --- a/test/files/neg/macro-override-macro-overrides-abstract-method-b.check +++ b/test/files/neg/macro-override-macro-overrides-abstract-method-b.check @@ -1,10 +1,10 @@ -Test_2.scala:3: error: <$anon: C with A> inherits conflicting members: +Test_2.scala:4: error: <$anon: C with A> inherits conflicting members: macro method t in trait C of type ()Unit and method t in trait A of type ()Unit (Note: this can be resolved by declaring an override in <$anon: C with A>.) val c2 = new C with A {} ^ -Test_2.scala:5: error: overriding macro method t in trait C of type ()Unit; +Test_2.scala:6: error: overriding macro method t in trait C of type ()Unit; method t cannot be used here - only term macros can override term macros val c4 = new C with A { override def t(): Unit = () } ^ diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-b.flags b/test/files/neg/macro-override-macro-overrides-abstract-method-b.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-override-macro-overrides-abstract-method-b.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala b/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala index 17827abf7a6c..0aba1840fc8e 100644 --- a/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala +++ b/test/files/neg/macro-override-macro-overrides-abstract-method-b/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context import language.experimental.macros diff --git a/test/files/neg/macro-override-macro-overrides-abstract-method-b/Test_2.scala b/test/files/neg/macro-override-macro-overrides-abstract-method-b/Test_2.scala index 9b4c8e35f02a..d1cac88d41b9 100644 --- a/test/files/neg/macro-override-macro-overrides-abstract-method-b/Test_2.scala +++ b/test/files/neg/macro-override-macro-overrides-abstract-method-b/Test_2.scala @@ -1,6 +1,7 @@ +// scalac: -language:experimental.macros object Test extends App { val c1 = new A with C {} val c2 = new C with A {} val c3 = new C with A { override def t(): Unit = macro Macro.t } val c4 = new C with A { override def t(): Unit = () } -} \ No newline at end of file +} diff --git a/test/files/neg/macro-override-method-overrides-macro.check b/test/files/neg/macro-override-method-overrides-macro.check index e396d65ff1a6..d6fdca775ae3 100644 --- a/test/files/neg/macro-override-method-overrides-macro.check +++ b/test/files/neg/macro-override-method-overrides-macro.check @@ -1,4 +1,4 @@ -Macros_Test_2.scala:8: error: overriding macro method foo in class B of type (x: String)Unit; +Macros_Test_2.scala:9: error: overriding macro method foo in class B of type (x: String)Unit; method foo cannot be used here - only term macros can override term macros override def foo(x: String): Unit = println("fooDString") ^ diff --git a/test/files/neg/macro-override-method-overrides-macro.flags b/test/files/neg/macro-override-method-overrides-macro.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-override-method-overrides-macro.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala b/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala index f3917e309369..c94f47465596 100644 --- a/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala +++ b/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -11,4 +12,4 @@ object Impls { def fooBInt(c: Context)(x: c.Expr[_]) = impl(c)("fooBInt", x) def fooDInt(c: Context)(x: c.Expr[_]) = impl(c)("fooDInt", x) def fooZString(c: Context)(x: c.Expr[_]) = impl(c)("fooZString", x) -} \ No newline at end of file +} diff --git a/test/files/neg/macro-override-method-overrides-macro/Macros_Test_2.scala b/test/files/neg/macro-override-method-overrides-macro/Macros_Test_2.scala index d47157766e49..8afee7d91b52 100644 --- a/test/files/neg/macro-override-method-overrides-macro/Macros_Test_2.scala +++ b/test/files/neg/macro-override-method-overrides-macro/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros class B { def foo(x: String): Unit = macro Impls.fooBString def foo(x: Int): Unit = macro Impls.fooBInt diff --git a/test/files/neg/macro-reify-splice-splice.check b/test/files/neg/macro-reify-splice-splice.check index bd1ea7acee0b..995af25146d8 100644 --- a/test/files/neg/macro-reify-splice-splice.check +++ b/test/files/neg/macro-reify-splice-splice.check @@ -1,4 +1,4 @@ -Macros_1.scala:8: error: the splice cannot be resolved statically, which means there is a cross-stage evaluation involved. +Macros_1.scala:9: error: the splice cannot be resolved statically, which means there is a cross-stage evaluation involved. cross-stage evaluations need to be invoked explicitly, so we're showing you this error. if you're sure this is not an oversight, add scala-compiler.jar to the classpath, import `scala.tools.reflect.Eval` and call `.eval` instead. diff --git a/test/files/neg/macro-reify-splice-splice.flags b/test/files/neg/macro-reify-splice-splice.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/macro-reify-splice-splice.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/macro-reify-splice-splice/Macros_1.scala b/test/files/neg/macro-reify-splice-splice/Macros_1.scala index 306e78ad97a2..f8f7c7fa254c 100644 --- a/test/files/neg/macro-reify-splice-splice/Macros_1.scala +++ b/test/files/neg/macro-reify-splice-splice/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { @@ -8,4 +9,4 @@ object Macros { { c.universe.reify(c.universe.reify("hello world")) }.splice.splice } } -} \ No newline at end of file +} diff --git a/test/files/neg/macro-reify-splice-splice/Test_2.scala b/test/files/neg/macro-reify-splice-splice/Test_2.scala index f697da60200f..41ce473dacde 100644 --- a/test/files/neg/macro-reify-splice-splice/Test_2.scala +++ b/test/files/neg/macro-reify-splice-splice/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { println(Macros.foo) -} \ No newline at end of file +} diff --git a/test/files/neg/main1.check b/test/files/neg/main1.check index b7451058180c..75cfe5f40194 100644 --- a/test/files/neg/main1.check +++ b/test/files/neg/main1.check @@ -1,24 +1,24 @@ -main1.scala:3: warning: Foo has a main method with parameter type Array[String], but foo1.Foo will not be a runnable program. +main1.scala:4: warning: Foo has a main method with parameter type Array[String], but foo1.Foo will not be a runnable program. Reason: companion is a trait, which means no static forwarder can be generated. object Foo { // companion is trait ^ -main1.scala:10: warning: Foo has a main method with parameter type Array[String], but foo2.Foo will not be a runnable program. +main1.scala:11: warning: Foo has a main method with parameter type Array[String], but foo2.Foo will not be a runnable program. Reason: companion contains its own main method, which means no static forwarder can be generated. object Foo { // companion has its own main ^ -main1.scala:22: warning: Foo has a main method with parameter type Array[String], but foo3.Foo will not be a runnable program. +main1.scala:23: warning: Foo has a main method with parameter type Array[String], but foo3.Foo will not be a runnable program. Reason: companion contains its own main method (implementation restriction: no main is allowed, regardless of signature), which means no static forwarder can be generated. object Foo { // Companion contains main, but not an interfering main. ^ -main1.scala:31: warning: Foo has a main method with parameter type Array[String], but foo4.Foo will not be a runnable program. +main1.scala:32: warning: Foo has a main method with parameter type Array[String], but foo4.Foo will not be a runnable program. Reason: companion contains its own main method, which means no static forwarder can be generated. object Foo extends Foo { // Inherits main from the class ^ -main1.scala:39: warning: Foo has a main method with parameter type Array[String], but foo5.Foo will not be a runnable program. +main1.scala:40: warning: Foo has a main method with parameter type Array[String], but foo5.Foo will not be a runnable program. Reason: companion contains its own main method, which means no static forwarder can be generated. object Foo extends Foo { // Overrides main from the class diff --git a/test/files/neg/main1.flags b/test/files/neg/main1.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/main1.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/main1.scala b/test/files/neg/main1.scala index 2b5551ac3836..1152768f0872 100644 --- a/test/files/neg/main1.scala +++ b/test/files/neg/main1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings // negatives package foo1 { object Foo { // companion is trait diff --git a/test/files/neg/maxerrs.check b/test/files/neg/maxerrs.check index 5eaedad487ea..b9ca3162afa6 100644 --- a/test/files/neg/maxerrs.check +++ b/test/files/neg/maxerrs.check @@ -1,14 +1,14 @@ -maxerrs.scala:22: error: type mismatch; +maxerrs.scala:23: error: type mismatch; found : String("") required: Int def F = f("") ^ -maxerrs.scala:24: error: type mismatch; +maxerrs.scala:25: error: type mismatch; found : String("") required: Int def g = f("") ^ -maxerrs.scala:26: error: type mismatch; +maxerrs.scala:27: error: type mismatch; found : String("") required: Int def h = f("") diff --git a/test/files/neg/maxerrs.flags b/test/files/neg/maxerrs.flags deleted file mode 100644 index 6629ef62b6e4..000000000000 --- a/test/files/neg/maxerrs.flags +++ /dev/null @@ -1 +0,0 @@ --Xmaxerrs 3 -Xfatal-warnings -deprecation diff --git a/test/files/neg/maxerrs.scala b/test/files/neg/maxerrs.scala index 43b725de7ae8..79395f0e1853 100644 --- a/test/files/neg/maxerrs.scala +++ b/test/files/neg/maxerrs.scala @@ -1,3 +1,4 @@ +// scalac: -Xmaxerrs 3 -Xfatal-warnings -deprecation object X { @deprecated("just to annoy people", since="forever") diff --git a/test/files/neg/maxwarns.check b/test/files/neg/maxwarns.check index f4c8d907bd4e..dddc9895d9d2 100644 --- a/test/files/neg/maxwarns.check +++ b/test/files/neg/maxwarns.check @@ -1,10 +1,10 @@ -maxwarns.scala:12: warning: method x in object X is deprecated (since forever): just to annoy people +maxwarns.scala:13: warning: method x in object X is deprecated (since forever): just to annoy people def a = x ^ -maxwarns.scala:14: warning: method x in object X is deprecated (since forever): just to annoy people +maxwarns.scala:15: warning: method x in object X is deprecated (since forever): just to annoy people def b = x ^ -maxwarns.scala:16: warning: method x in object X is deprecated (since forever): just to annoy people +maxwarns.scala:17: warning: method x in object X is deprecated (since forever): just to annoy people def c = x ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/maxwarns.flags b/test/files/neg/maxwarns.flags deleted file mode 100644 index d5d6e533e9d7..000000000000 --- a/test/files/neg/maxwarns.flags +++ /dev/null @@ -1 +0,0 @@ --Xmaxwarns 3 -Xfatal-warnings -deprecation diff --git a/test/files/neg/maxwarns.scala b/test/files/neg/maxwarns.scala index decb8a786623..9864ea44eb07 100644 --- a/test/files/neg/maxwarns.scala +++ b/test/files/neg/maxwarns.scala @@ -1,3 +1,4 @@ +// scalac: -Xmaxwarns 3 -Xfatal-warnings -deprecation object X { @deprecated("just to annoy people", since="forever") diff --git a/test/files/neg/migration28.check b/test/files/neg/migration28.check index afb4db62e205..133148e23f3a 100644 --- a/test/files/neg/migration28.check +++ b/test/files/neg/migration28.check @@ -1,4 +1,4 @@ -migration28.scala:4: warning: method scanRight in trait TraversableLike has changed semantics in version 2.9.0: +migration28.scala:5: warning: method scanRight in trait TraversableLike has changed semantics in version 2.9.0: The behavior of `scanRight` has changed. The previous behavior can be reproduced with scanRight.reverse. List(1,2,3,4,5).scanRight(0)(_+_) ^ diff --git a/test/files/neg/migration28.flags b/test/files/neg/migration28.flags deleted file mode 100644 index 197b3198c888..000000000000 --- a/test/files/neg/migration28.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xmigration diff --git a/test/files/neg/migration28.scala b/test/files/neg/migration28.scala index facc9b36d2f2..702e78ff86f5 100644 --- a/test/files/neg/migration28.scala +++ b/test/files/neg/migration28.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xmigration object Test { import scala.collection.mutable._ diff --git a/test/files/neg/multi-array.check b/test/files/neg/multi-array.check index 06ffdc9fbc33..6671201f0b5c 100644 --- a/test/files/neg/multi-array.check +++ b/test/files/neg/multi-array.check @@ -1,4 +1,4 @@ -multi-array.scala:7: error: too many arguments (2) for constructor Array: (_length: Int)Array[T] +multi-array.scala:8: error: too many arguments (2) for constructor Array: (_length: Int)Array[T] val a: Array[Int] = new Array(10, 10) ^ one error found diff --git a/test/files/neg/multi-array.flags b/test/files/neg/multi-array.flags deleted file mode 100644 index c36e713ab84b..000000000000 --- a/test/files/neg/multi-array.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation \ No newline at end of file diff --git a/test/files/neg/multi-array.scala b/test/files/neg/multi-array.scala index b04e0fa0b159..fed1974782ec 100644 --- a/test/files/neg/multi-array.scala +++ b/test/files/neg/multi-array.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation /** Multi-dimensional array creation with `new` was removed in 2.10. * The replacement Array.ofDim[Int](10,10) makes the original mistake * which was tested here impossible. diff --git a/test/files/neg/names-defaults-neg-213.check b/test/files/neg/names-defaults-neg-213.check index 1868544b22fb..0ec319781395 100644 --- a/test/files/neg/names-defaults-neg-213.check +++ b/test/files/neg/names-defaults-neg-213.check @@ -1,9 +1,9 @@ -names-defaults-neg-213.scala:8: error: unknown parameter name: x +names-defaults-neg-213.scala:9: error: unknown parameter name: x Note that assignments in argument position are no longer allowed since Scala 2.13. To express the assignment expression, wrap it in brackets, e.g., `{ x = ... }`. f2(x = 1) // error, no parameter named x. error message mentions change in 2.13 ^ -names-defaults-neg-213.scala:14: error: unknown parameter name: x +names-defaults-neg-213.scala:15: error: unknown parameter name: x f2(x = 1) // error (no such parameter). no mention of new semantics in 2.13 ^ two errors found diff --git a/test/files/neg/names-defaults-neg-213.flags b/test/files/neg/names-defaults-neg-213.flags deleted file mode 100644 index 3e1952020a23..000000000000 --- a/test/files/neg/names-defaults-neg-213.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 \ No newline at end of file diff --git a/test/files/neg/names-defaults-neg-213.scala b/test/files/neg/names-defaults-neg-213.scala index e06a73b73f8e..10667b35304b 100644 --- a/test/files/neg/names-defaults-neg-213.scala +++ b/test/files/neg/names-defaults-neg-213.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 class C { def f1(x: Unit): Int = 0 def f2(y: Unit): Int = 0 diff --git a/test/files/neg/names-defaults-neg-warn.check b/test/files/neg/names-defaults-neg-warn.check index 0ecf33b5e222..bd034e928585 100644 --- a/test/files/neg/names-defaults-neg-warn.check +++ b/test/files/neg/names-defaults-neg-warn.check @@ -1,19 +1,19 @@ -names-defaults-neg-warn.scala:11: warning: the parameter name s is deprecated: use x instead +names-defaults-neg-warn.scala:12: warning: the parameter name s is deprecated: use x instead deprNam2.f(s = "dlfkj") ^ -names-defaults-neg-warn.scala:12: warning: the parameter name x is deprecated: use s instead +names-defaults-neg-warn.scala:13: warning: the parameter name x is deprecated: use s instead deprNam2.g(x = "dlkjf") ^ -names-defaults-neg-warn.scala:22: error: reference to x is ambiguous; it is both a method parameter and a variable in scope. +names-defaults-neg-warn.scala:23: error: reference to x is ambiguous; it is both a method parameter and a variable in scope. f1(x = 1) // 2.12: error, ambiguous (named arg or assign). 2.13: named arg ^ -names-defaults-neg-warn.scala:23: warning: assignments in argument position are deprecated in favor of named arguments. Wrap the assignment in brackets, e.g., `{ x = ... }`. +names-defaults-neg-warn.scala:24: warning: assignments in argument position are deprecated in favor of named arguments. Wrap the assignment in brackets, e.g., `{ x = ... }`. f2(x = 1) // 2.12: deprecation warning, compiles. 2.13: error, no parameter named x ^ -names-defaults-neg-warn.scala:34: warning: assignments in argument position are deprecated in favor of named arguments. Wrap the assignment in brackets, e.g., `{ x = ... }`. +names-defaults-neg-warn.scala:35: warning: assignments in argument position are deprecated in favor of named arguments. Wrap the assignment in brackets, e.g., `{ x = ... }`. synchronized(x = 1) // deprecation warning in 2.12, error in 2.13 ^ -names-defaults-neg-warn.scala:43: error: reassignment to val +names-defaults-neg-warn.scala:44: error: reassignment to val f2(x = 1) // 2.12, 2.13: error (no such parameter). no deprecation warning in 2.12, x is not a variable. ^ four warnings found diff --git a/test/files/neg/names-defaults-neg-warn.flags b/test/files/neg/names-defaults-neg-warn.flags deleted file mode 100644 index d1b831ea87cd..000000000000 --- a/test/files/neg/names-defaults-neg-warn.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/names-defaults-neg-warn.scala b/test/files/neg/names-defaults-neg-warn.scala index 14e58ddac55e..a96d407ad33f 100644 --- a/test/files/neg/names-defaults-neg-warn.scala +++ b/test/files/neg/names-defaults-neg-warn.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings object Test extends App { object deprNam2 { def f(@deprecatedName('s) x: String) = 1 diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check index 83163abef5e2..96a9591d1d8b 100644 --- a/test/files/neg/names-defaults-neg.check +++ b/test/files/neg/names-defaults-neg.check @@ -1,90 +1,90 @@ -names-defaults-neg.scala:5: error: type mismatch; +names-defaults-neg.scala:6: error: type mismatch; found : String("#") required: Int test1(b = 2, a = "#") ^ -names-defaults-neg.scala:5: error: type mismatch; +names-defaults-neg.scala:6: error: type mismatch; found : Int(2) required: String test1(b = 2, a = "#") ^ -names-defaults-neg.scala:8: error: positional after named argument. +names-defaults-neg.scala:9: error: positional after named argument. test1(b = "(*", 23) ^ -names-defaults-neg.scala:13: error: reference to x is ambiguous; it is both a method parameter and a variable in scope. +names-defaults-neg.scala:14: error: reference to x is ambiguous; it is both a method parameter and a variable in scope. test2(x = 1) ^ -names-defaults-neg.scala:15: error: not found: value c +names-defaults-neg.scala:16: error: not found: value c test1(c = 0, b = "joke") ^ -names-defaults-neg.scala:16: error: not found: value m +names-defaults-neg.scala:17: error: not found: value m test7((m = 1)) // named arguments must be top-level assignments ^ -names-defaults-neg.scala:17: error: not found: value m +names-defaults-neg.scala:18: error: not found: value m test7({m = 1}) ^ -names-defaults-neg.scala:18: error: not found: value m +names-defaults-neg.scala:19: error: not found: value m test7 { m = 1 } // no named arguments in argument block ^ -names-defaults-neg.scala:19: error: reference to x is ambiguous; it is both a method parameter and a variable in scope. +names-defaults-neg.scala:20: error: reference to x is ambiguous; it is both a method parameter and a variable in scope. test8(x = 1) ^ -names-defaults-neg.scala:22: error: parameter 'a' is already specified at parameter position 1 +names-defaults-neg.scala:23: error: parameter 'a' is already specified at parameter position 1 test1(1, a = 2) ^ -names-defaults-neg.scala:23: error: parameter 'b' is already specified at parameter position 1 +names-defaults-neg.scala:24: error: parameter 'b' is already specified at parameter position 1 test1(b = 1, b = "2") ^ -names-defaults-neg.scala:26: error: Int does not take parameters +names-defaults-neg.scala:27: error: Int does not take parameters test3(b = 3, a = 1)(3) ^ -names-defaults-neg.scala:35: error: ambiguous reference to overloaded definition, +names-defaults-neg.scala:36: error: ambiguous reference to overloaded definition, both method f in object t1 of type (b: String, a: Int)String and method f in object t1 of type (a: Int, b: String)String match argument types (b: String,a: Int) t1.f(b = "dkljf", a = 1) ^ -names-defaults-neg.scala:42: error: ambiguous reference to overloaded definition, +names-defaults-neg.scala:43: error: ambiguous reference to overloaded definition, both method f in object t3 of type (a2: Int)(b: Int)String and method f in object t3 of type (a1: Int)String match argument types (Int) t3.f(1) ^ -names-defaults-neg.scala:43: error: ambiguous reference to overloaded definition, +names-defaults-neg.scala:44: error: ambiguous reference to overloaded definition, both method f in object t3 of type (a2: Int)(b: Int)String and method f in object t3 of type (a1: Int)String match argument types (Int) t3.f(1)(2) ^ -names-defaults-neg.scala:49: error: ambiguous reference to overloaded definition, +names-defaults-neg.scala:50: error: ambiguous reference to overloaded definition, both method g in object t7 of type (a: B)String and method g in object t7 of type (a: C, b: Int*)String match argument types (C) t7.g(new C()) // ambiguous reference ^ -names-defaults-neg.scala:53: error: parameter 'b' is already specified at parameter position 2 +names-defaults-neg.scala:54: error: parameter 'b' is already specified at parameter position 2 test5(a = 1, b = "dkjl", b = "dkj") ^ -names-defaults-neg.scala:54: error: parameter 'b' is already specified at parameter position 2 +names-defaults-neg.scala:55: error: parameter 'b' is already specified at parameter position 2 test5(1, "2", b = 3) ^ -names-defaults-neg.scala:55: error: when using named arguments, the vararg parameter has to be specified exactly once +names-defaults-neg.scala:56: error: when using named arguments, the vararg parameter has to be specified exactly once test5(b = "dlkj") ^ -names-defaults-neg.scala:61: error: ambiguous reference to overloaded definition, +names-defaults-neg.scala:62: error: ambiguous reference to overloaded definition, both method f in object t8 of type (b: String, a: Int)String and method f in object t8 of type (a: Int, b: Object)String match argument types (a: Int,b: String) and expected result type Any println(t8.f(a = 0, b = "1")) // ambiguous reference ^ -names-defaults-neg.scala:65: error: not enough arguments for method apply: (a: Int, b: String)(c: Int*)Fact in object Fact. +names-defaults-neg.scala:66: error: not enough arguments for method apply: (a: Int, b: String)(c: Int*)Fact in object Fact. Unspecified value parameter b. val fac = Fact(1)(2, 3) ^ -names-defaults-neg.scala:69: error: wrong number of arguments for pattern A1(x: Int,y: String) +names-defaults-neg.scala:70: error: wrong number of arguments for pattern A1(x: Int,y: String) A1() match { case A1(_) => () } ^ -names-defaults-neg.scala:76: error: no type parameters for method test4: (x: T[T[List[T[X forSome { type X }]]]])T[T[List[T[X forSome { type X }]]]] exist so that it can be applied to arguments (List[Int]) +names-defaults-neg.scala:77: error: no type parameters for method test4: (x: T[T[List[T[X forSome { type X }]]]])T[T[List[T[X forSome { type X }]]]] exist so that it can be applied to arguments (List[Int]) --- because --- argument expression's type is not compatible with formal parameter type; found : List[Int] @@ -92,96 +92,96 @@ argument expression's type is not compatible with formal parameter type; Error occurred in an application involving default arguments. test4() ^ -names-defaults-neg.scala:79: error: type mismatch; +names-defaults-neg.scala:80: error: type mismatch; found : List[Int] required: List[List[?]] def test6[T](x: List[List[T]] = List(1,2)) = x ^ -names-defaults-neg.scala:82: error: type mismatch; +names-defaults-neg.scala:83: error: type mismatch; found : Int required: String Error occurred in an application involving default arguments. new A2[String]() ^ -names-defaults-neg.scala:86: error: module extending its companion class cannot use default constructor arguments +names-defaults-neg.scala:87: error: module extending its companion class cannot use default constructor arguments object C extends C() ^ -names-defaults-neg.scala:90: error: deprecated parameter name x has to be distinct from any other parameter name (deprecated or not). +names-defaults-neg.scala:91: error: deprecated parameter name x has to be distinct from any other parameter name (deprecated or not). def deprNam1(x: Int, @deprecatedName('x) y: String) = 0 ^ -names-defaults-neg.scala:91: error: deprecated parameter name a has to be distinct from any other parameter name (deprecated or not). +names-defaults-neg.scala:92: error: deprecated parameter name a has to be distinct from any other parameter name (deprecated or not). def deprNam2(a: String)(@deprecatedName('a) b: Int) = 1 ^ -names-defaults-neg.scala:93: warning: the parameter name y is deprecated: use b instead +names-defaults-neg.scala:94: warning: the parameter name y is deprecated: use b instead deprNam3(y = 10, b = 2) ^ -names-defaults-neg.scala:93: error: parameter 'b' is already specified at parameter position 1 +names-defaults-neg.scala:94: error: parameter 'b' is already specified at parameter position 1 deprNam3(y = 10, b = 2) ^ -names-defaults-neg.scala:96: warning: naming parameter deprNam4Arg is deprecated. +names-defaults-neg.scala:97: warning: naming parameter deprNam4Arg is deprecated. deprNam4(deprNam4Arg = null) ^ -names-defaults-neg.scala:98: warning: naming parameter deprNam5Arg is deprecated. +names-defaults-neg.scala:99: warning: naming parameter deprNam5Arg is deprecated. deprNam5(deprNam5Arg = null) ^ -names-defaults-neg.scala:102: error: unknown parameter name: m +names-defaults-neg.scala:103: error: unknown parameter name: m f3818(y = 1, m = 1) ^ -names-defaults-neg.scala:135: error: reference to var2 is ambiguous; it is both a method parameter and a variable in scope. +names-defaults-neg.scala:136: error: reference to var2 is ambiguous; it is both a method parameter and a variable in scope. delay(var2 = 40) ^ -names-defaults-neg.scala:138: error: missing parameter type for expanded function ((x$1: ) => a = x$1) +names-defaults-neg.scala:139: error: missing parameter type for expanded function ((x$1: ) => a = x$1) val taf2: Int => Unit = testAnnFun(a = _, b = get("+")) ^ -names-defaults-neg.scala:138: error: not found: value a +names-defaults-neg.scala:139: error: not found: value a val taf2: Int => Unit = testAnnFun(a = _, b = get("+")) ^ -names-defaults-neg.scala:138: error: not found: value get +names-defaults-neg.scala:139: error: not found: value get val taf2: Int => Unit = testAnnFun(a = _, b = get("+")) ^ -names-defaults-neg.scala:139: error: parameter 'a' is already specified at parameter position 1 +names-defaults-neg.scala:140: error: parameter 'a' is already specified at parameter position 1 val taf3 = testAnnFun(b = _: String, a = get(8)) ^ -names-defaults-neg.scala:140: error: missing parameter type for expanded function ((x$4: ) => b = x$4) +names-defaults-neg.scala:141: error: missing parameter type for expanded function ((x$4: ) => b = x$4) val taf4: (Int, String) => Unit = testAnnFun(_, b = _) ^ -names-defaults-neg.scala:140: error: not found: value b +names-defaults-neg.scala:141: error: not found: value b val taf4: (Int, String) => Unit = testAnnFun(_, b = _) ^ -names-defaults-neg.scala:148: error: variable definition needs type because 'x' is used as a named argument in its body. +names-defaults-neg.scala:149: error: variable definition needs type because 'x' is used as a named argument in its body. def t3 { var x = t.f(x = 1) } ^ -names-defaults-neg.scala:151: error: variable definition needs type because 'x' is used as a named argument in its body. +names-defaults-neg.scala:152: error: variable definition needs type because 'x' is used as a named argument in its body. object t6 { var x = t.f(x = 1) } ^ -names-defaults-neg.scala:151: warning: failed to determine if 'x = ...' is a named argument or an assignment expression. +names-defaults-neg.scala:152: warning: failed to determine if 'x = ...' is a named argument or an assignment expression. an explicit type is required for the definition mentioned in the error message above. object t6 { var x = t.f(x = 1) } ^ -names-defaults-neg.scala:154: error: variable definition needs type because 'x' is used as a named argument in its body. +names-defaults-neg.scala:155: error: variable definition needs type because 'x' is used as a named argument in its body. class t9 { var x = t.f(x = 1) } ^ -names-defaults-neg.scala:154: warning: failed to determine if 'x = ...' is a named argument or an assignment expression. +names-defaults-neg.scala:155: warning: failed to determine if 'x = ...' is a named argument or an assignment expression. an explicit type is required for the definition mentioned in the error message above. class t9 { var x = t.f(x = 1) } ^ -names-defaults-neg.scala:168: error: variable definition needs type because 'x' is used as a named argument in its body. +names-defaults-neg.scala:169: error: variable definition needs type because 'x' is used as a named argument in its body. def u3 { var x = u.f(x = 1) } ^ -names-defaults-neg.scala:171: error: variable definition needs type because 'x' is used as a named argument in its body. +names-defaults-neg.scala:172: error: variable definition needs type because 'x' is used as a named argument in its body. def u6 { var x = u.f(x = "32") } ^ -names-defaults-neg.scala:174: error: reference to x is ambiguous; it is both a method parameter and a variable in scope. +names-defaults-neg.scala:175: error: reference to x is ambiguous; it is both a method parameter and a variable in scope. def u9 { var x: Int = u.f(x = 1) } ^ -names-defaults-neg.scala:181: error: variable definition needs type because 'x' is used as a named argument in its body. +names-defaults-neg.scala:182: error: variable definition needs type because 'x' is used as a named argument in its body. class u15 { var x = u.f(x = 1) } ^ -names-defaults-neg.scala:181: warning: failed to determine if 'x = ...' is a named argument or an assignment expression. +names-defaults-neg.scala:182: warning: failed to determine if 'x = ...' is a named argument or an assignment expression. an explicit type is required for the definition mentioned in the error message above. class u15 { var x = u.f(x = 1) } ^ -names-defaults-neg.scala:184: error: reference to x is ambiguous; it is both a method parameter and a variable in scope. +names-defaults-neg.scala:185: error: reference to x is ambiguous; it is both a method parameter and a variable in scope. class u18 { var x: Int = u.f(x = 1) } ^ 6 warnings found diff --git a/test/files/neg/names-defaults-neg.flags b/test/files/neg/names-defaults-neg.flags deleted file mode 100644 index dcc59ebe32ef..000000000000 --- a/test/files/neg/names-defaults-neg.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation diff --git a/test/files/neg/names-defaults-neg.scala b/test/files/neg/names-defaults-neg.scala index 6637c679bd7a..698aefd34b3f 100644 --- a/test/files/neg/names-defaults-neg.scala +++ b/test/files/neg/names-defaults-neg.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation object Test extends App { // TESTS diff --git a/test/files/neg/newpat_unreachable.check b/test/files/neg/newpat_unreachable.check index 4463e2f1a43e..97c233f46176 100644 --- a/test/files/neg/newpat_unreachable.check +++ b/test/files/neg/newpat_unreachable.check @@ -1,33 +1,33 @@ -newpat_unreachable.scala:6: warning: patterns after a variable pattern cannot match (SLS 8.1.1) +newpat_unreachable.scala:7: warning: patterns after a variable pattern cannot match (SLS 8.1.1) If you intended to match against parameter b of method contrivedExample, you must use backticks, like: case `b` => case b => println("matched b") ^ -newpat_unreachable.scala:7: warning: unreachable code due to variable pattern 'b' on line 6 +newpat_unreachable.scala:8: warning: unreachable code due to variable pattern 'b' on line 7 If you intended to match against parameter c of method contrivedExample, you must use backticks, like: case `c` => case c => println("matched c") ^ -newpat_unreachable.scala:8: warning: unreachable code due to variable pattern 'b' on line 6 +newpat_unreachable.scala:9: warning: unreachable code due to variable pattern 'b' on line 7 If you intended to match against value d in class A, you must use backticks, like: case `d` => case d => println("matched d") ^ -newpat_unreachable.scala:9: warning: unreachable code due to variable pattern 'b' on line 6 +newpat_unreachable.scala:10: warning: unreachable code due to variable pattern 'b' on line 7 case _ => println("matched neither") ^ -newpat_unreachable.scala:7: warning: unreachable code +newpat_unreachable.scala:8: warning: unreachable code case c => println("matched c") ^ -newpat_unreachable.scala:22: warning: patterns after a variable pattern cannot match (SLS 8.1.1) +newpat_unreachable.scala:23: warning: patterns after a variable pattern cannot match (SLS 8.1.1) If you intended to match against parameter b of method g, you must use backticks, like: case `b` => case b => 1 ^ -newpat_unreachable.scala:23: warning: unreachable code due to variable pattern 'b' on line 22 +newpat_unreachable.scala:24: warning: unreachable code due to variable pattern 'b' on line 23 If you intended to match against parameter c of method h, you must use backticks, like: case `c` => case c => 2 ^ -newpat_unreachable.scala:24: warning: unreachable code due to variable pattern 'b' on line 22 +newpat_unreachable.scala:25: warning: unreachable code due to variable pattern 'b' on line 23 case _ => 3 ^ -newpat_unreachable.scala:23: warning: unreachable code +newpat_unreachable.scala:24: warning: unreachable code case c => 2 ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/newpat_unreachable.flags b/test/files/neg/newpat_unreachable.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/newpat_unreachable.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/newpat_unreachable.scala b/test/files/neg/newpat_unreachable.scala index c9cc85cec69d..bf3436dbf6dd 100644 --- a/test/files/neg/newpat_unreachable.scala +++ b/test/files/neg/newpat_unreachable.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { class A { val d = 55 diff --git a/test/files/neg/no-predef.check b/test/files/neg/no-predef.check index f5c2e82fe113..154cdc6a07c6 100644 --- a/test/files/neg/no-predef.check +++ b/test/files/neg/no-predef.check @@ -1,14 +1,14 @@ -no-predef.scala:2: error: type mismatch; +no-predef.scala:3: error: type mismatch; found : Long (in scala) required: Long (in java.lang) def f1 = 5L: java.lang.Long ^ -no-predef.scala:3: error: type mismatch; +no-predef.scala:4: error: type mismatch; found : Long (in java.lang) required: Long (in scala) def f2 = new java.lang.Long(5) : Long ^ -no-predef.scala:4: error: value map is not a member of String +no-predef.scala:5: error: value map is not a member of String def f3 = "abc" map (_ + 1) ^ three errors found diff --git a/test/files/neg/no-predef.flags b/test/files/neg/no-predef.flags deleted file mode 100644 index 3abc2d521517..000000000000 --- a/test/files/neg/no-predef.flags +++ /dev/null @@ -1 +0,0 @@ --Yno-predef \ No newline at end of file diff --git a/test/files/neg/no-predef.scala b/test/files/neg/no-predef.scala index 8466c7909fed..1c1c99988ee8 100644 --- a/test/files/neg/no-predef.scala +++ b/test/files/neg/no-predef.scala @@ -1,5 +1,6 @@ +// scalac: -Yno-predef class NoPredef { def f1 = 5L: java.lang.Long def f2 = new java.lang.Long(5) : Long def f3 = "abc" map (_ + 1) -} \ No newline at end of file +} diff --git a/test/files/neg/nonlocal-warning.check b/test/files/neg/nonlocal-warning.check index 5202df655a2a..6de59ca84e7b 100644 --- a/test/files/neg/nonlocal-warning.check +++ b/test/files/neg/nonlocal-warning.check @@ -1,7 +1,7 @@ -nonlocal-warning.scala:4: warning: This catches all Throwables. If this is really intended, use `case x : Throwable` to clear this warning. +nonlocal-warning.scala:5: warning: This catches all Throwables. If this is really intended, use `case x : Throwable` to clear this warning. catch { case x => 11 } ^ -nonlocal-warning.scala:2: warning: catch block may intercept non-local return from method foo +nonlocal-warning.scala:3: warning: catch block may intercept non-local return from method foo def foo(l: List[Int]): Int = { ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/nonlocal-warning.flags b/test/files/neg/nonlocal-warning.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/nonlocal-warning.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/nonlocal-warning.scala b/test/files/neg/nonlocal-warning.scala index f908a863029d..29cbac9edd41 100644 --- a/test/files/neg/nonlocal-warning.scala +++ b/test/files/neg/nonlocal-warning.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class Foo { def foo(l: List[Int]): Int = { try l foreach { _ => return 5 } diff --git a/test/files/neg/nonsense_eq_refine.check b/test/files/neg/nonsense_eq_refine.check index 41c469e5ee48..756d926cbdc8 100644 --- a/test/files/neg/nonsense_eq_refine.check +++ b/test/files/neg/nonsense_eq_refine.check @@ -1,7 +1,7 @@ -nonsense_eq_refine.scala:6: warning: E and String are unrelated: they will most likely never compare equal +nonsense_eq_refine.scala:7: warning: E and String are unrelated: they will most likely never compare equal if (e == "") ??? // warn about comparing unrelated types ^ -nonsense_eq_refine.scala:9: warning: SE and String are unrelated: they will most likely never compare equal +nonsense_eq_refine.scala:10: warning: SE and String are unrelated: they will most likely never compare equal if (se == "") ??? // types are still unrelated ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/nonsense_eq_refine.flags b/test/files/neg/nonsense_eq_refine.flags deleted file mode 100644 index 65faf53579c2..000000000000 --- a/test/files/neg/nonsense_eq_refine.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -deprecation \ No newline at end of file diff --git a/test/files/neg/nonsense_eq_refine.scala b/test/files/neg/nonsense_eq_refine.scala index d74c2bbbe15c..3e0a64e5bb64 100644 --- a/test/files/neg/nonsense_eq_refine.scala +++ b/test/files/neg/nonsense_eq_refine.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -deprecation class E class SE extends Serializable diff --git a/test/files/neg/nullary-override.check b/test/files/neg/nullary-override.check index f032f4a6c22b..21115d7fa508 100644 --- a/test/files/neg/nullary-override.check +++ b/test/files/neg/nullary-override.check @@ -1,4 +1,4 @@ -nullary-override.scala:2: warning: non-nullary method overrides nullary method +nullary-override.scala:3: warning: non-nullary method overrides nullary method class B extends A { override def x(): Int = 4 } ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/nullary-override.flags b/test/files/neg/nullary-override.flags deleted file mode 100644 index 6c1dd108aea5..000000000000 --- a/test/files/neg/nullary-override.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xlint \ No newline at end of file diff --git a/test/files/neg/nullary-override.scala b/test/files/neg/nullary-override.scala index 3eb4784a0cff..2343dbbab7a5 100644 --- a/test/files/neg/nullary-override.scala +++ b/test/files/neg/nullary-override.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint class A { def x: Int = 3 } class B extends A { override def x(): Int = 4 } diff --git a/test/files/neg/optimiseDeprecated.flags b/test/files/neg/optimiseDeprecated.flags deleted file mode 100644 index 42fca6d83658..000000000000 --- a/test/files/neg/optimiseDeprecated.flags +++ /dev/null @@ -1 +0,0 @@ --optimise -deprecation -Xfatal-warnings diff --git a/test/files/neg/optimiseDeprecated.scala b/test/files/neg/optimiseDeprecated.scala index 826a1a5bc2ed..3fd4e2748407 100644 --- a/test/files/neg/optimiseDeprecated.scala +++ b/test/files/neg/optimiseDeprecated.scala @@ -1 +1,2 @@ +// scalac: -optimise -deprecation -Xfatal-warnings class C diff --git a/test/files/neg/outer-ref-checks.check b/test/files/neg/outer-ref-checks.check index bba7118d79ba..840fb81afe58 100644 --- a/test/files/neg/outer-ref-checks.check +++ b/test/files/neg/outer-ref-checks.check @@ -1,22 +1,22 @@ -outer-ref-checks.scala:5: warning: The outer reference in this type test cannot be checked at run time. +outer-ref-checks.scala:6: warning: The outer reference in this type test cannot be checked at run time. final case class Inner(val s: String) // unchecked warning ^ -outer-ref-checks.scala:8: warning: The outer reference in this type test cannot be checked at run time. +outer-ref-checks.scala:9: warning: The outer reference in this type test cannot be checked at run time. case Inner(s) => // unchecked warning ^ -outer-ref-checks.scala:18: warning: The outer reference in this type test cannot be checked at run time. +outer-ref-checks.scala:19: warning: The outer reference in this type test cannot be checked at run time. case Inner(s) => // unchecked warning ^ -outer-ref-checks.scala:19: warning: The outer reference in this type test cannot be checked at run time. +outer-ref-checks.scala:20: warning: The outer reference in this type test cannot be checked at run time. case O.Inner(s) => // unchecked warning ^ -outer-ref-checks.scala:41: warning: The outer reference in this type test cannot be checked at run time. +outer-ref-checks.scala:42: warning: The outer reference in this type test cannot be checked at run time. case Inner(s) => // unchecked warning ^ -outer-ref-checks.scala:46: warning: The outer reference in this type test cannot be checked at run time. +outer-ref-checks.scala:47: warning: The outer reference in this type test cannot be checked at run time. case _: Inner => // unchecked warning ^ -outer-ref-checks.scala:56: warning: The outer reference in this type test cannot be checked at run time. +outer-ref-checks.scala:57: warning: The outer reference in this type test cannot be checked at run time. case _: (Inner @uncheckedVariance) => // unchecked warning ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/outer-ref-checks.flags b/test/files/neg/outer-ref-checks.flags deleted file mode 100644 index 464cc20ea684..000000000000 --- a/test/files/neg/outer-ref-checks.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -unchecked \ No newline at end of file diff --git a/test/files/neg/outer-ref-checks.scala b/test/files/neg/outer-ref-checks.scala index 35983fe92b62..7e8d23d17035 100644 --- a/test/files/neg/outer-ref-checks.scala +++ b/test/files/neg/outer-ref-checks.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -unchecked import scala.annotation.unchecked.uncheckedVariance class Outer { diff --git a/test/files/neg/overloaded-implicit.check b/test/files/neg/overloaded-implicit.check index 0e6617d90433..5258f79f91ed 100644 --- a/test/files/neg/overloaded-implicit.check +++ b/test/files/neg/overloaded-implicit.check @@ -1,7 +1,7 @@ -overloaded-implicit.scala:2: warning: parameterized overloaded implicit methods are not visible as view bounds +overloaded-implicit.scala:3: warning: parameterized overloaded implicit methods are not visible as view bounds implicit def imp1[T](x: List[T]): Map[T, T] = Map() ^ -overloaded-implicit.scala:3: warning: parameterized overloaded implicit methods are not visible as view bounds +overloaded-implicit.scala:4: warning: parameterized overloaded implicit methods are not visible as view bounds implicit def imp1[T](x: Set[T]): Map[T, T] = Map() ^ warning: there were four feature warnings; re-run with -feature for details diff --git a/test/files/neg/overloaded-implicit.flags b/test/files/neg/overloaded-implicit.flags deleted file mode 100644 index e04a4228ba50..000000000000 --- a/test/files/neg/overloaded-implicit.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint:poly-implicit-overload -Xfatal-warnings -Xdev diff --git a/test/files/neg/overloaded-implicit.scala b/test/files/neg/overloaded-implicit.scala index 68b1ceaa30b7..9eebae35a98e 100644 --- a/test/files/neg/overloaded-implicit.scala +++ b/test/files/neg/overloaded-implicit.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint:poly-implicit-overload -Xfatal-warnings -Xdev object Test { implicit def imp1[T](x: List[T]): Map[T, T] = Map() implicit def imp1[T](x: Set[T]): Map[T, T] = Map() diff --git a/test/files/neg/override-object-no.check b/test/files/neg/override-object-no.check index 1669a6dc7fcc..598ca8a7365f 100644 --- a/test/files/neg/override-object-no.check +++ b/test/files/neg/override-object-no.check @@ -1,30 +1,30 @@ -override-object-no.scala:14: error: overriding object Bar in trait Foo with object Bar in trait Foo2: +override-object-no.scala:15: error: overriding object Bar in trait Foo with object Bar in trait Foo2: an overriding object must conform to the overridden object's class bound; found : case1.Bippy required: case1.Bippy with case1.Bippo override object Bar extends Bippy { // err ^ -override-object-no.scala:21: error: overriding object Bar in trait Quux1 with object Bar in trait Quux2: +override-object-no.scala:22: error: overriding object Bar in trait Quux1 with object Bar in trait Quux2: an overriding object must conform to the overridden object's class bound; found : AnyRef{def g: String} required: AnyRef{def g: Int} trait Quux2 extends Quux1 { override object Bar { def g = "abc" } } // err ^ -override-object-no.scala:25: error: overriding object Bar in trait Quux3; +override-object-no.scala:26: error: overriding object Bar in trait Quux3; object Bar cannot override final member trait Quux4 extends Quux3 { override object Bar } // err ^ -override-object-no.scala:43: error: overriding object A in class Foo with object A in class P2: +override-object-no.scala:44: error: overriding object A in class Foo with object A in class P2: an overriding object must conform to the overridden object's class bound; found : case2.Bar[List[String]] required: case2.Bar[Traversable[String]] override object A extends Bar[List[String]] // err ^ -override-object-no.scala:52: error: overriding method x in trait A of type => SI9574.Foo.type; +override-object-no.scala:53: error: overriding method x in trait A of type => SI9574.Foo.type; method x has incompatible type trait B extends A { def x: Bar.type } // should not compile (scala/bug#9574) ^ -override-object-no.scala:53: error: overriding method x in trait A of type => SI9574.Foo.type; +override-object-no.scala:54: error: overriding method x in trait A of type => SI9574.Foo.type; object x has incompatible type trait C extends A { override object x } ^ diff --git a/test/files/neg/override-object-no.flags b/test/files/neg/override-object-no.flags deleted file mode 100644 index 22e9a95c4ff7..000000000000 --- a/test/files/neg/override-object-no.flags +++ /dev/null @@ -1 +0,0 @@ --Yoverride-objects \ No newline at end of file diff --git a/test/files/neg/override-object-no.scala b/test/files/neg/override-object-no.scala index 1359d8185ac0..8c3bf2e94bfa 100644 --- a/test/files/neg/override-object-no.scala +++ b/test/files/neg/override-object-no.scala @@ -1,3 +1,4 @@ +// scalac: -Yoverride-objects // See also pos/override-object-yes.scala package case1 { diff --git a/test/files/neg/partestInvalidFlag.flags b/test/files/neg/partestInvalidFlag.flags deleted file mode 100644 index d45fd3180904..000000000000 --- a/test/files/neg/partestInvalidFlag.flags +++ /dev/null @@ -1 +0,0 @@ --badCompilerFlag notAFlag -opt:badChoice diff --git a/test/files/neg/partestInvalidFlag.scala b/test/files/neg/partestInvalidFlag.scala index 826a1a5bc2ed..7ea96993279e 100644 --- a/test/files/neg/partestInvalidFlag.scala +++ b/test/files/neg/partestInvalidFlag.scala @@ -1 +1,2 @@ +// scalac: -badCompilerFlag notAFlag -opt:badChoice class C diff --git a/test/files/neg/pat_unreachable.check b/test/files/neg/pat_unreachable.check index 374ee4e9cf7e..4b01437ff809 100644 --- a/test/files/neg/pat_unreachable.check +++ b/test/files/neg/pat_unreachable.check @@ -1,15 +1,15 @@ -pat_unreachable.scala:22: warning: patterns after a variable pattern cannot match (SLS 8.1.1) +pat_unreachable.scala:23: warning: patterns after a variable pattern cannot match (SLS 8.1.1) If you intended to match against parameter b of method contrivedExample, you must use backticks, like: case `b` => case b => println("matched b") ^ -pat_unreachable.scala:23: warning: unreachable code due to variable pattern 'b' on line 22 +pat_unreachable.scala:24: warning: unreachable code due to variable pattern 'b' on line 23 If you intended to match against parameter c of method contrivedExample, you must use backticks, like: case `c` => case c => println("matched c") ^ -pat_unreachable.scala:24: warning: unreachable code due to variable pattern 'b' on line 22 +pat_unreachable.scala:25: warning: unreachable code due to variable pattern 'b' on line 23 case _ => println("matched neither") ^ -pat_unreachable.scala:23: warning: unreachable code +pat_unreachable.scala:24: warning: unreachable code case c => println("matched c") ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/pat_unreachable.flags b/test/files/neg/pat_unreachable.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/pat_unreachable.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/pat_unreachable.scala b/test/files/neg/pat_unreachable.scala index 1f402e5212df..c7dc6bd0ed6c 100644 --- a/test/files/neg/pat_unreachable.scala +++ b/test/files/neg/pat_unreachable.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test extends App { def unreachable1(xs:Seq[Char]) = xs match { diff --git a/test/files/neg/patmat-classtag-compound.check b/test/files/neg/patmat-classtag-compound.check index 8a54c935bd76..f64e1b958d5b 100644 --- a/test/files/neg/patmat-classtag-compound.check +++ b/test/files/neg/patmat-classtag-compound.check @@ -1,4 +1,4 @@ -patmat-classtag-compound.scala:12: warning: abstract type pattern A is unchecked since it is eliminated by erasure +patmat-classtag-compound.scala:13: warning: abstract type pattern A is unchecked since it is eliminated by erasure case b: A with Bar => true ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/patmat-classtag-compound.flags b/test/files/neg/patmat-classtag-compound.flags deleted file mode 100644 index 144ddac9d3d8..000000000000 --- a/test/files/neg/patmat-classtag-compound.flags +++ /dev/null @@ -1 +0,0 @@ --unchecked -Xfatal-warnings diff --git a/test/files/neg/patmat-classtag-compound.scala b/test/files/neg/patmat-classtag-compound.scala index e2d0df0a02ed..bd47c04d182f 100644 --- a/test/files/neg/patmat-classtag-compound.scala +++ b/test/files/neg/patmat-classtag-compound.scala @@ -1,3 +1,4 @@ +// scalac: -unchecked -Xfatal-warnings object Test extends App{ trait Bar trait Foo diff --git a/test/files/neg/patmatexhaust.check b/test/files/neg/patmatexhaust.check index bbf5e9b5286c..9f1331cafee2 100644 --- a/test/files/neg/patmatexhaust.check +++ b/test/files/neg/patmatexhaust.check @@ -1,39 +1,39 @@ -patmatexhaust.scala:7: warning: match may not be exhaustive. +patmatexhaust.scala:8: warning: match may not be exhaustive. It would fail on the following input: Baz def ma1(x:Foo) = x match { ^ -patmatexhaust.scala:11: warning: match may not be exhaustive. +patmatexhaust.scala:12: warning: match may not be exhaustive. It would fail on the following input: Bar(_) def ma2(x:Foo) = x match { ^ -patmatexhaust.scala:23: warning: match may not be exhaustive. +patmatexhaust.scala:24: warning: match may not be exhaustive. It would fail on the following inputs: (Kult(_), Kult(_)), (Qult(), Qult()) def ma3(x:Mult) = (x,x) match { // not exhaustive ^ -patmatexhaust.scala:49: warning: match may not be exhaustive. +patmatexhaust.scala:50: warning: match may not be exhaustive. It would fail on the following inputs: Gp(), Gu def ma4(x:Deep) = x match { // missing cases: Gu, Gp which is not abstract so must be included ^ -patmatexhaust.scala:55: warning: unreachable code +patmatexhaust.scala:56: warning: unreachable code case _ if 1 == 0 => ^ -patmatexhaust.scala:53: warning: match may not be exhaustive. +patmatexhaust.scala:54: warning: match may not be exhaustive. It would fail on the following input: Gp() def ma5(x:Deep) = x match { ^ -patmatexhaust.scala:75: warning: match may not be exhaustive. +patmatexhaust.scala:76: warning: match may not be exhaustive. It would fail on the following input: B() def ma9(x: B) = x match { ^ -patmatexhaust.scala:100: warning: match may not be exhaustive. +patmatexhaust.scala:101: warning: match may not be exhaustive. It would fail on the following input: C1() def ma10(x: C) = x match { // not exhaustive: C1 is not sealed. ^ -patmatexhaust.scala:114: warning: match may not be exhaustive. +patmatexhaust.scala:115: warning: match may not be exhaustive. It would fail on the following inputs: D1, D2() def ma10(x: C) = x match { // not exhaustive: C1 has subclasses. ^ -patmatexhaust.scala:126: warning: match may not be exhaustive. +patmatexhaust.scala:127: warning: match may not be exhaustive. It would fail on the following input: C1() def ma10(x: C) = x match { // not exhaustive: C1 is not abstract. ^ diff --git a/test/files/neg/patmatexhaust.flags b/test/files/neg/patmatexhaust.flags deleted file mode 100644 index 3b01ca062c63..000000000000 --- a/test/files/neg/patmatexhaust.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Ypatmat-exhaust-depth off \ No newline at end of file diff --git a/test/files/neg/patmatexhaust.scala b/test/files/neg/patmatexhaust.scala index 26f0c12a919c..d0344b83be82 100644 --- a/test/files/neg/patmatexhaust.scala +++ b/test/files/neg/patmatexhaust.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ypatmat-exhaust-depth off class TestSealedExhaustive { // compile only sealed abstract class Foo diff --git a/test/files/neg/permanent-blindness.check b/test/files/neg/permanent-blindness.check index cdde201ef642..2fc66d54c70a 100644 --- a/test/files/neg/permanent-blindness.check +++ b/test/files/neg/permanent-blindness.check @@ -1,10 +1,10 @@ -permanent-blindness.scala:10: warning: imported `Bippy' is permanently hidden by definition of class Bippy in package bar +permanent-blindness.scala:11: warning: imported `Bippy' is permanently hidden by definition of class Bippy in package bar import foo.{ Bippy, Bop, Dingus } ^ -permanent-blindness.scala:10: warning: imported `Bop' is permanently hidden by definition of object Bop in package bar +permanent-blindness.scala:11: warning: imported `Bop' is permanently hidden by definition of object Bop in package bar import foo.{ Bippy, Bop, Dingus } ^ -permanent-blindness.scala:10: warning: imported `Dingus' is permanently hidden by definition of object Dingus in package bar +permanent-blindness.scala:11: warning: imported `Dingus' is permanently hidden by definition of object Dingus in package bar import foo.{ Bippy, Bop, Dingus } ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/permanent-blindness.flags b/test/files/neg/permanent-blindness.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/permanent-blindness.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/permanent-blindness.scala b/test/files/neg/permanent-blindness.scala index b6d09d6dce00..c430b31eab57 100644 --- a/test/files/neg/permanent-blindness.scala +++ b/test/files/neg/permanent-blindness.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings package foo { class Bippy object Bop { @@ -19,4 +20,4 @@ package bar { def g = new Bippy } -} \ No newline at end of file +} diff --git a/test/files/neg/pickle-java-crash.flags b/test/files/neg/pickle-java-crash.flags deleted file mode 100644 index 1ccd397fa0fe..000000000000 --- a/test/files/neg/pickle-java-crash.flags +++ /dev/null @@ -1 +0,0 @@ --Ypickle-java \ No newline at end of file diff --git a/test/files/neg/pickle-java-crash/Brash.scala b/test/files/neg/pickle-java-crash/Brash.scala index 3f6bb5b6f5a6..d523655715c3 100644 --- a/test/files/neg/pickle-java-crash/Brash.scala +++ b/test/files/neg/pickle-java-crash/Brash.scala @@ -1,3 +1,4 @@ +// scalac: -Ypickle-java package crashy -object brash \ No newline at end of file +object brash diff --git a/test/files/neg/run-gadts-strict.check b/test/files/neg/run-gadts-strict.check index b4d36c462990..bad78547a6ff 100644 --- a/test/files/neg/run-gadts-strict.check +++ b/test/files/neg/run-gadts-strict.check @@ -1,19 +1,19 @@ -run-gadts-strict.scala:12: error: type mismatch; +run-gadts-strict.scala:13: error: type mismatch; found : n.type (with underlying type Int) required: T case Lit(n) => n ^ -run-gadts-strict.scala:13: error: type mismatch; +run-gadts-strict.scala:14: error: type mismatch; found : Int required: T case Succ(u) => eval(u) + 1 ^ -run-gadts-strict.scala:14: error: type mismatch; +run-gadts-strict.scala:15: error: type mismatch; found : Boolean required: T case IsZero(u) => eval(u) == 0 ^ -run-gadts-strict.scala:15: error: type mismatch; +run-gadts-strict.scala:16: error: type mismatch; found : T(in class If) required: T(in method eval) case If(c, u1, u2) => eval(if (eval(c)) u1 else u2) diff --git a/test/files/neg/run-gadts-strict.flags b/test/files/neg/run-gadts-strict.flags deleted file mode 100644 index 19243266d108..000000000000 --- a/test/files/neg/run-gadts-strict.flags +++ /dev/null @@ -1 +0,0 @@ --Xstrict-inference \ No newline at end of file diff --git a/test/files/neg/run-gadts-strict.scala b/test/files/neg/run-gadts-strict.scala index 041d10d4bd30..4fc65bf8f075 100644 --- a/test/files/neg/run-gadts-strict.scala +++ b/test/files/neg/run-gadts-strict.scala @@ -1,3 +1,4 @@ +// scalac: -Xstrict-inference // A copy of run/gadts.scala, which must fail under -Xstrict-inference. abstract class Term[T] case class Lit(x: Int) extends Term[Int] diff --git a/test/files/neg/sammy_disabled.check b/test/files/neg/sammy_disabled.check index 66db9dd5f2ef..e8792e9e30f6 100644 --- a/test/files/neg/sammy_disabled.check +++ b/test/files/neg/sammy_disabled.check @@ -1,4 +1,4 @@ -sammy_disabled.scala:3: error: missing parameter type +sammy_disabled.scala:4: error: missing parameter type class C { val f: F = x => "a" } ^ one error found diff --git a/test/files/neg/sammy_disabled.flags b/test/files/neg/sammy_disabled.flags deleted file mode 100644 index cf42e9f94098..000000000000 --- a/test/files/neg/sammy_disabled.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.11 diff --git a/test/files/neg/sammy_disabled.scala b/test/files/neg/sammy_disabled.scala index 12000a3e12c6..fc97a6b2d700 100644 --- a/test/files/neg/sammy_disabled.scala +++ b/test/files/neg/sammy_disabled.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.11 trait F { def apply(x: Int): String } class C { val f: F = x => "a" } diff --git a/test/files/neg/sealed-final-neg.check b/test/files/neg/sealed-final-neg.check index 5e47c69ed8ca..c2291da6bc8c 100644 --- a/test/files/neg/sealed-final-neg.check +++ b/test/files/neg/sealed-final-neg.check @@ -1,8 +1,8 @@ -sealed-final-neg.scala:17: warning: neg1/Foo::bar(I)I is annotated @inline but could not be inlined: +sealed-final-neg.scala:18: warning: neg1/Foo::bar(I)I is annotated @inline but could not be inlined: The method is not final and may be overridden. def f = Foo.mkFoo() bar 10 ^ -sealed-final-neg.scala:37: warning: neg2/Foo::bar(I)I is annotated @inline but could not be inlined: +sealed-final-neg.scala:38: warning: neg2/Foo::bar(I)I is annotated @inline but could not be inlined: The method is not final and may be overridden. def f = Foo.mkFoo() bar 10 ^ diff --git a/test/files/neg/sealed-final-neg.flags b/test/files/neg/sealed-final-neg.flags deleted file mode 100644 index b5c87a0b2fd3..000000000000 --- a/test/files/neg/sealed-final-neg.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -opt:l:inline -opt-inline-from:** -opt-warnings \ No newline at end of file diff --git a/test/files/neg/sealed-final-neg.scala b/test/files/neg/sealed-final-neg.scala index ec3b1998198b..05f9b4e6de88 100644 --- a/test/files/neg/sealed-final-neg.scala +++ b/test/files/neg/sealed-final-neg.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -opt:l:inline -opt-inline-from:** -opt-warnings package neg1 { sealed abstract class Foo { @inline def bar(x: Int) = x + 1 diff --git a/test/files/neg/sealed-java-enums.check b/test/files/neg/sealed-java-enums.check index a3c39ec5cdac..4c8670665402 100644 --- a/test/files/neg/sealed-java-enums.check +++ b/test/files/neg/sealed-java-enums.check @@ -1,4 +1,4 @@ -sealed-java-enums.scala:5: warning: match may not be exhaustive. +sealed-java-enums.scala:6: warning: match may not be exhaustive. It would fail on the following inputs: BLOCKED, TERMINATED, TIMED_WAITING def f(state: State) = state match { ^ diff --git a/test/files/neg/sealed-java-enums.flags b/test/files/neg/sealed-java-enums.flags deleted file mode 100644 index e709c6591866..000000000000 --- a/test/files/neg/sealed-java-enums.flags +++ /dev/null @@ -1 +0,0 @@ --Xexperimental -Xfatal-warnings diff --git a/test/files/neg/sealed-java-enums.scala b/test/files/neg/sealed-java-enums.scala index 2daf93f3088d..e07a465f0064 100644 --- a/test/files/neg/sealed-java-enums.scala +++ b/test/files/neg/sealed-java-enums.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental -Xfatal-warnings import java.lang.Thread.State import java.lang.Thread.State._ diff --git a/test/files/neg/stmt-expr-discard.check b/test/files/neg/stmt-expr-discard.check index 25db4a7efa71..020f7efedd4f 100644 --- a/test/files/neg/stmt-expr-discard.check +++ b/test/files/neg/stmt-expr-discard.check @@ -1,7 +1,7 @@ -stmt-expr-discard.scala:3: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses +stmt-expr-discard.scala:4: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses + 2 ^ -stmt-expr-discard.scala:4: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses +stmt-expr-discard.scala:5: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses - 4 ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/stmt-expr-discard.flags b/test/files/neg/stmt-expr-discard.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/stmt-expr-discard.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/stmt-expr-discard.scala b/test/files/neg/stmt-expr-discard.scala index e60c8546259c..9fb997819718 100644 --- a/test/files/neg/stmt-expr-discard.scala +++ b/test/files/neg/stmt-expr-discard.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class A { def f = 1 + 2 diff --git a/test/files/neg/switch.check b/test/files/neg/switch.check index f968d3a4485f..6ed54ca70103 100644 --- a/test/files/neg/switch.check +++ b/test/files/neg/switch.check @@ -1,7 +1,7 @@ -switch.scala:38: warning: could not emit switch for @switch annotated match +switch.scala:39: warning: could not emit switch for @switch annotated match def fail2(c: Char) = (c: @switch @unchecked) match { ^ -switch.scala:45: warning: could not emit switch for @switch annotated match +switch.scala:46: warning: could not emit switch for @switch annotated match def fail3(c: Char) = (c: @unchecked @switch) match { ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/switch.flags b/test/files/neg/switch.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/switch.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/switch.scala b/test/files/neg/switch.scala index ceb32190745f..7968156b99dc 100644 --- a/test/files/neg/switch.scala +++ b/test/files/neg/switch.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings import scala.annotation.switch // this is testing not so much how things ought to be but how they are; diff --git a/test/files/neg/t0903.check b/test/files/neg/t0903.check index f9dc28bf161f..b8ca1f4acecb 100644 --- a/test/files/neg/t0903.check +++ b/test/files/neg/t0903.check @@ -1,8 +1,8 @@ -t0903.scala:3: error: value += is not a member of Int +t0903.scala:4: error: value += is not a member of Int Expression does not convert to assignment because receiver is not assignable. x += 1 ^ -t0903.scala:4: error: reassignment to val +t0903.scala:5: error: reassignment to val x = 2 ^ two errors found diff --git a/test/files/neg/t0903.flags b/test/files/neg/t0903.flags deleted file mode 100644 index fcf951d90723..000000000000 --- a/test/files/neg/t0903.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos \ No newline at end of file diff --git a/test/files/neg/t0903.scala b/test/files/neg/t0903.scala index cf8abce97a92..798c924f288f 100644 --- a/test/files/neg/t0903.scala +++ b/test/files/neg/t0903.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos object Test { val x = 1 x += 1 diff --git a/test/files/neg/t10019.check b/test/files/neg/t10019.check index 9b861e903be1..36314625bf80 100644 --- a/test/files/neg/t10019.check +++ b/test/files/neg/t10019.check @@ -1,8 +1,8 @@ -t10019.scala:4: warning: match may not be exhaustive. +t10019.scala:5: warning: match may not be exhaustive. It would fail on the following input: Foo(None) def single(t: Foo): Nothing = t match { ^ -t10019.scala:8: warning: match may not be exhaustive. +t10019.scala:9: warning: match may not be exhaustive. It would fail on the following input: (Foo(None), _) def tuple(s: Foo, t: Foo): Nothing = (s, t) match { ^ diff --git a/test/files/neg/t10019.flags b/test/files/neg/t10019.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t10019.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t10019.scala b/test/files/neg/t10019.scala index 04cd95035f66..1730b0d84db9 100644 --- a/test/files/neg/t10019.scala +++ b/test/files/neg/t10019.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Bug { sealed case class Foo(e: Option[Int]) diff --git a/test/files/neg/t10068.check b/test/files/neg/t10068.check index 2bb27c4fd873..19c9a47b9478 100644 --- a/test/files/neg/t10068.check +++ b/test/files/neg/t10068.check @@ -1,13 +1,13 @@ -t10068.scala:5: error: i : Only methods can be marked @elidable. +t10068.scala:6: error: i : Only methods can be marked @elidable. @elidable(INFO) val i: Int = 42 ^ -t10068.scala:6: error: j: Only methods can be marked @elidable. +t10068.scala:7: error: j: Only methods can be marked @elidable. @elidable(INFO) lazy val j: Int = 42 ^ -t10068.scala:7: error: k : Only methods can be marked @elidable. +t10068.scala:8: error: k : Only methods can be marked @elidable. @elidable(INFO) var k: Int = 42 ^ -t10068.scala:9: error: D: Only methods can be marked @elidable. +t10068.scala:10: error: D: Only methods can be marked @elidable. @elidable(INFO) class D ^ four errors found diff --git a/test/files/neg/t10068.flags b/test/files/neg/t10068.flags deleted file mode 100644 index 2b1879546851..000000000000 --- a/test/files/neg/t10068.flags +++ /dev/null @@ -1 +0,0 @@ --Xelide-below WARNING -Xsource:2.13 diff --git a/test/files/neg/t10068.scala b/test/files/neg/t10068.scala index a45ee5dac44d..30f193802311 100644 --- a/test/files/neg/t10068.scala +++ b/test/files/neg/t10068.scala @@ -1,3 +1,4 @@ +// scalac: -Xelide-below WARNING -Xsource:2.13 import annotation._, elidable._ diff --git a/test/files/neg/t10097.check b/test/files/neg/t10097.check index 89f1493adf5e..504288148537 100644 --- a/test/files/neg/t10097.check +++ b/test/files/neg/t10097.check @@ -1,19 +1,19 @@ -t10097.scala:2: error: case classes must have a non-implicit parameter list; try 'case class C()(...)' +t10097.scala:3: error: case classes must have a non-implicit parameter list; try 'case class C()(...)' case class C(implicit val c: Int) ^ -t10097.scala:4: error: case classes must have a non-implicit parameter list; try 'case class D()(...)(...)' +t10097.scala:5: error: case classes must have a non-implicit parameter list; try 'case class D()(...)(...)' case class D(implicit c: Int)(s: String) ^ -t10097.scala:4: error: an implicit parameter section must be last +t10097.scala:5: error: an implicit parameter section must be last case class D(implicit c: Int)(s: String) ^ -t10097.scala:6: error: case classes must have a non-implicit parameter list; try 'case class *()(...)' +t10097.scala:7: error: case classes must have a non-implicit parameter list; try 'case class *()(...)' case class *(implicit c: Int) ^ -t10097.scala:9: error: identifier expected but 'import' found. +t10097.scala:10: error: identifier expected but 'import' found. import collection._ ^ -t10097.scala:9: error: case classes must have a parameter list; try 'case class C()' or 'case object C' +t10097.scala:10: error: case classes must have a parameter list; try 'case class C()' or 'case object C' import collection._ ^ 6 errors found diff --git a/test/files/neg/t10097.flags b/test/files/neg/t10097.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/neg/t10097.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/neg/t10097.scala b/test/files/neg/t10097.scala index 4c14f420ac4f..723f3de94338 100644 --- a/test/files/neg/t10097.scala +++ b/test/files/neg/t10097.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 case class C(implicit val c: Int) diff --git a/test/files/neg/t10097b.check b/test/files/neg/t10097b.check index 14535fee343c..9dd35d01cfdb 100644 --- a/test/files/neg/t10097b.check +++ b/test/files/neg/t10097b.check @@ -1,4 +1,4 @@ -t10097b.scala:2: warning: case classes should have a non-implicit parameter list; adapting to 'case class C()(...)' +t10097b.scala:3: warning: case classes should have a non-implicit parameter list; adapting to 'case class C()(...)' case class C(implicit val c: Int) ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t10097b.flags b/test/files/neg/t10097b.flags deleted file mode 100644 index c6bfaf1f64a4..000000000000 --- a/test/files/neg/t10097b.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings diff --git a/test/files/neg/t10097b.scala b/test/files/neg/t10097b.scala index f166db6792e3..f453f8b682ec 100644 --- a/test/files/neg/t10097b.scala +++ b/test/files/neg/t10097b.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings case class C(implicit val c: Int) diff --git a/test/files/neg/t10270.check b/test/files/neg/t10270.check index be7da7475698..bbab20ee8177 100644 --- a/test/files/neg/t10270.check +++ b/test/files/neg/t10270.check @@ -1,4 +1,4 @@ -Main_2.scala:5: warning: Unused import +Main_2.scala:6: warning: Unused import import Implicits._ ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t10270.flags b/test/files/neg/t10270.flags deleted file mode 100644 index c4e11e7fe70c..000000000000 --- a/test/files/neg/t10270.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Ywarn-unused:imports diff --git a/test/files/neg/t10270/Macros_1.scala b/test/files/neg/t10270/Macros_1.scala index 056995d2497a..0d9f51e2c260 100644 --- a/test/files/neg/t10270/Macros_1.scala +++ b/test/files/neg/t10270/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ywarn-unused:imports import language.experimental.macros import scala.reflect.macros.blackbox.Context diff --git a/test/files/neg/t10270/Main_2.scala b/test/files/neg/t10270/Main_2.scala index d43392701a20..6c8185e14a90 100644 --- a/test/files/neg/t10270/Main_2.scala +++ b/test/files/neg/t10270/Main_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ywarn-unused:imports object Main extends App { diff --git a/test/files/neg/t10296-after.check b/test/files/neg/t10296-after.check index 6faec910abbd..5003ec5a6ebe 100644 --- a/test/files/neg/t10296-after.check +++ b/test/files/neg/t10296-after.check @@ -1,4 +1,4 @@ -Unused_2.scala:7: warning: private method g in object Unused is never used +Unused_2.scala:8: warning: private method g in object Unused is never used private def g(): Int = 17 ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t10296-after.flags b/test/files/neg/t10296-after.flags deleted file mode 100644 index 84830317e3fc..000000000000 --- a/test/files/neg/t10296-after.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xlint:unused -Ywarn-macros:after diff --git a/test/files/neg/t10296-after/UnusedMacro_1.scala b/test/files/neg/t10296-after/UnusedMacro_1.scala index 9e042f803a86..3c2deb44021d 100644 --- a/test/files/neg/t10296-after/UnusedMacro_1.scala +++ b/test/files/neg/t10296-after/UnusedMacro_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:unused -Ywarn-macros:after import scala.reflect.macros.whitebox.Context diff --git a/test/files/neg/t10296-after/Unused_2.scala b/test/files/neg/t10296-after/Unused_2.scala index 56feb4a3740c..a4a170bbbf7d 100644 --- a/test/files/neg/t10296-after/Unused_2.scala +++ b/test/files/neg/t10296-after/Unused_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:unused -Ywarn-macros:after import scala.language.experimental.macros diff --git a/test/files/neg/t10296-both.check b/test/files/neg/t10296-both.check index 0c8364996ebb..64c62f910c8b 100644 --- a/test/files/neg/t10296-both.check +++ b/test/files/neg/t10296-both.check @@ -1,7 +1,7 @@ -Unused_2.scala:8: warning: private method k in object Unused is never used +Unused_2.scala:9: warning: private method k in object Unused is never used private def k(): Int = 17 ^ -Unused_2.scala:7: warning: private method g in object Unused is never used +Unused_2.scala:8: warning: private method g in object Unused is never used private def g(): Int = 17 ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t10296-both.flags b/test/files/neg/t10296-both.flags deleted file mode 100644 index 3b72954724c4..000000000000 --- a/test/files/neg/t10296-both.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xlint:unused -Ywarn-macros:both diff --git a/test/files/neg/t10296-both/UnusedMacro_1.scala b/test/files/neg/t10296-both/UnusedMacro_1.scala index b636ff0fc88a..41137609812c 100644 --- a/test/files/neg/t10296-both/UnusedMacro_1.scala +++ b/test/files/neg/t10296-both/UnusedMacro_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:unused -Ywarn-macros:both import scala.reflect.macros.whitebox.Context diff --git a/test/files/neg/t10296-both/Unused_2.scala b/test/files/neg/t10296-both/Unused_2.scala index b9cfe5f2e392..1e9369a8ffe4 100644 --- a/test/files/neg/t10296-both/Unused_2.scala +++ b/test/files/neg/t10296-both/Unused_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:unused -Ywarn-macros:both import scala.language.experimental.macros diff --git a/test/files/neg/t10296-warn.check b/test/files/neg/t10296-warn.check index b609c44d1be2..98680c24db70 100755 --- a/test/files/neg/t10296-warn.check +++ b/test/files/neg/t10296-warn.check @@ -1,4 +1,4 @@ -Unused_2.scala:9: warning: private method unusedMacro in object Unused is never used +Unused_2.scala:10: warning: private method unusedMacro in object Unused is never used private def unusedMacro(): Unit = macro UnusedMacro.usedMacroImpl ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t10296-warn.flags b/test/files/neg/t10296-warn.flags deleted file mode 100644 index ce85ee757bfa..000000000000 --- a/test/files/neg/t10296-warn.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xlint:unused diff --git a/test/files/neg/t10296-warn/UnusedMacro_1.scala b/test/files/neg/t10296-warn/UnusedMacro_1.scala index d3576ee731f0..f3b33c38d561 100644 --- a/test/files/neg/t10296-warn/UnusedMacro_1.scala +++ b/test/files/neg/t10296-warn/UnusedMacro_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:unused import scala.reflect.macros.blackbox diff --git a/test/files/neg/t10296-warn/Unused_2.scala b/test/files/neg/t10296-warn/Unused_2.scala index 382004f24dc9..e59f963138e4 100644 --- a/test/files/neg/t10296-warn/Unused_2.scala +++ b/test/files/neg/t10296-warn/Unused_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:unused import scala.language.experimental.macros diff --git a/test/files/neg/t10678.check b/test/files/neg/t10678.check index a5f3f473db35..09c1bafeac55 100644 --- a/test/files/neg/t10678.check +++ b/test/files/neg/t10678.check @@ -1,10 +1,10 @@ -t10678.scala:4: warning: Using `<:` for `extends` is deprecated +t10678.scala:5: warning: Using `<:` for `extends` is deprecated trait U <: T ^ -t10678.scala:6: error: ';' expected but '<:' found. +t10678.scala:7: error: ';' expected but '<:' found. class C <: T { ^ -t10678.scala:9: error: ';' expected but '<:' found. +t10678.scala:10: error: ';' expected but '<:' found. object O <: T { ^ one warning found diff --git a/test/files/neg/t10678.flags b/test/files/neg/t10678.flags deleted file mode 100644 index c6bfaf1f64a4..000000000000 --- a/test/files/neg/t10678.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings diff --git a/test/files/neg/t10678.scala b/test/files/neg/t10678.scala index 3c5ede025536..587fa3a3bc5b 100644 --- a/test/files/neg/t10678.scala +++ b/test/files/neg/t10678.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings trait T diff --git a/test/files/neg/t10752.check b/test/files/neg/t10752.check index 11c60bed1aff..3c3b180d3181 100644 --- a/test/files/neg/t10752.check +++ b/test/files/neg/t10752.check @@ -1,7 +1,7 @@ -Test_2.scala:2: warning: class DeprecatedClass in package p1 is deprecated +Test_2.scala:3: warning: class DeprecatedClass in package p1 is deprecated def useC = p1.DeprecatedClass.foo ^ -Test_2.scala:3: warning: method foo in class DeprecatedMethod is deprecated +Test_2.scala:4: warning: method foo in class DeprecatedMethod is deprecated def useM = p1.DeprecatedMethod.foo ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t10752/Test_2.flags b/test/files/neg/t10752/Test_2.flags deleted file mode 100644 index 7de3c0f3eea0..000000000000 --- a/test/files/neg/t10752/Test_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -deprecation diff --git a/test/files/neg/t10752/Test_2.scala b/test/files/neg/t10752/Test_2.scala index 2797a51919e9..d656eb95ae3f 100644 --- a/test/files/neg/t10752/Test_2.scala +++ b/test/files/neg/t10752/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -deprecation object Test { def useC = p1.DeprecatedClass.foo def useM = p1.DeprecatedMethod.foo diff --git a/test/files/neg/t1215.check b/test/files/neg/t1215.check index 4cbd0d85f385..d6113b2dec0e 100644 --- a/test/files/neg/t1215.check +++ b/test/files/neg/t1215.check @@ -1,4 +1,4 @@ -t1215.scala:2: error: value += is not a member of Int +t1215.scala:3: error: value += is not a member of Int Expression does not convert to assignment because receiver is not assignable. val x = 1 += 1 ^ diff --git a/test/files/neg/t1215.flags b/test/files/neg/t1215.flags deleted file mode 100644 index fcf951d90723..000000000000 --- a/test/files/neg/t1215.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos \ No newline at end of file diff --git a/test/files/neg/t1215.scala b/test/files/neg/t1215.scala index 0e994d06e2fd..7a3aa89262a0 100644 --- a/test/files/neg/t1215.scala +++ b/test/files/neg/t1215.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos object Test { val x = 1 += 1 } diff --git a/test/files/neg/t1224.check b/test/files/neg/t1224.check index ab8a6f11308c..47c483876a44 100644 --- a/test/files/neg/t1224.check +++ b/test/files/neg/t1224.check @@ -1,4 +1,4 @@ -t1224.scala:4: error: lower bound C[A.this.T] does not conform to upper bound C[C[A.this.T]] +t1224.scala:5: error: lower bound C[A.this.T] does not conform to upper bound C[C[A.this.T]] type T >: C[T] <: C[C[T]] ^ one error found diff --git a/test/files/neg/t1224.flags b/test/files/neg/t1224.flags deleted file mode 100644 index ca20f55172e9..000000000000 --- a/test/files/neg/t1224.flags +++ /dev/null @@ -1 +0,0 @@ --Ybreak-cycles diff --git a/test/files/neg/t1224.scala b/test/files/neg/t1224.scala index 35e01fa379ae..d9eeedaf981d 100644 --- a/test/files/neg/t1224.scala +++ b/test/files/neg/t1224.scala @@ -1,3 +1,4 @@ +// scalac: -Ybreak-cycles trait C[T] {} abstract class A { diff --git a/test/files/neg/t1503.check b/test/files/neg/t1503.check index 731bf2138071..20282096c1e4 100644 --- a/test/files/neg/t1503.check +++ b/test/files/neg/t1503.check @@ -1,4 +1,4 @@ -t1503.scala:7: warning: The value matched by Whatever is bound to n, which may be used under the +t1503.scala:8: warning: The value matched by Whatever is bound to n, which may be used under the unsound assumption that it has type Whatever.type, whereas we can only safely count on it having type Any, as the pattern is matched using `==` (see scala/bug#1503). def matchWhateverCCE(x: Any) = x match { case n @ Whatever => n } diff --git a/test/files/neg/t1503.flags b/test/files/neg/t1503.flags deleted file mode 100644 index e93641e9319e..000000000000 --- a/test/files/neg/t1503.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t1503.scala b/test/files/neg/t1503.scala index 9877f99d0a15..504defe51439 100644 --- a/test/files/neg/t1503.scala +++ b/test/files/neg/t1503.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint -Xfatal-warnings object Whatever { override def equals(x: Any) = true } @@ -5,4 +6,4 @@ object Whatever { class Test { // when left to its own devices, and not under -Xfuture, the return type is Whatever.type def matchWhateverCCE(x: Any) = x match { case n @ Whatever => n } -} \ No newline at end of file +} diff --git a/test/files/neg/t1909-object.check b/test/files/neg/t1909-object.check index 530177057542..9bc03be957f4 100644 --- a/test/files/neg/t1909-object.check +++ b/test/files/neg/t1909-object.check @@ -1,4 +1,4 @@ -t1909-object.scala:4: warning: !!! scala/bug#1909 Unable to STATICally lift object InnerTrouble$2, which is defined in the self- or super-constructor call of class Kaboom. A VerifyError is likely. +t1909-object.scala:5: warning: !!! scala/bug#1909 Unable to STATICally lift object InnerTrouble$2, which is defined in the self- or super-constructor call of class Kaboom. A VerifyError is likely. object InnerTrouble ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t1909-object.flags b/test/files/neg/t1909-object.flags deleted file mode 100644 index eb8b40661b27..000000000000 --- a/test/files/neg/t1909-object.flags +++ /dev/null @@ -1 +0,0 @@ --Xdev -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t1909-object.scala b/test/files/neg/t1909-object.scala index d6011ba4a5b0..3d83415f84cb 100644 --- a/test/files/neg/t1909-object.scala +++ b/test/files/neg/t1909-object.scala @@ -1,3 +1,4 @@ +// scalac: -Xdev -Xfatal-warnings class Kaboom(a: Any) { def this() = { this({ @@ -9,4 +10,4 @@ class Kaboom(a: Any) { object Test extends App { new Kaboom() -} \ No newline at end of file +} diff --git a/test/files/neg/t1980.check b/test/files/neg/t1980.check index a59635c827eb..6e3f2cb07de7 100644 --- a/test/files/neg/t1980.check +++ b/test/files/neg/t1980.check @@ -1,10 +1,10 @@ -t1980.scala:2: warning: by-name parameters will be evaluated eagerly when called as a right-associative infix operator. For more details, see scala/bug#1980. +t1980.scala:3: warning: by-name parameters will be evaluated eagerly when called as a right-associative infix operator. For more details, see scala/bug#1980. def op1_:(x: => Any) = () // warn ^ -t1980.scala:3: warning: by-name parameters will be evaluated eagerly when called as a right-associative infix operator. For more details, see scala/bug#1980. +t1980.scala:4: warning: by-name parameters will be evaluated eagerly when called as a right-associative infix operator. For more details, see scala/bug#1980. def op2_:(x: Any, y: => Any) = () // warn ^ -t1980.scala:4: warning: by-name parameters will be evaluated eagerly when called as a right-associative infix operator. For more details, see scala/bug#1980. +t1980.scala:5: warning: by-name parameters will be evaluated eagerly when called as a right-associative infix operator. For more details, see scala/bug#1980. def op3_:(x: Any, y: => Any)(a: Any) = () // warn ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t1980.flags b/test/files/neg/t1980.flags deleted file mode 100644 index cdc464a47d02..000000000000 --- a/test/files/neg/t1980.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint:by-name-right-associative -Xfatal-warnings diff --git a/test/files/neg/t1980.scala b/test/files/neg/t1980.scala index 132865e694b2..f1851ac60b7b 100644 --- a/test/files/neg/t1980.scala +++ b/test/files/neg/t1980.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint:by-name-right-associative -Xfatal-warnings object Test { def op1_:(x: => Any) = () // warn def op2_:(x: Any, y: => Any) = () // warn diff --git a/test/files/neg/t2442.check b/test/files/neg/t2442.check index 9ff0b4466149..c0e7baed3607 100644 --- a/test/files/neg/t2442.check +++ b/test/files/neg/t2442.check @@ -1,8 +1,8 @@ -t2442.scala:4: warning: match may not be exhaustive. +t2442.scala:5: warning: match may not be exhaustive. It would fail on the following input: THREE def f(e: MyEnum) = e match { ^ -t2442.scala:11: warning: match may not be exhaustive. +t2442.scala:12: warning: match may not be exhaustive. It would fail on the following input: BLUE def g(e: MySecondEnum) = e match { ^ diff --git a/test/files/neg/t2442.flags b/test/files/neg/t2442.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t2442.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t2442/t2442.scala b/test/files/neg/t2442/t2442.scala index b0a0f3cd4145..5f391341186a 100644 --- a/test/files/neg/t2442/t2442.scala +++ b/test/files/neg/t2442/t2442.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class Test { import MyEnum._ @@ -12,4 +13,4 @@ class Test { case RED => println("red") // missing case --> exhaustivity warning! } -} \ No newline at end of file +} diff --git a/test/files/neg/t2462b.check b/test/files/neg/t2462b.check index b3b8007a93a2..d8c2b8cafd89 100644 --- a/test/files/neg/t2462b.check +++ b/test/files/neg/t2462b.check @@ -1,8 +1,8 @@ -t2462b.scala:6: warning: Invalid implicitNotFound message for trait Meh in package test: +t2462b.scala:7: warning: Invalid implicitNotFound message for trait Meh in package test: The type parameters Too, Elem referenced in the message of the @implicitNotFound annotation are not defined by trait Meh. trait Meh[-From, +To] ^ -t2462b.scala:9: warning: Invalid implicitNotFound message for trait Meh2 in package test: +t2462b.scala:10: warning: Invalid implicitNotFound message for trait Meh2 in package test: The type parameter Elem referenced in the message of the @implicitNotFound annotation is not defined by trait Meh2. trait Meh2[-From, +To] ^ diff --git a/test/files/neg/t2462b.flags b/test/files/neg/t2462b.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t2462b.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t2462b.scala b/test/files/neg/t2462b.scala index 576db4bd3f33..8151ab319835 100644 --- a/test/files/neg/t2462b.scala +++ b/test/files/neg/t2462b.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings package test import scala.annotation.implicitNotFound diff --git a/test/files/neg/t2462c.check b/test/files/neg/t2462c.check index edeead55d60c..9ccbd58d466a 100644 --- a/test/files/neg/t2462c.check +++ b/test/files/neg/t2462c.check @@ -1,7 +1,7 @@ -t2462c.scala:18: error: No C of X$Y +t2462c.scala:19: error: No C of X$Y f[X$Y] ^ -t2462c.scala:24: error: No C of Foo[Int] +t2462c.scala:25: error: No C of Foo[Int] f[Foo[Int]] ^ two errors found diff --git a/test/files/neg/t2462c.flags b/test/files/neg/t2462c.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t2462c.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t2462c.scala b/test/files/neg/t2462c.scala index acf04afba954..29bc260daad1 100644 --- a/test/files/neg/t2462c.scala +++ b/test/files/neg/t2462c.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings import annotation._ diff --git a/test/files/neg/t2509-2.check b/test/files/neg/t2509-2.check index f87a7e6bb52d..3c0fe3fef224 100644 --- a/test/files/neg/t2509-2.check +++ b/test/files/neg/t2509-2.check @@ -1,4 +1,4 @@ -t2509-2.scala:26: error: ambiguous implicit values: +t2509-2.scala:27: error: ambiguous implicit values: both value xb in object Test of type => X[B,Int] and value xa in object Test of type => X[A,Boolean] match expected type X[B,U] diff --git a/test/files/neg/t2509-2.flags b/test/files/neg/t2509-2.flags deleted file mode 100644 index cab9e99af3a9..000000000000 --- a/test/files/neg/t2509-2.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:3.0 diff --git a/test/files/neg/t2509-2.scala b/test/files/neg/t2509-2.scala index 609bd8785f8a..032e6083acca 100644 --- a/test/files/neg/t2509-2.scala +++ b/test/files/neg/t2509-2.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:3.0 class A class B extends A class C extends B diff --git a/test/files/neg/t2712-2.check b/test/files/neg/t2712-2.check index ea19e33e2c55..551d0f94ea85 100644 --- a/test/files/neg/t2712-2.check +++ b/test/files/neg/t2712-2.check @@ -1,11 +1,11 @@ -t2712-2.scala:16: error: type mismatch; +t2712-2.scala:17: error: type mismatch; found : test.Foo required: test.Two[test.X1,Object] Note: test.X2 <: Object (and test.Foo <: test.Two[test.X1,test.X2]), but trait Two is invariant in type B. You may wish to define B as +B instead. (SLS 4.5) test1(foo): One[X3] // fails with -Ypartial-unification enabled ^ -t2712-2.scala:16: error: type mismatch; +t2712-2.scala:17: error: type mismatch; found : test.Two[test.X1,Object] required: test.One[test.X3] test1(foo): One[X3] // fails with -Ypartial-unification enabled diff --git a/test/files/neg/t2712-2.flags b/test/files/neg/t2712-2.flags deleted file mode 100644 index 41565c7e32bd..000000000000 --- a/test/files/neg/t2712-2.flags +++ /dev/null @@ -1 +0,0 @@ --Ypartial-unification diff --git a/test/files/neg/t2712-2.scala b/test/files/neg/t2712-2.scala index 85ed52348903..b6ed1c2ed4db 100644 --- a/test/files/neg/t2712-2.scala +++ b/test/files/neg/t2712-2.scala @@ -1,3 +1,4 @@ +// scalac: -Ypartial-unification package test class X1 diff --git a/test/files/neg/t2796.check b/test/files/neg/t2796.check index 22ee35a7e6ba..692afd2de87a 100644 --- a/test/files/neg/t2796.check +++ b/test/files/neg/t2796.check @@ -1,7 +1,7 @@ -t2796.scala:11: warning: early type members are deprecated. Move them to the regular body: the semantics are the same. +t2796.scala:12: warning: early type members are deprecated. Move them to the regular body: the semantics are the same. type X = Int // warn ^ -t2796.scala:7: warning: Implementation restriction: early definitions in traits are not initialized before the super class is initialized. +t2796.scala:8: warning: Implementation restriction: early definitions in traits are not initialized before the super class is initialized. val abstractVal = "T1.abstractVal" // warn ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t2796.flags b/test/files/neg/t2796.flags deleted file mode 100644 index d1b831ea87cd..000000000000 --- a/test/files/neg/t2796.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t2796.scala b/test/files/neg/t2796.scala index fa2f2358b947..f53c6405d12d 100644 --- a/test/files/neg/t2796.scala +++ b/test/files/neg/t2796.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings trait Base { val abstractVal: String final val useAbstractVal = abstractVal diff --git a/test/files/neg/t284.check b/test/files/neg/t284.check index 7c2e9be03ec2..047701f1512f 100644 --- a/test/files/neg/t284.check +++ b/test/files/neg/t284.check @@ -1,4 +1,4 @@ -t284.scala:2: warning: Detected apparent refinement of Unit; are you missing an '=' sign? +t284.scala:3: warning: Detected apparent refinement of Unit; are you missing an '=' sign? def f1(a: T): Unit { } ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t284.flags b/test/files/neg/t284.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t284.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t284.scala b/test/files/neg/t284.scala index f75bc3d4baaf..1ac90706f3c2 100644 --- a/test/files/neg/t284.scala +++ b/test/files/neg/t284.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings trait B[T] { def f1(a: T): Unit { } def f2(a: T): Unit diff --git a/test/files/neg/t3098.check b/test/files/neg/t3098.check index 5343b128f042..8190a292146b 100644 --- a/test/files/neg/t3098.check +++ b/test/files/neg/t3098.check @@ -1,4 +1,4 @@ -b.scala:3: warning: match may not be exhaustive. +b.scala:4: warning: match may not be exhaustive. It would fail on the following input: (_ : C) def f = (null: T) match { ^ diff --git a/test/files/neg/t3098.flags b/test/files/neg/t3098.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t3098.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t3098/a.scala b/test/files/neg/t3098/a.scala index 57a103c7a8c7..7c35db64565e 100644 --- a/test/files/neg/t3098/a.scala +++ b/test/files/neg/t3098/a.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings // Traits.scala sealed trait T diff --git a/test/files/neg/t3098/b.scala b/test/files/neg/t3098/b.scala index 84a1f9f6f471..c3f77ffd19e9 100644 --- a/test/files/neg/t3098/b.scala +++ b/test/files/neg/t3098/b.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings // Test.scala object Test { def f = (null: T) match { diff --git a/test/files/neg/t3683a.check b/test/files/neg/t3683a.check index 6386265ebc55..f40f07435a9a 100644 --- a/test/files/neg/t3683a.check +++ b/test/files/neg/t3683a.check @@ -1,4 +1,4 @@ -t3683a.scala:14: warning: match may not be exhaustive. +t3683a.scala:15: warning: match may not be exhaustive. It would fail on the following input: XX() w match { ^ diff --git a/test/files/neg/t3683a.flags b/test/files/neg/t3683a.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t3683a.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t3683a.scala b/test/files/neg/t3683a.scala index 6d1915213a35..20346aa2bcd2 100644 --- a/test/files/neg/t3683a.scala +++ b/test/files/neg/t3683a.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed trait Foo sealed trait Bar extends Foo sealed trait W[T >: Bar <: Foo] @@ -17,4 +18,4 @@ object Main { case Z(z) => f1(z) } } -} \ No newline at end of file +} diff --git a/test/files/neg/t3692-new.check b/test/files/neg/t3692-new.check index bb8692f3ca9d..3103eda0e266 100644 --- a/test/files/neg/t3692-new.check +++ b/test/files/neg/t3692-new.check @@ -1,16 +1,16 @@ -t3692-new.scala:14: warning: non-variable type argument Int in type pattern scala.collection.immutable.Map[Int,Int] (the underlying of Map[Int,Int]) is unchecked since it is eliminated by erasure +t3692-new.scala:15: warning: non-variable type argument Int in type pattern scala.collection.immutable.Map[Int,Int] (the underlying of Map[Int,Int]) is unchecked since it is eliminated by erasure case m0: Map[Int, Int] => new java.util.HashMap[Integer, Integer] ^ -t3692-new.scala:15: warning: non-variable type argument Int in type pattern scala.collection.immutable.Map[Int,V] (the underlying of Map[Int,V]) is unchecked since it is eliminated by erasure +t3692-new.scala:16: warning: non-variable type argument Int in type pattern scala.collection.immutable.Map[Int,V] (the underlying of Map[Int,V]) is unchecked since it is eliminated by erasure case m1: Map[Int, V] => new java.util.HashMap[Integer, V] ^ -t3692-new.scala:16: warning: non-variable type argument Int in type pattern scala.collection.immutable.Map[T,Int] (the underlying of Map[T,Int]) is unchecked since it is eliminated by erasure +t3692-new.scala:17: warning: non-variable type argument Int in type pattern scala.collection.immutable.Map[T,Int] (the underlying of Map[T,Int]) is unchecked since it is eliminated by erasure case m2: Map[T, Int] => new java.util.HashMap[T, Integer] ^ -t3692-new.scala:15: warning: unreachable code +t3692-new.scala:16: warning: unreachable code case m1: Map[Int, V] => new java.util.HashMap[Integer, V] ^ -t3692-new.scala:4: warning: Tester has a main method with parameter type Array[String], but Tester will not be a runnable program. +t3692-new.scala:5: warning: Tester has a main method with parameter type Array[String], but Tester will not be a runnable program. Reason: main method must have exact signature (Array[String])Unit object Tester { ^ diff --git a/test/files/neg/t3692-new.flags b/test/files/neg/t3692-new.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t3692-new.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t3692-new.scala b/test/files/neg/t3692-new.scala index cebdcea39353..b0edd78818e8 100644 --- a/test/files/neg/t3692-new.scala +++ b/test/files/neg/t3692-new.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings import scala.reflect.{ClassTag, classTag} import java.lang.Integer @@ -17,4 +18,4 @@ class Tester { case _ => new java.util.HashMap[T, V] } } -} \ No newline at end of file +} diff --git a/test/files/neg/t4302.check b/test/files/neg/t4302.check index ea4872927679..3bb9d167deeb 100644 --- a/test/files/neg/t4302.check +++ b/test/files/neg/t4302.check @@ -1,4 +1,4 @@ -t4302.scala:2: warning: abstract type T is unchecked since it is eliminated by erasure +t4302.scala:3: warning: abstract type T is unchecked since it is eliminated by erasure def hasMatch[T](x: AnyRef) = x.isInstanceOf[T] ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t4302.flags b/test/files/neg/t4302.flags deleted file mode 100644 index 779916d58f80..000000000000 --- a/test/files/neg/t4302.flags +++ /dev/null @@ -1 +0,0 @@ --unchecked -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t4302.scala b/test/files/neg/t4302.scala index 53565f05c247..2b190f0424a7 100644 --- a/test/files/neg/t4302.scala +++ b/test/files/neg/t4302.scala @@ -1,3 +1,4 @@ +// scalac: -unchecked -Xfatal-warnings object Test { def hasMatch[T](x: AnyRef) = x.isInstanceOf[T] } diff --git a/test/files/neg/t4440.check b/test/files/neg/t4440.check index 10e7188e32bb..962b956dcde8 100644 --- a/test/files/neg/t4440.check +++ b/test/files/neg/t4440.check @@ -1,13 +1,13 @@ -t4440.scala:12: warning: The outer reference in this type test cannot be checked at run time. +t4440.scala:13: warning: The outer reference in this type test cannot be checked at run time. case _: b.Inner => println("b") ^ -t4440.scala:13: warning: The outer reference in this type test cannot be checked at run time. +t4440.scala:14: warning: The outer reference in this type test cannot be checked at run time. case _: a.Inner => println("a") // this is the case we want ^ -t4440.scala:16: warning: The outer reference in this type test cannot be checked at run time. +t4440.scala:17: warning: The outer reference in this type test cannot be checked at run time. case _: a.Inner => println("a") ^ -t4440.scala:17: warning: The outer reference in this type test cannot be checked at run time. +t4440.scala:18: warning: The outer reference in this type test cannot be checked at run time. case _: b.Inner => println("b") // this is the case we want ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t4440.flags b/test/files/neg/t4440.flags deleted file mode 100644 index 779916d58f80..000000000000 --- a/test/files/neg/t4440.flags +++ /dev/null @@ -1 +0,0 @@ --unchecked -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t4440.scala b/test/files/neg/t4440.scala index bf250ee4b84c..b7c8bdd79bae 100644 --- a/test/files/neg/t4440.scala +++ b/test/files/neg/t4440.scala @@ -1,3 +1,4 @@ +// scalac: -unchecked -Xfatal-warnings // constructors used to drop outer fields when they were not accessed // however, how can you know (respecting separate compilation) that they're not accessed!? class Outer { final class Inner } diff --git a/test/files/neg/t4691_exhaust_extractor.check b/test/files/neg/t4691_exhaust_extractor.check index 6396944145df..c907a35a1217 100644 --- a/test/files/neg/t4691_exhaust_extractor.check +++ b/test/files/neg/t4691_exhaust_extractor.check @@ -1,12 +1,12 @@ -t4691_exhaust_extractor.scala:17: warning: match may not be exhaustive. +t4691_exhaust_extractor.scala:18: warning: match may not be exhaustive. It would fail on the following input: Bar3() def f1(x: Foo) = x match { ^ -t4691_exhaust_extractor.scala:23: warning: match may not be exhaustive. +t4691_exhaust_extractor.scala:24: warning: match may not be exhaustive. It would fail on the following input: Bar3() def f2(x: Foo) = x match { ^ -t4691_exhaust_extractor.scala:29: warning: match may not be exhaustive. +t4691_exhaust_extractor.scala:30: warning: match may not be exhaustive. It would fail on the following input: Bar3() def f3(x: Foo) = x match { ^ diff --git a/test/files/neg/t4691_exhaust_extractor.flags b/test/files/neg/t4691_exhaust_extractor.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t4691_exhaust_extractor.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t4691_exhaust_extractor.scala b/test/files/neg/t4691_exhaust_extractor.scala index c68c33d65471..8448f9e29d68 100644 --- a/test/files/neg/t4691_exhaust_extractor.scala +++ b/test/files/neg/t4691_exhaust_extractor.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed trait Foo class Bar1 extends Foo class Bar2 extends Foo @@ -30,4 +31,4 @@ object Test { case Baz1(x) => x case Baz2(x) => x } -} \ No newline at end of file +} diff --git a/test/files/neg/t4749.check b/test/files/neg/t4749.check index 3539140954cd..ceb27e03fc3f 100644 --- a/test/files/neg/t4749.check +++ b/test/files/neg/t4749.check @@ -1,31 +1,31 @@ -t4749.scala:2: warning: Fail1 has a main method with parameter type Array[String], but bippy.Fail1 will not be a runnable program. +t4749.scala:3: warning: Fail1 has a main method with parameter type Array[String], but bippy.Fail1 will not be a runnable program. Reason: main method must have exact signature (Array[String])Unit object Fail1 { ^ -t4749.scala:6: warning: Fail2 has a main method with parameter type Array[String], but bippy.Fail2 will not be a runnable program. +t4749.scala:7: warning: Fail2 has a main method with parameter type Array[String], but bippy.Fail2 will not be a runnable program. Reason: main methods cannot be generic. object Fail2 { ^ -t4749.scala:13: warning: Fail3 has a main method with parameter type Array[String], but bippy.Fail3 will not be a runnable program. +t4749.scala:14: warning: Fail3 has a main method with parameter type Array[String], but bippy.Fail3 will not be a runnable program. Reason: main methods cannot refer to type parameters or abstract types. object Fail3 extends Bippy[Unit] { } ^ -t4749.scala:16: warning: Fail4 has a main method with parameter type Array[String], but bippy.Fail4 will not be a runnable program. +t4749.scala:17: warning: Fail4 has a main method with parameter type Array[String], but bippy.Fail4 will not be a runnable program. Reason: companion is a trait, which means no static forwarder can be generated. object Fail4 { ^ -t4749.scala:21: warning: Fail5 has a main method with parameter type Array[String], but bippy.Fail5 will not be a runnable program. +t4749.scala:22: warning: Fail5 has a main method with parameter type Array[String], but bippy.Fail5 will not be a runnable program. Reason: companion contains its own main method, which means no static forwarder can be generated. object Fail5 extends Fail5 { } ^ -t4749.scala:26: warning: Fail6 has a main method with parameter type Array[String], but bippy.Fail6 will not be a runnable program. +t4749.scala:27: warning: Fail6 has a main method with parameter type Array[String], but bippy.Fail6 will not be a runnable program. Reason: companion contains its own main method (implementation restriction: no main is allowed, regardless of signature), which means no static forwarder can be generated. object Fail6 { ^ -t4749.scala:42: warning: Win3 has a main method with parameter type Array[String], but bippy.Win3 will not be a runnable program. +t4749.scala:43: warning: Win3 has a main method with parameter type Array[String], but bippy.Win3 will not be a runnable program. Reason: main method must have exact signature (Array[String])Unit object Win3 extends WinBippy[Unit] { } ^ diff --git a/test/files/neg/t4749.flags b/test/files/neg/t4749.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t4749.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t4749.scala b/test/files/neg/t4749.scala index 2c67e2ea9617..180f66e7298c 100644 --- a/test/files/neg/t4749.scala +++ b/test/files/neg/t4749.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings package bippy { object Fail1 { def main(args: Array[String]): Any = () diff --git a/test/files/neg/t4762.check b/test/files/neg/t4762.check index a0525f6226b2..c76829e227b1 100644 --- a/test/files/neg/t4762.check +++ b/test/files/neg/t4762.check @@ -1,7 +1,7 @@ -t4762.scala:15: warning: private[this] value x in class B shadows mutable x inherited from class A. Changes to x will not be visible within class B - you may want to give them distinct names. +t4762.scala:16: warning: private[this] value x in class B shadows mutable x inherited from class A. Changes to x will not be visible within class B - you may want to give them distinct names. /* (99,99) */ (this.x, this.y), ^ -t4762.scala:48: warning: private[this] value x in class Derived shadows mutable x inherited from class Base. Changes to x will not be visible within class Derived - you may want to give them distinct names. +t4762.scala:49: warning: private[this] value x in class Derived shadows mutable x inherited from class Base. Changes to x will not be visible within class Derived - you may want to give them distinct names. class Derived( x : Int ) extends Base( x ) { override def toString = x.toString } ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t4762.flags b/test/files/neg/t4762.flags deleted file mode 100644 index e93641e9319e..000000000000 --- a/test/files/neg/t4762.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t4762.scala b/test/files/neg/t4762.scala index 4bbaede66520..dd723ce0a536 100644 --- a/test/files/neg/t4762.scala +++ b/test/files/neg/t4762.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint -Xfatal-warnings // https://github.com/scala/bug/issues/4762 // In A, x and y are -1. diff --git a/test/files/neg/t4851.check b/test/files/neg/t4851.check index 721923e0ba3f..3a33f4ddd09c 100644 --- a/test/files/neg/t4851.check +++ b/test/files/neg/t4851.check @@ -1,46 +1,46 @@ -S.scala:2: warning: Adaptation of argument list by inserting () is deprecated: leaky (Object-receiving) target makes this especially dangerous. +S.scala:3: warning: Adaptation of argument list by inserting () is deprecated: leaky (Object-receiving) target makes this especially dangerous. signature: J(x: Any): J given arguments: after adaptation: new J((): Unit) val x1 = new J ^ -S.scala:3: warning: Adaptation of argument list by inserting () is deprecated: leaky (Object-receiving) target makes this especially dangerous. +S.scala:4: warning: Adaptation of argument list by inserting () is deprecated: leaky (Object-receiving) target makes this especially dangerous. signature: J(x: Any): J given arguments: after adaptation: new J((): Unit) val x2 = new J() ^ -S.scala:4: warning: Adapting argument list by creating a 5-tuple: this may not be what you want. +S.scala:5: warning: Adapting argument list by creating a 5-tuple: this may not be what you want. signature: J(x: Any): J given arguments: 1, 2, 3, 4, 5 after adaptation: new J((1, 2, 3, 4, 5): (Int, Int, Int, Int, Int)) val x3 = new J(1, 2, 3, 4, 5) ^ -S.scala:6: warning: Adapting argument list by creating a 3-tuple: this may not be what you want. +S.scala:7: warning: Adapting argument list by creating a 3-tuple: this may not be what you want. signature: Some.apply[A](value: A): Some[A] given arguments: 1, 2, 3 after adaptation: Some((1, 2, 3): (Int, Int, Int)) val y1 = Some(1, 2, 3) ^ -S.scala:7: warning: Adapting argument list by creating a 3-tuple: this may not be what you want. +S.scala:8: warning: Adapting argument list by creating a 3-tuple: this may not be what you want. signature: Some(value: A): Some[A] given arguments: 1, 2, 3 after adaptation: new Some((1, 2, 3): (Int, Int, Int)) val y2 = new Some(1, 2, 3) ^ -S.scala:9: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want. +S.scala:10: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want. signature: J2(x: T): J2[T] given arguments: after adaptation: new J2((): Unit) val z1 = new J2 ^ -S.scala:10: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want. +S.scala:11: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want. signature: J2(x: T): J2[T] given arguments: after adaptation: new J2((): Unit) val z2 = new J2() ^ -S.scala:14: warning: Adapting argument list by creating a 3-tuple: this may not be what you want. +S.scala:15: warning: Adapting argument list by creating a 3-tuple: this may not be what you want. signature: Test.anyId(a: Any): Any given arguments: 1, 2, 3 after adaptation: Test.anyId((1, 2, 3): (Int, Int, Int)) diff --git a/test/files/neg/t4851.flags b/test/files/neg/t4851.flags deleted file mode 100644 index 044ce22c8403..000000000000 --- a/test/files/neg/t4851.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint:adapted-args -Xfatal-warnings -deprecation diff --git a/test/files/neg/t4851/S.scala b/test/files/neg/t4851/S.scala index 779ba376b03f..c33d01a166c7 100644 --- a/test/files/neg/t4851/S.scala +++ b/test/files/neg/t4851/S.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint:adapted-args -Xfatal-warnings -deprecation object Test { val x1 = new J val x2 = new J() diff --git a/test/files/neg/t5182.check b/test/files/neg/t5182.check index 3161f92680cc..69de73b8f621 100644 --- a/test/files/neg/t5182.check +++ b/test/files/neg/t5182.check @@ -1,7 +1,7 @@ -t5182.scala:2: error: unknown annotation argument name: qwe +t5182.scala:3: error: unknown annotation argument name: qwe @java.lang.Deprecated(qwe = "wer") def ok(q:Int) = 1 ^ -t5182.scala:3: error: classfile annotation arguments have to be supplied as named arguments +t5182.scala:4: error: classfile annotation arguments have to be supplied as named arguments @java.lang.Deprecated("wer") def whereAmI(q:Int) = 1 ^ two errors found diff --git a/test/files/neg/t5182.flags b/test/files/neg/t5182.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t5182.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t5182.scala b/test/files/neg/t5182.scala index 0687e99efb57..b9e62c79a4da 100644 --- a/test/files/neg/t5182.scala +++ b/test/files/neg/t5182.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class test { @java.lang.Deprecated(qwe = "wer") def ok(q:Int) = 1 @java.lang.Deprecated("wer") def whereAmI(q:Int) = 1 diff --git a/test/files/neg/t5352.check b/test/files/neg/t5352.check index 1675da9e9aca..df76ac8267c8 100644 --- a/test/files/neg/t5352.check +++ b/test/files/neg/t5352.check @@ -1,10 +1,10 @@ -t5352.scala:11: error: type mismatch; +t5352.scala:12: error: type mismatch; found : boop.Bar required: boop.BarF (which expands to) AnyRef{def f(): Int} x = xs.head ^ -t5352.scala:14: error: method f in class Bar1 cannot be accessed in boop.Bar1 +t5352.scala:15: error: method f in class Bar1 cannot be accessed in boop.Bar1 Access to protected method f not permitted because enclosing object boop is not a subclass of class Bar1 in object boop where target is defined diff --git a/test/files/neg/t5352.flags b/test/files/neg/t5352.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t5352.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t5352.scala b/test/files/neg/t5352.scala index ed74a840f0c0..7bd73a7ed5a3 100644 --- a/test/files/neg/t5352.scala +++ b/test/files/neg/t5352.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object boop { abstract class Bar { protected def f(): Any } class Bar1 extends Bar { protected def f(): Int = 5 } diff --git a/test/files/neg/t5426.check b/test/files/neg/t5426.check index 98f3ddaaaec2..a5839f0a15ad 100644 --- a/test/files/neg/t5426.check +++ b/test/files/neg/t5426.check @@ -1,13 +1,13 @@ -t5426.scala:2: warning: comparing values of types Some[Int] and Int using `==' will always yield false +t5426.scala:3: warning: comparing values of types Some[Int] and Int using `==' will always yield false def f1 = Some(5) == 5 ^ -t5426.scala:3: warning: comparing values of types Int and Some[Int] using `==' will always yield false +t5426.scala:4: warning: comparing values of types Int and Some[Int] using `==' will always yield false def f2 = 5 == Some(5) ^ -t5426.scala:8: warning: comparing values of types Int and Some[Int] using `==' will always yield false +t5426.scala:9: warning: comparing values of types Int and Some[Int] using `==' will always yield false (x1 == x2) ^ -t5426.scala:9: warning: comparing values of types Some[Int] and Int using `==' will always yield false +t5426.scala:10: warning: comparing values of types Some[Int] and Int using `==' will always yield false (x2 == x1) ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t5426.flags b/test/files/neg/t5426.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t5426.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t5426.scala b/test/files/neg/t5426.scala index af0f98196942..b6bd5b832274 100644 --- a/test/files/neg/t5426.scala +++ b/test/files/neg/t5426.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class A { def f1 = Some(5) == 5 def f2 = 5 == Some(5) diff --git a/test/files/neg/t5440.check b/test/files/neg/t5440.check index 1c4592cceccd..fdcbde3fde7c 100644 --- a/test/files/neg/t5440.check +++ b/test/files/neg/t5440.check @@ -1,4 +1,4 @@ -t5440.scala:3: warning: match may not be exhaustive. +t5440.scala:4: warning: match may not be exhaustive. It would fail on the following inputs: (List(_), Nil), (Nil, List(_)) (list1, list2) match { ^ diff --git a/test/files/neg/t5440.flags b/test/files/neg/t5440.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t5440.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t5440.scala b/test/files/neg/t5440.scala index d9cf5d6252cb..1c10ea9b16b0 100644 --- a/test/files/neg/t5440.scala +++ b/test/files/neg/t5440.scala @@ -1,7 +1,8 @@ +// scalac: -Xfatal-warnings object Test { def merge(list1: List[Long], list2: List[Long]): Boolean = (list1, list2) match { case (hd1::_, hd2::_) => true case (Nil, Nil) => true } -} \ No newline at end of file +} diff --git a/test/files/neg/t5639b.check b/test/files/neg/t5639b.check index faa176666091..3dbcf446e59f 100644 --- a/test/files/neg/t5639b.check +++ b/test/files/neg/t5639b.check @@ -1,4 +1,4 @@ -A_2.scala:6: error: could not find implicit value for parameter e: Int +A_2.scala:7: error: could not find implicit value for parameter e: Int implicitly[Int] ^ one error found diff --git a/test/files/neg/t5639b.flags b/test/files/neg/t5639b.flags deleted file mode 100644 index 90b87663af56..000000000000 --- a/test/files/neg/t5639b.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.11 \ No newline at end of file diff --git a/test/files/neg/t5639b/A_1.scala b/test/files/neg/t5639b/A_1.scala index c5da10eae4f9..ab35b2d2aba1 100644 --- a/test/files/neg/t5639b/A_1.scala +++ b/test/files/neg/t5639b/A_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.11 import Implicits._ class Baz diff --git a/test/files/neg/t5639b/A_2.scala b/test/files/neg/t5639b/A_2.scala index 2bb36273e093..2769b0ec0898 100644 --- a/test/files/neg/t5639b/A_2.scala +++ b/test/files/neg/t5639b/A_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.11 import Implicits._ class Baz diff --git a/test/files/neg/t5663-badwarneq.check b/test/files/neg/t5663-badwarneq.check index 732e4f44d0e0..fba6275ea0f1 100644 --- a/test/files/neg/t5663-badwarneq.check +++ b/test/files/neg/t5663-badwarneq.check @@ -1,40 +1,40 @@ -t5663-badwarneq.scala:47: warning: comparing case class values of types Some[Int] and None.type using `==' will always yield false +t5663-badwarneq.scala:48: warning: comparing case class values of types Some[Int] and None.type using `==' will always yield false println(new Some(1) == None) // Should complain on type, was: spuriously complains on fresh object ^ -t5663-badwarneq.scala:48: warning: comparing case class values of types Some[Int] and Thing using `==' will always yield false +t5663-badwarneq.scala:49: warning: comparing case class values of types Some[Int] and Thing using `==' will always yield false println(Some(1) == new Thing(1)) // Should complain on type, was: spuriously complains on fresh object ^ -t5663-badwarneq.scala:56: warning: ThingOne and Thingy are unrelated: they will most likely never compare equal +t5663-badwarneq.scala:57: warning: ThingOne and Thingy are unrelated: they will most likely never compare equal println(t1 == t2) // true, but apparently unrelated, a compromise warning ^ -t5663-badwarneq.scala:57: warning: ThingThree and Thingy are unrelated: they will most likely never compare equal +t5663-badwarneq.scala:58: warning: ThingThree and Thingy are unrelated: they will most likely never compare equal println(t4 == t2) // true, complains because ThingThree is final and Thingy not a subclass, stronger claim than unrelated ^ -t5663-badwarneq.scala:60: warning: comparing case class values of types ThingTwo and Some[Int] using `==' will always yield false +t5663-badwarneq.scala:61: warning: comparing case class values of types ThingTwo and Some[Int] using `==' will always yield false println(t3 == Some(1)) // false, warn on different cases ^ -t5663-badwarneq.scala:61: warning: comparing values of types ThingOne and Cousin using `==' will always yield false +t5663-badwarneq.scala:62: warning: comparing values of types ThingOne and Cousin using `==' will always yield false println(t1 == c) // should warn ^ -t5663-badwarneq.scala:69: warning: comparing case class values of types Simple and SimpleSibling.type using `==' will always yield false +t5663-badwarneq.scala:70: warning: comparing case class values of types Simple and SimpleSibling.type using `==' will always yield false println(new Simple() == SimpleSibling) // like Some(1) == None, but needn't be final case ^ -t5663-badwarneq.scala:72: warning: ValueClass1 and Int are unrelated: they will never compare equal +t5663-badwarneq.scala:73: warning: ValueClass1 and Int are unrelated: they will never compare equal println(new ValueClass1(5) == 5) // bad ^ -t5663-badwarneq.scala:74: warning: comparing values of types Int and ValueClass1 using `==' will always yield false +t5663-badwarneq.scala:75: warning: comparing values of types Int and ValueClass1 using `==' will always yield false println(5 == new ValueClass1(5)) // bad ^ -t5663-badwarneq.scala:78: warning: ValueClass2[String] and String are unrelated: they will never compare equal +t5663-badwarneq.scala:79: warning: ValueClass2[String] and String are unrelated: they will never compare equal println(new ValueClass2("abc") == "abc") // bad ^ -t5663-badwarneq.scala:79: warning: ValueClass2[Int] and ValueClass1 are unrelated: they will never compare equal +t5663-badwarneq.scala:80: warning: ValueClass2[Int] and ValueClass1 are unrelated: they will never compare equal println(new ValueClass2(5) == new ValueClass1(5)) // bad - different value classes ^ -t5663-badwarneq.scala:81: warning: comparing values of types ValueClass3 and ValueClass2[Int] using `==' will always yield false +t5663-badwarneq.scala:82: warning: comparing values of types ValueClass3 and ValueClass2[Int] using `==' will always yield false println(ValueClass3(5) == new ValueClass2(5)) // bad ^ -t5663-badwarneq.scala:82: warning: comparing values of types ValueClass3 and Int using `==' will always yield false +t5663-badwarneq.scala:83: warning: comparing values of types ValueClass3 and Int using `==' will always yield false println(ValueClass3(5) == 5) // bad ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t5663-badwarneq.flags b/test/files/neg/t5663-badwarneq.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t5663-badwarneq.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t5663-badwarneq.scala b/test/files/neg/t5663-badwarneq.scala index 3c0376914e27..4dcba7189616 100644 --- a/test/files/neg/t5663-badwarneq.scala +++ b/test/files/neg/t5663-badwarneq.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings // alias trait Thingy diff --git a/test/files/neg/t5675.flags b/test/files/neg/t5675.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t5675.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t5675.scala b/test/files/neg/t5675.scala index 238ed0fcaef2..73fc1c2f2902 100644 --- a/test/files/neg/t5675.scala +++ b/test/files/neg/t5675.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class PostFix { val list = List(1, 2, 3) def main(args: Array[String]) { diff --git a/test/files/neg/t5689.check b/test/files/neg/t5689.check index 7d4f7fb63aa7..a1c3f85fa8a0 100644 --- a/test/files/neg/t5689.check +++ b/test/files/neg/t5689.check @@ -1,4 +1,4 @@ -t5689.scala:4: error: macro implementation has incompatible shape: +t5689.scala:5: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context)(i: c.Expr[Double]): c.Expr[String] or : (c: scala.reflect.macros.blackbox.Context)(i: c.Tree): c.Tree found : (c: scala.reflect.macros.blackbox.Context)(i: c.Expr[Double]): c.Expr[Int] diff --git a/test/files/neg/t5689.flags b/test/files/neg/t5689.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/t5689.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/t5689.scala b/test/files/neg/t5689.scala index d757a5541767..efb7a8acd394 100644 --- a/test/files/neg/t5689.scala +++ b/test/files/neg/t5689.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { diff --git a/test/files/neg/t5691.check b/test/files/neg/t5691.check index a51ca98a1089..c69e460e3abd 100644 --- a/test/files/neg/t5691.check +++ b/test/files/neg/t5691.check @@ -1,22 +1,22 @@ -t5691.scala:7: warning: type parameter D defined in method foobar shadows trait D defined in class B. You may want to rename your type parameter, or possibly remove it. +t5691.scala:8: warning: type parameter D defined in method foobar shadows trait D defined in class B. You may want to rename your type parameter, or possibly remove it. def foobar[D](in: D) = in.toString ^ -t5691.scala:10: warning: type parameter D defined in type MySeq shadows trait D defined in class B. You may want to rename your type parameter, or possibly remove it. +t5691.scala:11: warning: type parameter D defined in type MySeq shadows trait D defined in class B. You may want to rename your type parameter, or possibly remove it. type MySeq[D] = Seq[D] ^ -t5691.scala:15: warning: type parameter T defined in method bar shadows type T defined in class Foo. You may want to rename your type parameter, or possibly remove it. +t5691.scala:16: warning: type parameter T defined in method bar shadows type T defined in class Foo. You may want to rename your type parameter, or possibly remove it. def bar[T](w: T) = w.toString ^ -t5691.scala:13: warning: type parameter T defined in class Foo shadows type T defined in class B. You may want to rename your type parameter, or possibly remove it. +t5691.scala:14: warning: type parameter T defined in class Foo shadows type T defined in class B. You may want to rename your type parameter, or possibly remove it. class Foo[T](t: T) { ^ -t5691.scala:19: warning: type parameter List defined in type M shadows type List defined in package object scala. You may want to rename your type parameter, or possibly remove it. +t5691.scala:20: warning: type parameter List defined in type M shadows type List defined in package object scala. You may want to rename your type parameter, or possibly remove it. class C[M[List[_]]] ^ -t5691.scala:20: warning: type parameter List defined in type M shadows type List defined in package object scala. You may want to rename your type parameter, or possibly remove it. +t5691.scala:21: warning: type parameter List defined in type M shadows type List defined in package object scala. You may want to rename your type parameter, or possibly remove it. type E[M[List[_]]] = Int ^ -t5691.scala:21: warning: type parameter List defined in type M shadows type List defined in package object scala. You may want to rename your type parameter, or possibly remove it. +t5691.scala:22: warning: type parameter List defined in type M shadows type List defined in package object scala. You may want to rename your type parameter, or possibly remove it. def foo[N[M[List[_]]]] = ??? ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t5691.flags b/test/files/neg/t5691.flags deleted file mode 100644 index 0e09b8575b42..000000000000 --- a/test/files/neg/t5691.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint:type-parameter-shadow -language:higherKinds -Xfatal-warnings diff --git a/test/files/neg/t5691.scala b/test/files/neg/t5691.scala index e6a9bdc16a61..24b6f614dc4c 100644 --- a/test/files/neg/t5691.scala +++ b/test/files/neg/t5691.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint:type-parameter-shadow -language:higherKinds -Xfatal-warnings class B { type T = Int diff --git a/test/files/neg/t5753.check b/test/files/neg/t5753.check index 379416c1793d..4da5a8adf5e6 100644 --- a/test/files/neg/t5753.check +++ b/test/files/neg/t5753.check @@ -1,4 +1,4 @@ -Test_2.scala:9: error: macro implementation not found: foo +Test_2.scala:10: error: macro implementation not found: foo (the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them) println(foo(42)) ^ diff --git a/test/files/neg/t5753.flags b/test/files/neg/t5753.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/neg/t5753.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/neg/t5753/Impls_Macros_1.scala b/test/files/neg/t5753/Impls_Macros_1.scala index 9872c69171e8..7b2c7f14be77 100644 --- a/test/files/neg/t5753/Impls_Macros_1.scala +++ b/test/files/neg/t5753/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context trait Impls { diff --git a/test/files/neg/t5753/Test_2.scala b/test/files/neg/t5753/Test_2.scala index d52ed65c604a..47fc6859c7fa 100644 --- a/test/files/neg/t5753/Test_2.scala +++ b/test/files/neg/t5753/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros extends Impls { diff --git a/test/files/neg/t5762.check b/test/files/neg/t5762.check index 2a2f12144ab7..8de7c532d362 100644 --- a/test/files/neg/t5762.check +++ b/test/files/neg/t5762.check @@ -1,13 +1,13 @@ -t5762.scala:6: warning: non-variable type argument Int in type pattern D[Int] is unchecked since it is eliminated by erasure +t5762.scala:7: warning: non-variable type argument Int in type pattern D[Int] is unchecked since it is eliminated by erasure case _: D[Int] if bippy => 1 ^ -t5762.scala:7: warning: non-variable type argument String in type pattern D[String] is unchecked since it is eliminated by erasure +t5762.scala:8: warning: non-variable type argument String in type pattern D[String] is unchecked since it is eliminated by erasure case _: D[String] => 2 ^ -t5762.scala:20: warning: non-variable type argument D[Int] in type pattern D[D[Int]] is unchecked since it is eliminated by erasure +t5762.scala:21: warning: non-variable type argument D[Int] in type pattern D[D[Int]] is unchecked since it is eliminated by erasure case _: D[D[Int]] if bippy => 1 ^ -t5762.scala:21: warning: non-variable type argument D[String] in type pattern D[D[String]] is unchecked since it is eliminated by erasure +t5762.scala:22: warning: non-variable type argument D[String] in type pattern D[D[String]] is unchecked since it is eliminated by erasure case _: D[D[String]] => 2 ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t5762.flags b/test/files/neg/t5762.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t5762.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t5762.scala b/test/files/neg/t5762.scala index fb73552b12eb..d63815b95d8d 100644 --- a/test/files/neg/t5762.scala +++ b/test/files/neg/t5762.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class D[-A] object Test { diff --git a/test/files/neg/t5830.check b/test/files/neg/t5830.check index 58c3a1be38f5..e67ad3772b96 100644 --- a/test/files/neg/t5830.check +++ b/test/files/neg/t5830.check @@ -1,7 +1,7 @@ -t5830.scala:6: warning: unreachable code +t5830.scala:7: warning: unreachable code case 'a' => println("b") // unreachable ^ -t5830.scala:4: warning: could not emit switch for @switch annotated match +t5830.scala:5: warning: could not emit switch for @switch annotated match def unreachable(ch: Char) = (ch: @switch) match { ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t5830.flags b/test/files/neg/t5830.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t5830.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t5830.scala b/test/files/neg/t5830.scala index c2df3dec8be5..7b8cfc64b12e 100644 --- a/test/files/neg/t5830.scala +++ b/test/files/neg/t5830.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings import scala.annotation.switch class Test { @@ -6,4 +7,4 @@ class Test { case 'a' => println("b") // unreachable case 'c' => } -} \ No newline at end of file +} diff --git a/test/files/neg/t5956.check b/test/files/neg/t5956.check index f5ae42c799fc..e3f7bf33c4c3 100644 --- a/test/files/neg/t5956.check +++ b/test/files/neg/t5956.check @@ -1,7 +1,7 @@ -t5956.scala:1: error: C is already defined as case class C +t5956.scala:2: error: C is already defined as case class C object O { case class C[T](); class C() } ^ -t5956.scala:2: error: C is already defined as case class C +t5956.scala:3: error: C is already defined as case class C object T { case class C[T](); case class C() } ^ two errors found diff --git a/test/files/neg/t5956.flags b/test/files/neg/t5956.flags deleted file mode 100644 index dcc59ebe32ef..000000000000 --- a/test/files/neg/t5956.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation diff --git a/test/files/neg/t5956.scala b/test/files/neg/t5956.scala index 3cc10f3e1929..94b96fdfef43 100644 --- a/test/files/neg/t5956.scala +++ b/test/files/neg/t5956.scala @@ -1,2 +1,3 @@ +// scalac: -deprecation object O { case class C[T](); class C() } object T { case class C[T](); case class C() } diff --git a/test/files/neg/t6011.check b/test/files/neg/t6011.check index cb7f18903134..98fcf4e673a5 100644 --- a/test/files/neg/t6011.check +++ b/test/files/neg/t6011.check @@ -1,10 +1,10 @@ -t6011.scala:4: warning: unreachable code +t6011.scala:5: warning: unreachable code case 'a' | 'c' => 1 // unreachable ^ -t6011.scala:10: warning: unreachable code +t6011.scala:11: warning: unreachable code case 'b' | 'a' => 1 // unreachable ^ -t6011.scala:8: warning: could not emit switch for @switch annotated match +t6011.scala:9: warning: could not emit switch for @switch annotated match def f2(ch: Char): Any = (ch: @annotation.switch) match { ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t6011.flags b/test/files/neg/t6011.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t6011.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t6011.scala b/test/files/neg/t6011.scala index a36cca789794..14da7c68da6f 100644 --- a/test/files/neg/t6011.scala +++ b/test/files/neg/t6011.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { def f(ch: Char): Any = ch match { case 'a' => 1 @@ -20,4 +21,4 @@ object Test { def main(args: Array[String]): Unit = f('a') -} \ No newline at end of file +} diff --git a/test/files/neg/t6048.check b/test/files/neg/t6048.check index f8eddf5471ce..fe8848cbdb36 100644 --- a/test/files/neg/t6048.check +++ b/test/files/neg/t6048.check @@ -1,16 +1,16 @@ -t6048.scala:3: warning: unreachable code +t6048.scala:4: warning: unreachable code case _ if false => x // unreachable ^ -t6048.scala:8: warning: unreachable code +t6048.scala:9: warning: unreachable code case _ if false => x // unreachable ^ -t6048.scala:13: warning: patterns after a variable pattern cannot match (SLS 8.1.1) +t6048.scala:14: warning: patterns after a variable pattern cannot match (SLS 8.1.1) case _ => x ^ -t6048.scala:14: warning: unreachable code due to variable pattern on line 13 +t6048.scala:15: warning: unreachable code due to variable pattern on line 14 case 5 if true => x // unreachable ^ -t6048.scala:14: warning: unreachable code +t6048.scala:15: warning: unreachable code case 5 if true => x // unreachable ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t6048.flags b/test/files/neg/t6048.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t6048.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t6048.scala b/test/files/neg/t6048.scala index 803e651d1908..fc029dd1f4a8 100644 --- a/test/files/neg/t6048.scala +++ b/test/files/neg/t6048.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class A { def f1(x: Int) = x match { case _ if false => x // unreachable diff --git a/test/files/neg/t6120.check b/test/files/neg/t6120.check index b7a5d8bf17a5..338af48cbde2 100644 --- a/test/files/neg/t6120.check +++ b/test/files/neg/t6120.check @@ -1,4 +1,4 @@ -t6120.scala:5: warning: postfix operator bippy should be enabled +t6120.scala:6: warning: postfix operator bippy should be enabled by making the implicit value scala.language.postfixOps visible. This can be achieved by adding the import clause 'import scala.language.postfixOps' or by setting the compiler option -language:postfixOps. @@ -6,13 +6,13 @@ See the Scaladoc for value scala.language.postfixOps for a discussion why the feature should be explicitly enabled. def f = null == null bippy ^ -t6120.scala:5: warning: method bippy in class BooleanOps is deprecated (since 2.11.0): bobo +t6120.scala:6: warning: method bippy in class BooleanOps is deprecated (since 2.11.0): bobo def f = null == null bippy ^ -t6120.scala:5: warning: comparing values of types Null and Null using `==' will always yield true +t6120.scala:6: warning: comparing values of types Null and Null using `==' will always yield true def f = null == null bippy ^ -t6120.scala:6: warning: method bippy in class BooleanOps is deprecated (since 2.11.0): bobo +t6120.scala:7: warning: method bippy in class BooleanOps is deprecated (since 2.11.0): bobo def g = true.bippy ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t6120.flags b/test/files/neg/t6120.flags deleted file mode 100644 index 04d7c7d417aa..000000000000 --- a/test/files/neg/t6120.flags +++ /dev/null @@ -1 +0,0 @@ --feature -deprecation -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t6120.scala b/test/files/neg/t6120.scala index 425f09db47bb..23d2cf1cf909 100644 --- a/test/files/neg/t6120.scala +++ b/test/files/neg/t6120.scala @@ -1,3 +1,4 @@ +// scalac: -feature -deprecation -Xfatal-warnings class A { implicit class BooleanOps(val b: Boolean) { @deprecated("bobo", "2.11.0") def bippy() = 5 diff --git a/test/files/neg/t6123-explaintypes-macros.check b/test/files/neg/t6123-explaintypes-macros.check index 2c86f3c9cc28..7f74104394cd 100644 --- a/test/files/neg/t6123-explaintypes-macros.check +++ b/test/files/neg/t6123-explaintypes-macros.check @@ -1,6 +1,6 @@ c.universe.Expr[Any]* <: c.universe.Expr[String]*? false -BadMac_2.scala:6: error: macro implementation has incompatible shape: +BadMac_2.scala:7: error: macro implementation has incompatible shape: required: (c: scala.reflect.macros.blackbox.Context)(format: c.Expr[String], params: c.Expr[Any]*): c.Expr[Unit] or : (c: scala.reflect.macros.blackbox.Context)(format: c.Tree, params: Tree*): c.Tree found : (c: scala.reflect.macros.blackbox.Context)(format: c.Expr[String], params: c.Expr[String]*): c.Expr[Unit] diff --git a/test/files/neg/t6123-explaintypes-macros/BadMac_2.flags b/test/files/neg/t6123-explaintypes-macros/BadMac_2.flags deleted file mode 100644 index b36707c7cfcf..000000000000 --- a/test/files/neg/t6123-explaintypes-macros/BadMac_2.flags +++ /dev/null @@ -1 +0,0 @@ --explaintypes diff --git a/test/files/neg/t6123-explaintypes-macros/BadMac_2.scala b/test/files/neg/t6123-explaintypes-macros/BadMac_2.scala index 75ded4ef7d0b..65303fb6e6dd 100644 --- a/test/files/neg/t6123-explaintypes-macros/BadMac_2.scala +++ b/test/files/neg/t6123-explaintypes-macros/BadMac_2.scala @@ -1,3 +1,4 @@ +// scalac: -explaintypes import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context diff --git a/test/files/neg/t6123-explaintypes-macros/Macros.flags b/test/files/neg/t6123-explaintypes-macros/Macros.flags deleted file mode 100644 index b36707c7cfcf..000000000000 --- a/test/files/neg/t6123-explaintypes-macros/Macros.flags +++ /dev/null @@ -1 +0,0 @@ --explaintypes diff --git a/test/files/neg/t6123-explaintypes-macros/Macros.scala b/test/files/neg/t6123-explaintypes-macros/Macros.scala index f2238b39a739..21979a86207d 100644 --- a/test/files/neg/t6123-explaintypes-macros/Macros.scala +++ b/test/files/neg/t6123-explaintypes-macros/Macros.scala @@ -1,3 +1,4 @@ +// scalac: -explaintypes import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context diff --git a/test/files/neg/t6162-inheritance.check b/test/files/neg/t6162-inheritance.check index 9b0a8990da95..3698f4b48d75 100644 --- a/test/files/neg/t6162-inheritance.check +++ b/test/files/neg/t6162-inheritance.check @@ -1,10 +1,10 @@ -usage.scala:3: warning: inheritance from class Foo in package t6126 is deprecated (since 2.10.0): `Foo` will be made final in a future version. +usage.scala:4: warning: inheritance from class Foo in package t6126 is deprecated (since 2.10.0): `Foo` will be made final in a future version. class SubFoo extends Foo ^ -usage.scala:5: warning: inheritance from trait T in package t6126 is deprecated +usage.scala:6: warning: inheritance from trait T in package t6126 is deprecated object SubT extends T ^ -usage.scala:8: warning: inheritance from trait S in package t6126 is deprecated +usage.scala:9: warning: inheritance from trait S in package t6126 is deprecated new S { ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t6162-inheritance.flags b/test/files/neg/t6162-inheritance.flags deleted file mode 100644 index 65faf53579c2..000000000000 --- a/test/files/neg/t6162-inheritance.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -deprecation \ No newline at end of file diff --git a/test/files/neg/t6162-inheritance/defn.scala b/test/files/neg/t6162-inheritance/defn.scala index bb582d27b0dd..8e4f4d0362df 100644 --- a/test/files/neg/t6162-inheritance/defn.scala +++ b/test/files/neg/t6162-inheritance/defn.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -deprecation package scala.t6126 @deprecatedInheritance("`Foo` will be made final in a future version.", "2.10.0") diff --git a/test/files/neg/t6162-inheritance/usage.scala b/test/files/neg/t6162-inheritance/usage.scala index 097e4f590309..aa9e2fdd2dbf 100644 --- a/test/files/neg/t6162-inheritance/usage.scala +++ b/test/files/neg/t6162-inheritance/usage.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -deprecation package scala.t6126 class SubFoo extends Foo diff --git a/test/files/neg/t6162-overriding.check b/test/files/neg/t6162-overriding.check index 586bfb4b35fb..596df2e9d84b 100644 --- a/test/files/neg/t6162-overriding.check +++ b/test/files/neg/t6162-overriding.check @@ -1,7 +1,7 @@ -t6162-overriding.scala:14: warning: overriding method bar in class Bar is deprecated (since 2.10.0): `bar` will be made private in a future version. +t6162-overriding.scala:15: warning: overriding method bar in class Bar is deprecated (since 2.10.0): `bar` will be made private in a future version. override def bar = 43 ^ -t6162-overriding.scala:15: warning: overriding method baz in class Bar is deprecated +t6162-overriding.scala:16: warning: overriding method baz in class Bar is deprecated override def baz = 43 ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t6162-overriding.flags b/test/files/neg/t6162-overriding.flags deleted file mode 100644 index 65faf53579c2..000000000000 --- a/test/files/neg/t6162-overriding.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -deprecation \ No newline at end of file diff --git a/test/files/neg/t6162-overriding.scala b/test/files/neg/t6162-overriding.scala index 4cab0c2dee43..af6b77b216e2 100644 --- a/test/files/neg/t6162-overriding.scala +++ b/test/files/neg/t6162-overriding.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -deprecation package scala.t6162 class Bar { diff --git a/test/files/neg/t6264.check b/test/files/neg/t6264.check index c0975a80b264..312f6e9d00fc 100644 --- a/test/files/neg/t6264.check +++ b/test/files/neg/t6264.check @@ -1,4 +1,4 @@ -t6264.scala:3: warning: non-variable type argument Tuple1[_] in type Tuple2[_, Tuple1[_]] is unchecked since it is eliminated by erasure +t6264.scala:4: warning: non-variable type argument Tuple1[_] in type Tuple2[_, Tuple1[_]] is unchecked since it is eliminated by erasure x.isInstanceOf[Tuple2[_, Tuple1[_]]] ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t6264.flags b/test/files/neg/t6264.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t6264.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t6264.scala b/test/files/neg/t6264.scala index dc3b72793443..52885eb58ca3 100644 --- a/test/files/neg/t6264.scala +++ b/test/files/neg/t6264.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class Foo { def foo(x: AnyRef): Unit = { x.isInstanceOf[Tuple2[_, Tuple1[_]]] diff --git a/test/files/neg/t6276.check b/test/files/neg/t6276.check index f275de9d0a74..e4bad9a5f833 100644 --- a/test/files/neg/t6276.check +++ b/test/files/neg/t6276.check @@ -1,19 +1,19 @@ -t6276.scala:4: warning: method a in class C does nothing other than call itself recursively +t6276.scala:5: warning: method a in class C does nothing other than call itself recursively def a: Any = a // warn ^ -t6276.scala:5: warning: value b in class C does nothing other than call itself recursively +t6276.scala:6: warning: value b in class C does nothing other than call itself recursively val b: Any = b // warn ^ -t6276.scala:7: warning: method c in class C does nothing other than call itself recursively +t6276.scala:8: warning: method c in class C does nothing other than call itself recursively def c: Any = this.c // warn ^ -t6276.scala:8: warning: method d in class C does nothing other than call itself recursively +t6276.scala:9: warning: method d in class C does nothing other than call itself recursively def d: Any = C.this.d // warn ^ -t6276.scala:13: warning: method a does nothing other than call itself recursively +t6276.scala:14: warning: method a does nothing other than call itself recursively def a: Any = a // warn ^ -t6276.scala:22: warning: method a does nothing other than call itself recursively +t6276.scala:23: warning: method a does nothing other than call itself recursively def a = a // warn ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t6276.flags b/test/files/neg/t6276.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t6276.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t6276.scala b/test/files/neg/t6276.scala index bd0a473f71a4..150bc3a57500 100644 --- a/test/files/neg/t6276.scala +++ b/test/files/neg/t6276.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { def foo(a: Int, b: Int, c: Int) { class C { diff --git a/test/files/neg/t6289.flags b/test/files/neg/t6289.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t6289.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t6289/SUT_5.scala b/test/files/neg/t6289/SUT_5.scala index 0a996352c039..971f87ad75bd 100644 --- a/test/files/neg/t6289/SUT_5.scala +++ b/test/files/neg/t6289/SUT_5.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings /** The System Under Test. * We bail on the earlier round that generates the first error. diff --git a/test/files/neg/t6323a.check b/test/files/neg/t6323a.check index c4e92d93f00b..b0368fa1b43f 100644 --- a/test/files/neg/t6323a.check +++ b/test/files/neg/t6323a.check @@ -1,15 +1,15 @@ -t6323a.scala:10: materializing requested scala.reflect.type.ClassTag[Test] using scala.reflect.`package`.materializeClassTag[Test]() +t6323a.scala:11: materializing requested scala.reflect.type.ClassTag[Test] using scala.reflect.`package`.materializeClassTag[Test]() val lookAtMe = m.reflect(Test("a",List(5))) ^ -t6323a.scala:11: materializing requested reflect.runtime.universe.type.TypeTag[Test] using scala.reflect.api.`package`.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) +t6323a.scala:12: materializing requested reflect.runtime.universe.type.TypeTag[Test] using scala.reflect.api.`package`.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) val value = u.typeOf[Test] ^ -t6323a.scala:11: scala.reflect.api.`package`.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) is not a valid implicit value for reflect.runtime.universe.TypeTag[Test] because: +t6323a.scala:12: scala.reflect.api.`package`.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) is not a valid implicit value for reflect.runtime.universe.TypeTag[Test] because: failed to typecheck the materialized tag: cannot create a TypeTag referring to class Test.Test local to the reifee: use WeakTypeTag instead val value = u.typeOf[Test] ^ -t6323a.scala:11: error: No TypeTag available for Test +t6323a.scala:12: error: No TypeTag available for Test val value = u.typeOf[Test] ^ one error found diff --git a/test/files/neg/t6323a.flags b/test/files/neg/t6323a.flags deleted file mode 100644 index 4c6cdb71e2fa..000000000000 --- a/test/files/neg/t6323a.flags +++ /dev/null @@ -1 +0,0 @@ --Xlog-implicits \ No newline at end of file diff --git a/test/files/neg/t6323a.scala b/test/files/neg/t6323a.scala index a203167f3c1e..fb2721987404 100644 --- a/test/files/neg/t6323a.scala +++ b/test/files/neg/t6323a.scala @@ -1,3 +1,4 @@ +// scalac: -Xlog-implicits import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => m} import scala.reflect.runtime.{universe => u} @@ -18,4 +19,4 @@ object Test extends App { case ScalaReflectionException(msg) => println(msg) } } -} \ No newline at end of file +} diff --git a/test/files/neg/t6406-regextract.check b/test/files/neg/t6406-regextract.check index 41b362f455da..2200f15cb587 100644 --- a/test/files/neg/t6406-regextract.check +++ b/test/files/neg/t6406-regextract.check @@ -1,4 +1,4 @@ -t6406-regextract.scala:4: warning: method unapplySeq in class Regex is deprecated (since 2.11.0): extracting a match result from anything but a CharSequence or Match is deprecated +t6406-regextract.scala:5: warning: method unapplySeq in class Regex is deprecated (since 2.11.0): extracting a match result from anything but a CharSequence or Match is deprecated List(1) collect { case r(i) => i } ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t6406-regextract.flags b/test/files/neg/t6406-regextract.flags deleted file mode 100644 index 7de3c0f3eea0..000000000000 --- a/test/files/neg/t6406-regextract.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -deprecation diff --git a/test/files/neg/t6406-regextract.scala b/test/files/neg/t6406-regextract.scala index 0f5dad908d4b..e1e2cc5f7b70 100644 --- a/test/files/neg/t6406-regextract.scala +++ b/test/files/neg/t6406-regextract.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -deprecation object Test extends App { val r = "(\\d+)".r diff --git a/test/files/neg/t6446-additional/sample_2.flags b/test/files/neg/t6446-additional/sample_2.flags deleted file mode 100644 index 4d518c228611..000000000000 --- a/test/files/neg/t6446-additional/sample_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. -Xshow-phases diff --git a/test/files/neg/t6446-additional/sample_2.scala b/test/files/neg/t6446-additional/sample_2.scala index 73cdc64e40fb..9f8c68433fd1 100644 --- a/test/files/neg/t6446-additional/sample_2.scala +++ b/test/files/neg/t6446-additional/sample_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Xshow-phases package sample diff --git a/test/files/neg/t6446-list/sample_2.flags b/test/files/neg/t6446-list/sample_2.flags deleted file mode 100644 index 9cb3232964fb..000000000000 --- a/test/files/neg/t6446-list/sample_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. -Xplugin-list diff --git a/test/files/neg/t6446-list/sample_2.scala b/test/files/neg/t6446-list/sample_2.scala index 73cdc64e40fb..734aa63b38cc 100644 --- a/test/files/neg/t6446-list/sample_2.scala +++ b/test/files/neg/t6446-list/sample_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Xplugin-list package sample diff --git a/test/files/neg/t6446-missing/sample_2.flags b/test/files/neg/t6446-missing/sample_2.flags deleted file mode 100644 index 4d518c228611..000000000000 --- a/test/files/neg/t6446-missing/sample_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. -Xshow-phases diff --git a/test/files/neg/t6446-missing/sample_2.scala b/test/files/neg/t6446-missing/sample_2.scala index 73cdc64e40fb..9f8c68433fd1 100644 --- a/test/files/neg/t6446-missing/sample_2.scala +++ b/test/files/neg/t6446-missing/sample_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Xshow-phases package sample diff --git a/test/files/neg/t6446-show-phases.flags b/test/files/neg/t6446-show-phases.flags deleted file mode 100644 index 845666e100da..000000000000 --- a/test/files/neg/t6446-show-phases.flags +++ /dev/null @@ -1 +0,0 @@ --Xshow-phases diff --git a/test/files/neg/t6446-show-phases.scala b/test/files/neg/t6446-show-phases.scala index a9afb042d251..1dbc96a49097 100644 --- a/test/files/neg/t6446-show-phases.scala +++ b/test/files/neg/t6446-show-phases.scala @@ -1,3 +1,4 @@ +// scalac: -Xshow-phases // testing compiler flag output only object Test extends App diff --git a/test/files/neg/t6534.check b/test/files/neg/t6534.check index c2e80b377a9b..1daa81176a5d 100644 --- a/test/files/neg/t6534.check +++ b/test/files/neg/t6534.check @@ -1,10 +1,10 @@ -t6534.scala:6: error: redefinition of equals method. See SIP-15, criterion 4. is not allowed in value class +t6534.scala:7: error: redefinition of equals method. See SIP-15, criterion 4. is not allowed in value class class Bippy3(val x: Int) extends AnyVal { override def equals(x: Any) = false } // error ^ -t6534.scala:7: error: redefinition of hashCode method. See SIP-15, criterion 4. is not allowed in value class +t6534.scala:8: error: redefinition of hashCode method. See SIP-15, criterion 4. is not allowed in value class class Bippy4(val x: Int) extends AnyVal { override def hashCode = -1 } // error ^ -t6534.scala:9: error: redefinition of equals method. See SIP-15, criterion 4. is not allowed in value class +t6534.scala:10: error: redefinition of equals method. See SIP-15, criterion 4. is not allowed in value class case class Bippy6(val x: Int) extends AnyVal { override def productPrefix = "Dingo" ; override def equals(x: Any) = false } // error ^ three errors found diff --git a/test/files/neg/t6534.flags b/test/files/neg/t6534.flags deleted file mode 100644 index 1008b0a70c76..000000000000 --- a/test/files/neg/t6534.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint diff --git a/test/files/neg/t6534.scala b/test/files/neg/t6534.scala index de588b69a7c2..11b8bf9d908d 100644 --- a/test/files/neg/t6534.scala +++ b/test/files/neg/t6534.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint trait Foo extends Any { override def equals(x: Any) = false } trait Ding extends Any { override def hashCode = -1 } diff --git a/test/files/neg/t6567.check b/test/files/neg/t6567.check index f42f157371e0..bca1e7008cb6 100644 --- a/test/files/neg/t6567.check +++ b/test/files/neg/t6567.check @@ -1,7 +1,7 @@ -t6567.scala:8: warning: Suspicious application of an implicit view (Test.this.a2b) in the argument to Option.apply. +t6567.scala:9: warning: Suspicious application of an implicit view (Test.this.a2b) in the argument to Option.apply. Option[B](a) ^ -t6567.scala:10: warning: Suspicious application of an implicit view (Test.this.a2b) in the argument to Option.apply. +t6567.scala:11: warning: Suspicious application of an implicit view (Test.this.a2b) in the argument to Option.apply. val b: Option[B] = Option(a) ^ warning: there was one feature warning; re-run with -feature for details diff --git a/test/files/neg/t6567.flags b/test/files/neg/t6567.flags deleted file mode 100644 index 076333a0115d..000000000000 --- a/test/files/neg/t6567.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint:option-implicit -Xfatal-warnings diff --git a/test/files/neg/t6567.scala b/test/files/neg/t6567.scala index 650e5e39ae07..9a70a56d343b 100644 --- a/test/files/neg/t6567.scala +++ b/test/files/neg/t6567.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint:option-implicit -Xfatal-warnings class A class B diff --git a/test/files/neg/t6582_exhaust_big.check b/test/files/neg/t6582_exhaust_big.check index 9e2be038b59c..0d0818db38d5 100644 --- a/test/files/neg/t6582_exhaust_big.check +++ b/test/files/neg/t6582_exhaust_big.check @@ -1,4 +1,4 @@ -t6582_exhaust_big.scala:27: warning: match may not be exhaustive. +t6582_exhaust_big.scala:28: warning: match may not be exhaustive. It would fail on the following input: Z11() def foo(z: Z) = z match { ^ diff --git a/test/files/neg/t6582_exhaust_big.flags b/test/files/neg/t6582_exhaust_big.flags deleted file mode 100644 index b5a874865273..000000000000 --- a/test/files/neg/t6582_exhaust_big.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -unchecked diff --git a/test/files/neg/t6582_exhaust_big.scala b/test/files/neg/t6582_exhaust_big.scala index dd639eb56ee0..8d74bacc44de 100644 --- a/test/files/neg/t6582_exhaust_big.scala +++ b/test/files/neg/t6582_exhaust_big.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -unchecked sealed abstract class Z object Z { object Z0 extends Z diff --git a/test/files/neg/t6666.check b/test/files/neg/t6666.check index 5bfdcfb262aa..7d9c1497098b 100644 --- a/test/files/neg/t6666.check +++ b/test/files/neg/t6666.check @@ -1,37 +1,37 @@ -t6666.scala:23: error: Implementation restriction: access of method x$2 in object O1 from <$anon: Function0>, would require illegal premature access to object O1 +t6666.scala:24: error: Implementation restriction: access of method x$2 in object O1 from <$anon: Function0>, would require illegal premature access to object O1 F.byname(x) ^ -t6666.scala:30: error: Implementation restriction: access of lazy value x$3 in object O2 from <$anon: Function0>, would require illegal premature access to object O2 +t6666.scala:31: error: Implementation restriction: access of lazy value x$3 in object O2 from <$anon: Function0>, would require illegal premature access to object O2 F.byname(x) ^ -t6666.scala:37: error: Implementation restriction: access of method x$4 in object O3 from <$anon: Function0>, would require illegal premature access to object O3 +t6666.scala:38: error: Implementation restriction: access of method x$4 in object O3 from <$anon: Function0>, would require illegal premature access to object O3 F.hof(() => x) ^ -t6666.scala:50: error: Implementation restriction: access of method x$6 in class C1 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class C1 +t6666.scala:51: error: Implementation restriction: access of method x$6 in class C1 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class C1 F.byname(x) ^ -t6666.scala:54: error: Implementation restriction: access of lazy value x$7 in class C2 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class C2 +t6666.scala:55: error: Implementation restriction: access of lazy value x$7 in class C2 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class C2 F.byname(x) ^ -t6666.scala:58: error: Implementation restriction: access of method x$8 in class C3 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class C3 +t6666.scala:59: error: Implementation restriction: access of method x$8 in class C3 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class C3 F.hof(() => x) ^ -t6666.scala:62: error: Implementation restriction: access of method x$9 in class C4 from object Nested$1, would require illegal premature access to the unconstructed `this` of class C4 +t6666.scala:63: error: Implementation restriction: access of method x$9 in class C4 from object Nested$1, would require illegal premature access to the unconstructed `this` of class C4 object Nested { def xx = x} ^ -t6666.scala:76: error: Implementation restriction: access of method x$11 in class C11 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class C11 +t6666.scala:77: error: Implementation restriction: access of method x$11 in class C11 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class C11 F.byname(x) ^ -t6666.scala:95: error: Implementation restriction: access of method x$12 in class C13 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class C13 +t6666.scala:96: error: Implementation restriction: access of method x$12 in class C13 from <$anon: Function0>, would require illegal premature access to the unconstructed `this` of class C13 F.hof(() => x) ^ -t6666.scala:104: error: Implementation restriction: access of method x$13 in class C14 from object Nested$3, would require illegal premature access to the unconstructed `this` of class C14 +t6666.scala:105: error: Implementation restriction: access of method x$13 in class C14 from object Nested$3, would require illegal premature access to the unconstructed `this` of class C14 object Nested { def xx = x} ^ -t6666.scala:112: error: Implementation restriction: access of method foo$1 in class COuter from class CInner$1, would require illegal premature access to the unconstructed `this` of class COuter +t6666.scala:113: error: Implementation restriction: access of method foo$1 in class COuter from class CInner$1, would require illegal premature access to the unconstructed `this` of class COuter class CInner extends C({foo}) ^ -t6666.scala:118: error: Implementation restriction: access of method x$14 in class CEarly from object Nested$5, would require illegal premature access to the unconstructed `this` of class CEarly +t6666.scala:119: error: Implementation restriction: access of method x$14 in class CEarly from object Nested$5, would require illegal premature access to the unconstructed `this` of class CEarly object Nested { def xx = x} ^ 12 errors found diff --git a/test/files/neg/t6666.flags b/test/files/neg/t6666.flags deleted file mode 100644 index 2349d8294d80..000000000000 --- a/test/files/neg/t6666.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:inline diff --git a/test/files/neg/t6666.scala b/test/files/neg/t6666.scala index 58c5be540586..86c0b8299228 100644 --- a/test/files/neg/t6666.scala +++ b/test/files/neg/t6666.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:inline class C(a: Any) object F { def byname(a: => Any) = println(a) @@ -118,4 +119,4 @@ class CEarly(a: Any) extends { object Nested { def xx = x} Nested.xx } -} with AnyRef \ No newline at end of file +} with AnyRef diff --git a/test/files/neg/t6666c.check b/test/files/neg/t6666c.check index d695fe72b986..69df9a876758 100644 --- a/test/files/neg/t6666c.check +++ b/test/files/neg/t6666c.check @@ -1,10 +1,10 @@ -t6666c.scala:2: error: Implementation restriction: access of method x$1 in class D from object X$1, would require illegal premature access to the unconstructed `this` of class D +t6666c.scala:3: error: Implementation restriction: access of method x$1 in class D from object X$1, would require illegal premature access to the unconstructed `this` of class D class D extends C({def x = 0; object X { x }}) ^ -t6666c.scala:5: error: Implementation restriction: access of method x$2 in class D1 from object X$3, would require illegal premature access to the unconstructed `this` of class D1 +t6666c.scala:6: error: Implementation restriction: access of method x$2 in class D1 from object X$3, would require illegal premature access to the unconstructed `this` of class D1 class D1 extends C1({def x = 0; () => {object X { x }}}) ^ -t6666c.scala:8: error: Implementation restriction: access of method x$3 from object X$5, would require illegal premature access to the unconstructed `this` of <$anon: Function0> +t6666c.scala:9: error: Implementation restriction: access of method x$3 from object X$5, would require illegal premature access to the unconstructed `this` of <$anon: Function0> class D2 extends C2({def x = 0; object X { x }}) ^ three errors found diff --git a/test/files/neg/t6666c.flags b/test/files/neg/t6666c.flags deleted file mode 100644 index 2349d8294d80..000000000000 --- a/test/files/neg/t6666c.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:inline diff --git a/test/files/neg/t6666c.scala b/test/files/neg/t6666c.scala index 76cc358307a5..90f26565ba4c 100644 --- a/test/files/neg/t6666c.scala +++ b/test/files/neg/t6666c.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:inline class C(a: Any) class D extends C({def x = 0; object X { x }}) diff --git a/test/files/neg/t6675.check b/test/files/neg/t6675.check index 0a13ddf6b1f4..9b1e1352800a 100644 --- a/test/files/neg/t6675.check +++ b/test/files/neg/t6675.check @@ -1,4 +1,4 @@ -t6675.scala:10: warning: object X expects 3 patterns to hold (Int, Int, Int) but crushing into 3-tuple to fit single pattern (scala/bug#6675) +t6675.scala:11: warning: object X expects 3 patterns to hold (Int, Int, Int) but crushing into 3-tuple to fit single pattern (scala/bug#6675) "" match { case X(b) => b } // should warn under -Xlint. Not an error because of scala/bug#6111 ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t6675.flags b/test/files/neg/t6675.flags deleted file mode 100644 index c6bfaf1f64a4..000000000000 --- a/test/files/neg/t6675.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings diff --git a/test/files/neg/t6675.scala b/test/files/neg/t6675.scala index 9b69e7eba641..0b9f86e48b6a 100644 --- a/test/files/neg/t6675.scala +++ b/test/files/neg/t6675.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings object X { def unapply(s: String): Option[(Int,Int,Int)] = Some((1,2,3)) } diff --git a/test/files/neg/t6675b.check b/test/files/neg/t6675b.check index 9de595a13bd7..0f8e6aad8cee 100644 --- a/test/files/neg/t6675b.check +++ b/test/files/neg/t6675b.check @@ -1,34 +1,34 @@ -t6675b.scala:17: warning: object LeftOrRight expects 2 patterns to hold (Int, Int) but crushing into 2-tuple to fit single pattern (scala/bug#6675) +t6675b.scala:18: warning: object LeftOrRight expects 2 patterns to hold (Int, Int) but crushing into 2-tuple to fit single pattern (scala/bug#6675) def f1 = (Left((0, 0)): Either[(Int, Int), (Int, Int)]) match { case LeftOrRight(a) => a } // warn ^ -t6675b.scala:19: error: constructor cannot be instantiated to expected type; +t6675b.scala:20: error: constructor cannot be instantiated to expected type; found : (T1, T2, T3) required: (Int, Int) def f3 = (Left((0, 0)): Either[(Int, Int), (Int, Int)]) match { case LeftOrRight((a, b, c)) => a } // fail ^ -t6675b.scala:24: warning: object LeftOrRight expects 2 patterns to hold (A, A) but crushing into 2-tuple to fit single pattern (scala/bug#6675) +t6675b.scala:25: warning: object LeftOrRight expects 2 patterns to hold (A, A) but crushing into 2-tuple to fit single pattern (scala/bug#6675) def f2[A](x: A) = (Left(x -> x): Either[(A, A), (A, A)]) match { case LeftOrRight(a) => a } // warn ^ -t6675b.scala:26: error: constructor cannot be instantiated to expected type; +t6675b.scala:27: error: constructor cannot be instantiated to expected type; found : (T1, T2, T3) required: (?A1, ?A2) where type ?A2 <: A (this is a GADT skolem), type ?A1 <: A (this is a GADT skolem) def f4[A](x: A) = (Left(x -> x): Either[(A, A), (A, A)]) match { case LeftOrRight((a, b, c)) => a } // fail ^ -t6675b.scala:30: warning: object NativelyTwo expects 2 patterns to hold ((Int, Int), (Int, Int)) but crushing into 2-tuple to fit single pattern (scala/bug#6675) +t6675b.scala:31: warning: object NativelyTwo expects 2 patterns to hold ((Int, Int), (Int, Int)) but crushing into 2-tuple to fit single pattern (scala/bug#6675) def f1 = (Left((0, 0)): Either[(Int, Int), (Int, Int)]) match { case NativelyTwo(a) => a } // warn ^ -t6675b.scala:32: error: constructor cannot be instantiated to expected type; +t6675b.scala:33: error: constructor cannot be instantiated to expected type; found : (T1, T2, T3) required: ((Int, Int), (Int, Int)) def f3 = (Left((0, 0)): Either[(Int, Int), (Int, Int)]) match { case NativelyTwo((a, b, c)) => a } // fail ^ -t6675b.scala:36: warning: object NativelyTwo expects 2 patterns to hold (A, A) but crushing into 2-tuple to fit single pattern (scala/bug#6675) +t6675b.scala:37: warning: object NativelyTwo expects 2 patterns to hold (A, A) but crushing into 2-tuple to fit single pattern (scala/bug#6675) def f1[A](x: A) = (Left(x): Either[A, A]) match { case NativelyTwo(a) => a } // warn ^ -t6675b.scala:37: warning: object NativelyTwo expects 2 patterns to hold ((A, A), (A, A)) but crushing into 2-tuple to fit single pattern (scala/bug#6675) +t6675b.scala:38: warning: object NativelyTwo expects 2 patterns to hold ((A, A), (A, A)) but crushing into 2-tuple to fit single pattern (scala/bug#6675) def f2[A](x: A) = (Left(x -> x): Either[(A, A), (A, A)]) match { case NativelyTwo(a) => a } // warn ^ -t6675b.scala:39: error: constructor cannot be instantiated to expected type; +t6675b.scala:40: error: constructor cannot be instantiated to expected type; found : (T1, T2, T3) required: ((?A1, ?A2), (?A3, ?A4)) where type ?A4 <: A (this is a GADT skolem), type ?A3 <: A (this is a GADT skolem), type ?A2 <: A (this is a GADT skolem), type ?A1 <: A (this is a GADT skolem) def f4[A](x: A) = (Left(x -> x): Either[(A, A), (A, A)]) match { case NativelyTwo((a, b, c)) => a } // fail diff --git a/test/files/neg/t6675b.flags b/test/files/neg/t6675b.flags deleted file mode 100644 index 2fcfa0cddb13..000000000000 --- a/test/files/neg/t6675b.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xlint diff --git a/test/files/neg/t6675b.scala b/test/files/neg/t6675b.scala index da27e1b91f7b..475bb8a2ece1 100644 --- a/test/files/neg/t6675b.scala +++ b/test/files/neg/t6675b.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xlint object LeftOrRight { def unapply[A](value: Either[A, A]): Option[A] = value match { case scala.Left(x) => Some(x) diff --git a/test/files/neg/t6680a.check b/test/files/neg/t6680a.check index 03e4df10c121..0b28ddff344a 100644 --- a/test/files/neg/t6680a.check +++ b/test/files/neg/t6680a.check @@ -1,9 +1,9 @@ -t6680a.scala:10: error: type mismatch; +t6680a.scala:11: error: type mismatch; found : String("abc") required: A y.x = "abc" ^ -t6680a.scala:17: error: type mismatch; +t6680a.scala:18: error: type mismatch; found : String("") required: A case class C[A](f:A=>A);def f(x:Any)=x match { case C(f)=>f("") };f(C[Int](x=>x)) diff --git a/test/files/neg/t6680a.flags b/test/files/neg/t6680a.flags deleted file mode 100644 index 19243266d108..000000000000 --- a/test/files/neg/t6680a.flags +++ /dev/null @@ -1 +0,0 @@ --Xstrict-inference \ No newline at end of file diff --git a/test/files/neg/t6680a.scala b/test/files/neg/t6680a.scala index 93b796438fb9..5a6ed86136ce 100644 --- a/test/files/neg/t6680a.scala +++ b/test/files/neg/t6680a.scala @@ -1,3 +1,4 @@ +// scalac: -Xstrict-inference case class Cell[A](var x: A) object Test { def f1(x: Any) = x match { case y @ Cell(_) => y } // Inferred type is Cell[Any] diff --git a/test/files/neg/t6902.check b/test/files/neg/t6902.check index ed0ed7530326..82173360ba53 100644 --- a/test/files/neg/t6902.check +++ b/test/files/neg/t6902.check @@ -1,10 +1,10 @@ -t6902.scala:4: warning: unreachable code +t6902.scala:5: warning: unreachable code case Some(b) => 3 // no warning was emitted ^ -t6902.scala:9: warning: unreachable code +t6902.scala:10: warning: unreachable code case Some(b) => 3 // no warning was emitted ^ -t6902.scala:21: warning: unreachable code +t6902.scala:22: warning: unreachable code case 1 => 3 // crash ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t6902.flags b/test/files/neg/t6902.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t6902.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t6902.scala b/test/files/neg/t6902.scala index ad0933e7d4c9..381512757231 100644 --- a/test/files/neg/t6902.scala +++ b/test/files/neg/t6902.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { Some(Some(1)) collect { case Some(a) => 2 diff --git a/test/files/neg/t6963a.check b/test/files/neg/t6963a.check index 5858e7740abe..8042116140fa 100644 --- a/test/files/neg/t6963a.check +++ b/test/files/neg/t6963a.check @@ -1,4 +1,4 @@ -t6963a.scala:4: warning: method scanRight in trait TraversableLike has changed semantics in version 2.9.0: +t6963a.scala:5: warning: method scanRight in trait TraversableLike has changed semantics in version 2.9.0: The behavior of `scanRight` has changed. The previous behavior can be reproduced with scanRight.reverse. List(1,2,3,4,5).scanRight(0)(_+_) ^ diff --git a/test/files/neg/t6963a.flags b/test/files/neg/t6963a.flags deleted file mode 100644 index 4c61ed9430d1..000000000000 --- a/test/files/neg/t6963a.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xmigration:2.7 diff --git a/test/files/neg/t6963a.scala b/test/files/neg/t6963a.scala index 6808e541bb9d..db41f6d96b23 100644 --- a/test/files/neg/t6963a.scala +++ b/test/files/neg/t6963a.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xmigration:2.7 object Test { import scala.collection.mutable._ diff --git a/test/files/neg/t7014.flags b/test/files/neg/t7014.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t7014.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t7014/t7014_2.scala b/test/files/neg/t7014/t7014_2.scala index 4845fc9a5d67..62a053b9ebb5 100644 --- a/test/files/neg/t7014/t7014_2.scala +++ b/test/files/neg/t7014/t7014_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings package t7014 import ThreadSafetyLevel_1.COMPLETELY_THREADSAFE // refer to annotation so it gets parsed diff --git a/test/files/neg/t7020.check b/test/files/neg/t7020.check index 76390b243ddc..3116600c7999 100644 --- a/test/files/neg/t7020.check +++ b/test/files/neg/t7020.check @@ -1,16 +1,16 @@ -t7020.scala:3: warning: match may not be exhaustive. +t7020.scala:4: warning: match may not be exhaustive. It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List((x: Int forSome x not in (1, 2, 4, 5, 6, 7)), _), List(1, _), List(2, _), List(4, _), List(5, _), List(6, _), List(7, _), List(_, _) List(5) match { ^ -t7020.scala:10: warning: match may not be exhaustive. +t7020.scala:11: warning: match may not be exhaustive. It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List((x: Int forSome x not in (1, 2, 4, 5, 6, 7)), _), List(1, _), List(2, _), List(4, _), List(5, _), List(6, _), List(7, _), List(_, _) List(5) match { ^ -t7020.scala:17: warning: match may not be exhaustive. +t7020.scala:18: warning: match may not be exhaustive. It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List((x: Int forSome x not in (1, 2, 4, 5, 6, 7)), _), List(1, _), List(2, _), List(4, _), List(5, _), List(6, _), List(7, _), List(_, _) List(5) match { ^ -t7020.scala:24: warning: match may not be exhaustive. +t7020.scala:25: warning: match may not be exhaustive. It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List((x: Int forSome x not in (1, 2, 4, 5, 6, 7)), _), List(1, _), List(2, _), List(4, _), List(5, _), List(6, _), List(7, _), List(_, _) List(5) match { ^ diff --git a/test/files/neg/t7020.flags b/test/files/neg/t7020.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t7020.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t7020.scala b/test/files/neg/t7020.scala index cc5421bab177..e82e396373f8 100644 --- a/test/files/neg/t7020.scala +++ b/test/files/neg/t7020.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { // warning was non-deterministic List(5) match { diff --git a/test/files/neg/t7110.check b/test/files/neg/t7110.check index e484dc432551..e7dc25f6d715 100644 --- a/test/files/neg/t7110.check +++ b/test/files/neg/t7110.check @@ -1,4 +1,4 @@ -t7110.scala:2: warning: A try without a catch or finally is equivalent to putting its body in a block; no exceptions are handled. +t7110.scala:3: warning: A try without a catch or finally is equivalent to putting its body in a block; no exceptions are handled. try { ??? } // warn ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t7110.flags b/test/files/neg/t7110.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t7110.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t7110.scala b/test/files/neg/t7110.scala index 79ac32521619..b005b4ebf216 100644 --- a/test/files/neg/t7110.scala +++ b/test/files/neg/t7110.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { try { ??? } // warn diff --git a/test/files/neg/t7171.check b/test/files/neg/t7171.check index 2de91514837c..a24b2e5ae8b6 100644 --- a/test/files/neg/t7171.check +++ b/test/files/neg/t7171.check @@ -1,7 +1,7 @@ -t7171.scala:2: warning: The outer reference in this type test cannot be checked at run time. +t7171.scala:3: warning: The outer reference in this type test cannot be checked at run time. final case class A() ^ -t7171.scala:9: warning: The outer reference in this type test cannot be checked at run time. +t7171.scala:10: warning: The outer reference in this type test cannot be checked at run time. case _: A => true; case _ => false ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t7171.flags b/test/files/neg/t7171.flags deleted file mode 100644 index 464cc20ea684..000000000000 --- a/test/files/neg/t7171.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -unchecked \ No newline at end of file diff --git a/test/files/neg/t7171.scala b/test/files/neg/t7171.scala index 534b2070a394..72770a913586 100644 --- a/test/files/neg/t7171.scala +++ b/test/files/neg/t7171.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -unchecked trait T { final case class A() diff --git a/test/files/neg/t7171b.check b/test/files/neg/t7171b.check index 6b05b6fa63c7..e2c089293a8d 100644 --- a/test/files/neg/t7171b.check +++ b/test/files/neg/t7171b.check @@ -1,10 +1,10 @@ -t7171b.scala:2: warning: The outer reference in this type test cannot be checked at run time. +t7171b.scala:3: warning: The outer reference in this type test cannot be checked at run time. final case class A() ^ -t7171b.scala:8: warning: The outer reference in this type test cannot be checked at run time. +t7171b.scala:9: warning: The outer reference in this type test cannot be checked at run time. case _: A => true; case _ => false ^ -t7171b.scala:13: warning: The outer reference in this type test cannot be checked at run time. +t7171b.scala:14: warning: The outer reference in this type test cannot be checked at run time. case _: A => true; case _ => false ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t7171b.flags b/test/files/neg/t7171b.flags deleted file mode 100644 index 464cc20ea684..000000000000 --- a/test/files/neg/t7171b.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -unchecked \ No newline at end of file diff --git a/test/files/neg/t7171b.scala b/test/files/neg/t7171b.scala index 53c7787f8b57..333a5db85db5 100644 --- a/test/files/neg/t7171b.scala +++ b/test/files/neg/t7171b.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -unchecked trait T { final case class A() } diff --git a/test/files/neg/t7187.check b/test/files/neg/t7187.check index f6a03e81a615..5a19b59dc2d1 100644 --- a/test/files/neg/t7187.check +++ b/test/files/neg/t7187.check @@ -1,20 +1,20 @@ -t7187.scala:8: error: _ must follow method; cannot follow () => String +t7187.scala:9: error: _ must follow method; cannot follow () => String val t1f: Any = foo() _ // error: _ must follow method ^ -t7187.scala:11: error: type mismatch; +t7187.scala:12: error: type mismatch; found : String required: () => Any val t2a: () => Any = bar // error: no eta-expansion of zero-arglist-methods ^ -t7187.scala:12: error: not enough arguments for method apply: (index: Int)Char in class StringOps. +t7187.scala:13: error: not enough arguments for method apply: (index: Int)Char in class StringOps. Unspecified value parameter index. val t2b: () => Any = bar() // error: bar doesn't take arguments, so expanded to bar.apply(), which misses an argument ^ -t7187.scala:15: error: not enough arguments for method apply: (index: Int)Char in class StringOps. +t7187.scala:16: error: not enough arguments for method apply: (index: Int)Char in class StringOps. Unspecified value parameter index. val t2e: Any = bar() _ // error: not enough arguments for method apply ^ -t7187.scala:21: error: _ must follow method; cannot follow String +t7187.scala:22: error: _ must follow method; cannot follow String val t3d: Any = baz() _ // error: _ must follow method ^ 5 errors found diff --git a/test/files/neg/t7187.flags b/test/files/neg/t7187.flags deleted file mode 100644 index c6bfaf1f64a4..000000000000 --- a/test/files/neg/t7187.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings diff --git a/test/files/neg/t7187.scala b/test/files/neg/t7187.scala index 62f86dc51696..702a32298cc1 100644 --- a/test/files/neg/t7187.scala +++ b/test/files/neg/t7187.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings class EtaExpandZeroArg { def foo(): () => String = () => "" val t1a: () => Any = foo() // ok (obviously) diff --git a/test/files/neg/t7285.check b/test/files/neg/t7285.check index a38772bead22..468ee90f69b5 100644 --- a/test/files/neg/t7285.check +++ b/test/files/neg/t7285.check @@ -1,12 +1,12 @@ -t7285.scala:15: warning: match may not be exhaustive. +t7285.scala:16: warning: match may not be exhaustive. It would fail on the following input: (Up, Down) (d1, d2) match { ^ -t7285.scala:33: warning: match may not be exhaustive. +t7285.scala:34: warning: match may not be exhaustive. It would fail on the following input: Down (d1) match { ^ -t7285.scala:51: warning: match may not be exhaustive. +t7285.scala:52: warning: match may not be exhaustive. It would fail on the following input: (Up, Down) (d1, d2) match { ^ diff --git a/test/files/neg/t7285.flags b/test/files/neg/t7285.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t7285.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t7285.scala b/test/files/neg/t7285.scala index 14121d92b1b3..46cd98cfc36b 100644 --- a/test/files/neg/t7285.scala +++ b/test/files/neg/t7285.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed abstract class Base diff --git a/test/files/neg/t7290.check b/test/files/neg/t7290.check index ad2d0e25b01e..e7fd30c56ef3 100644 --- a/test/files/neg/t7290.check +++ b/test/files/neg/t7290.check @@ -1,10 +1,10 @@ -t7290.scala:4: warning: Pattern contains duplicate alternatives: 0 +t7290.scala:5: warning: Pattern contains duplicate alternatives: 0 case 0 | 0 => 0 ^ -t7290.scala:5: warning: Pattern contains duplicate alternatives: 2, 3 +t7290.scala:6: warning: Pattern contains duplicate alternatives: 2, 3 case 2 | 2 | 2 | 3 | 2 | 3 => 0 ^ -t7290.scala:6: warning: Pattern contains duplicate alternatives: 4 +t7290.scala:7: warning: Pattern contains duplicate alternatives: 4 case 4 | (_ @ 4) => 0 ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t7290.flags b/test/files/neg/t7290.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t7290.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t7290.scala b/test/files/neg/t7290.scala index b9db7f7e8a88..8bf0ae9c866d 100644 --- a/test/files/neg/t7290.scala +++ b/test/files/neg/t7290.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test extends App { val y = (0: Int) match { case 1 => 1 diff --git a/test/files/neg/t7292-deprecation.check b/test/files/neg/t7292-deprecation.check index 17f010dfdf33..4122f3b9a9a7 100644 --- a/test/files/neg/t7292-deprecation.check +++ b/test/files/neg/t7292-deprecation.check @@ -1,10 +1,10 @@ -t7292-deprecation.scala:2: warning: Octal escape literals are deprecated, use \u0000 instead. +t7292-deprecation.scala:3: warning: Octal escape literals are deprecated, use \u0000 instead. val chr1 = '\0' ^ -t7292-deprecation.scala:3: warning: Octal escape literals are deprecated, use \u0053 instead. +t7292-deprecation.scala:4: warning: Octal escape literals are deprecated, use \u0053 instead. val str1 = "abc\123456" ^ -t7292-deprecation.scala:4: warning: Octal escape literals are deprecated, use \n instead. +t7292-deprecation.scala:5: warning: Octal escape literals are deprecated, use \n instead. val lf = '\012' ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t7292-deprecation.flags b/test/files/neg/t7292-deprecation.flags deleted file mode 100644 index 7de3c0f3eea0..000000000000 --- a/test/files/neg/t7292-deprecation.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -deprecation diff --git a/test/files/neg/t7292-deprecation.scala b/test/files/neg/t7292-deprecation.scala index d857f0e1ecea..9b096948d253 100644 --- a/test/files/neg/t7292-deprecation.scala +++ b/test/files/neg/t7292-deprecation.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -deprecation object OctalEscapes { val chr1 = '\0' val str1 = "abc\123456" diff --git a/test/files/neg/t7292-removal.check b/test/files/neg/t7292-removal.check index 1cd59b099290..ce8a75a59f38 100644 --- a/test/files/neg/t7292-removal.check +++ b/test/files/neg/t7292-removal.check @@ -1,10 +1,10 @@ -t7292-removal.scala:2: error: Octal escape literals are unsupported, use \u0000 instead. +t7292-removal.scala:3: error: Octal escape literals are unsupported, use \u0000 instead. val chr1 = '\0' ^ -t7292-removal.scala:3: error: Octal escape literals are unsupported, use \u0053 instead. +t7292-removal.scala:4: error: Octal escape literals are unsupported, use \u0053 instead. val str1 = "abc\123456" ^ -t7292-removal.scala:4: error: Octal escape literals are unsupported, use \n instead. +t7292-removal.scala:5: error: Octal escape literals are unsupported, use \n instead. val lf = '\012' ^ three errors found diff --git a/test/files/neg/t7292-removal.flags b/test/files/neg/t7292-removal.flags deleted file mode 100644 index 29f4ede37ab4..000000000000 --- a/test/files/neg/t7292-removal.flags +++ /dev/null @@ -1 +0,0 @@ --Xfuture diff --git a/test/files/neg/t7292-removal.scala b/test/files/neg/t7292-removal.scala index d857f0e1ecea..6e86eb643b44 100644 --- a/test/files/neg/t7292-removal.scala +++ b/test/files/neg/t7292-removal.scala @@ -1,3 +1,4 @@ +// scalac: -Xfuture object OctalEscapes { val chr1 = '\0' val str1 = "abc\123456" diff --git a/test/files/neg/t7369.check b/test/files/neg/t7369.check index a4e99f496e1d..19c2aaadb1b8 100644 --- a/test/files/neg/t7369.check +++ b/test/files/neg/t7369.check @@ -1,13 +1,13 @@ -t7369.scala:6: warning: unreachable code +t7369.scala:7: warning: unreachable code case Tuple1(X) => // unreachable ^ -t7369.scala:13: warning: unreachable code +t7369.scala:14: warning: unreachable code case Tuple1(true) => // unreachable ^ -t7369.scala:31: warning: unreachable code +t7369.scala:32: warning: unreachable code case Tuple1(X) => // unreachable ^ -t7369.scala:40: warning: unreachable code +t7369.scala:41: warning: unreachable code case Tuple1(null) => // unreachable ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t7369.flags b/test/files/neg/t7369.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t7369.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t7369.scala b/test/files/neg/t7369.scala index 87ddfe98b7aa..d92b4ef2dcc4 100644 --- a/test/files/neg/t7369.scala +++ b/test/files/neg/t7369.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { val X, Y = true (null: Tuple1[Boolean]) match { diff --git a/test/files/neg/t7494-after-terminal/sample_2.flags b/test/files/neg/t7494-after-terminal/sample_2.flags deleted file mode 100644 index b8a476e361ce..000000000000 --- a/test/files/neg/t7494-after-terminal/sample_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. -Xplugin-require:afterterminal diff --git a/test/files/neg/t7494-after-terminal/sample_2.scala b/test/files/neg/t7494-after-terminal/sample_2.scala index 73cdc64e40fb..c0a457edbaca 100644 --- a/test/files/neg/t7494-after-terminal/sample_2.scala +++ b/test/files/neg/t7494-after-terminal/sample_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Xplugin-require:afterterminal package sample diff --git a/test/files/neg/t7494-before-parser/sample_2.flags b/test/files/neg/t7494-before-parser/sample_2.flags deleted file mode 100644 index 0c92fc8a06ea..000000000000 --- a/test/files/neg/t7494-before-parser/sample_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. -Xplugin-require:beforeparser diff --git a/test/files/neg/t7494-before-parser/sample_2.scala b/test/files/neg/t7494-before-parser/sample_2.scala index 73cdc64e40fb..0b6ab3526a82 100644 --- a/test/files/neg/t7494-before-parser/sample_2.scala +++ b/test/files/neg/t7494-before-parser/sample_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Xplugin-require:beforeparser package sample diff --git a/test/files/neg/t7494-multi-right-after/sample_2.flags b/test/files/neg/t7494-multi-right-after/sample_2.flags deleted file mode 100644 index 9273fb98d7bf..000000000000 --- a/test/files/neg/t7494-multi-right-after/sample_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. -Xplugin-require:multi-rafter diff --git a/test/files/neg/t7494-multi-right-after/sample_2.scala b/test/files/neg/t7494-multi-right-after/sample_2.scala index 73cdc64e40fb..6bf3bfdbefa2 100644 --- a/test/files/neg/t7494-multi-right-after/sample_2.scala +++ b/test/files/neg/t7494-multi-right-after/sample_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Xplugin-require:multi-rafter package sample diff --git a/test/files/neg/t7494-no-options/sample_2.flags b/test/files/neg/t7494-no-options/sample_2.flags deleted file mode 100644 index 7f0f7afe4883..000000000000 --- a/test/files/neg/t7494-no-options/sample_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. -Xshow-phases -P:ploogin:inploog diff --git a/test/files/neg/t7494-no-options/sample_2.scala b/test/files/neg/t7494-no-options/sample_2.scala index 73cdc64e40fb..46dfe4ee1ec9 100644 --- a/test/files/neg/t7494-no-options/sample_2.scala +++ b/test/files/neg/t7494-no-options/sample_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Xshow-phases -P:ploogin:inploog package sample diff --git a/test/files/neg/t7494-right-after-before/sample_2.flags b/test/files/neg/t7494-right-after-before/sample_2.flags deleted file mode 100644 index 97d0f5b5f6f7..000000000000 --- a/test/files/neg/t7494-right-after-before/sample_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. -Xplugin-require:rafter-before-1 diff --git a/test/files/neg/t7494-right-after-before/sample_2.scala b/test/files/neg/t7494-right-after-before/sample_2.scala index 73cdc64e40fb..46de4c345110 100644 --- a/test/files/neg/t7494-right-after-before/sample_2.scala +++ b/test/files/neg/t7494-right-after-before/sample_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Xplugin-require:rafter-before-1 package sample diff --git a/test/files/neg/t7494-right-after-terminal/sample_2.flags b/test/files/neg/t7494-right-after-terminal/sample_2.flags deleted file mode 100644 index da046ba5f170..000000000000 --- a/test/files/neg/t7494-right-after-terminal/sample_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. -Xplugin-require:rightafterterminal diff --git a/test/files/neg/t7494-right-after-terminal/sample_2.scala b/test/files/neg/t7494-right-after-terminal/sample_2.scala index 73cdc64e40fb..b599ee4d2127 100644 --- a/test/files/neg/t7494-right-after-terminal/sample_2.scala +++ b/test/files/neg/t7494-right-after-terminal/sample_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Xplugin-require:rightafterterminal package sample diff --git a/test/files/neg/t7605-deprecation.check b/test/files/neg/t7605-deprecation.check index 6db94613a103..d989472c1566 100644 --- a/test/files/neg/t7605-deprecation.check +++ b/test/files/neg/t7605-deprecation.check @@ -1,13 +1,13 @@ -t7605-deprecation.scala:2: warning: Procedure syntax is deprecated. Convert procedure `bar` to method by adding `: Unit =`. +t7605-deprecation.scala:3: warning: Procedure syntax is deprecated. Convert procedure `bar` to method by adding `: Unit =`. def bar {} ^ -t7605-deprecation.scala:3: warning: Procedure syntax is deprecated. Convert procedure `baz` to method by adding `: Unit`. +t7605-deprecation.scala:4: warning: Procedure syntax is deprecated. Convert procedure `baz` to method by adding `: Unit`. def baz ^ -t7605-deprecation.scala:4: warning: Procedure syntax is deprecated. Convert procedure `boo` to method by adding `: Unit`. +t7605-deprecation.scala:5: warning: Procedure syntax is deprecated. Convert procedure `boo` to method by adding `: Unit`. def boo(i: Int, l: Long) ^ -t7605-deprecation.scala:5: warning: Procedure syntax is deprecated. Convert procedure `boz` to method by adding `: Unit =`. +t7605-deprecation.scala:6: warning: Procedure syntax is deprecated. Convert procedure `boz` to method by adding `: Unit =`. def boz(i: Int, l: Long) {} ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t7605-deprecation.flags b/test/files/neg/t7605-deprecation.flags deleted file mode 100644 index 0a7cb7d20251..000000000000 --- a/test/files/neg/t7605-deprecation.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfuture -Xfatal-warnings diff --git a/test/files/neg/t7605-deprecation.scala b/test/files/neg/t7605-deprecation.scala index 2b3362f94ae9..7c2ae3ada797 100644 --- a/test/files/neg/t7605-deprecation.scala +++ b/test/files/neg/t7605-deprecation.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfuture -Xfatal-warnings abstract class Foo { def bar {} def baz diff --git a/test/files/neg/t7622-cyclic-dependency/sample_2.flags b/test/files/neg/t7622-cyclic-dependency/sample_2.flags deleted file mode 100644 index db25b88a1297..000000000000 --- a/test/files/neg/t7622-cyclic-dependency/sample_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. -Xplugin-require:cyclicdependency diff --git a/test/files/neg/t7622-cyclic-dependency/sample_2.scala b/test/files/neg/t7622-cyclic-dependency/sample_2.scala index 73cdc64e40fb..6424f913758c 100644 --- a/test/files/neg/t7622-cyclic-dependency/sample_2.scala +++ b/test/files/neg/t7622-cyclic-dependency/sample_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Xplugin-require:cyclicdependency package sample diff --git a/test/files/neg/t7622-missing-dependency/sample_2.flags b/test/files/neg/t7622-missing-dependency/sample_2.flags deleted file mode 100644 index d69035100e6b..000000000000 --- a/test/files/neg/t7622-missing-dependency/sample_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. -Xplugin-require:myplugin diff --git a/test/files/neg/t7622-missing-dependency/sample_2.scala b/test/files/neg/t7622-missing-dependency/sample_2.scala index 73cdc64e40fb..cd0aaf83b451 100644 --- a/test/files/neg/t7622-missing-dependency/sample_2.scala +++ b/test/files/neg/t7622-missing-dependency/sample_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Xplugin-require:myplugin package sample diff --git a/test/files/neg/t7622-missing-required.flags b/test/files/neg/t7622-missing-required.flags deleted file mode 100644 index 65deac6febd1..000000000000 --- a/test/files/neg/t7622-missing-required.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin-require:special-plugin diff --git a/test/files/neg/t7622-missing-required.scala b/test/files/neg/t7622-missing-required.scala index a0ba487b2442..8974cce51dc1 100644 --- a/test/files/neg/t7622-missing-required.scala +++ b/test/files/neg/t7622-missing-required.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin-require:special-plugin // the amazing features of this trait // are unlocked by compiling with a special plugin. diff --git a/test/files/neg/t7622-multi-followers/sample_2.flags b/test/files/neg/t7622-multi-followers/sample_2.flags deleted file mode 100644 index d2e83e97230b..000000000000 --- a/test/files/neg/t7622-multi-followers/sample_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. -Xplugin-require:multi diff --git a/test/files/neg/t7622-multi-followers/sample_2.scala b/test/files/neg/t7622-multi-followers/sample_2.scala index 73cdc64e40fb..8732dc555196 100644 --- a/test/files/neg/t7622-multi-followers/sample_2.scala +++ b/test/files/neg/t7622-multi-followers/sample_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Xplugin-require:multi package sample diff --git a/test/files/neg/t7623.check b/test/files/neg/t7623.check index de3502366467..81afa76f3982 100644 --- a/test/files/neg/t7623.check +++ b/test/files/neg/t7623.check @@ -1,13 +1,13 @@ -t7623.scala:21: warning: A repeated case parameter or extracted sequence is not matched by a sequence wildcard (_*), and may fail at runtime. +t7623.scala:22: warning: A repeated case parameter or extracted sequence is not matched by a sequence wildcard (_*), and may fail at runtime. def g = "" match { case X(s, t) => } // warn ^ -t7623.scala:23: warning: Sequence wildcard (_*) does not align with repeated case parameter or extracted sequence; the result may be unexpected. +t7623.scala:24: warning: Sequence wildcard (_*) does not align with repeated case parameter or extracted sequence; the result may be unexpected. def h = "" match { case X(s, t, u @ _*) => } // warn ^ -t7623.scala:11: warning: A repeated case parameter or extracted sequence is not matched by a sequence wildcard (_*), and may fail at runtime. +t7623.scala:12: warning: A repeated case parameter or extracted sequence is not matched by a sequence wildcard (_*), and may fail at runtime. def g = C("") match { case C(s, t) => } // warn ^ -t7623.scala:13: warning: Sequence wildcard (_*) does not align with repeated case parameter or extracted sequence; the result may be unexpected. +t7623.scala:14: warning: Sequence wildcard (_*) does not align with repeated case parameter or extracted sequence; the result may be unexpected. def h = C("") match { case C(s, t, u @ _*) => } // warn ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t7623.flags b/test/files/neg/t7623.flags deleted file mode 100644 index 74c9e3832356..000000000000 --- a/test/files/neg/t7623.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint:stars-align -Xfatal-warnings diff --git a/test/files/neg/t7623.scala b/test/files/neg/t7623.scala index 5334cc5f6966..0c62321d7743 100644 --- a/test/files/neg/t7623.scala +++ b/test/files/neg/t7623.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint:stars-align -Xfatal-warnings case class C(s: String, xs: Int*) diff --git a/test/files/neg/t7629-view-bounds-deprecation.check b/test/files/neg/t7629-view-bounds-deprecation.check index ed77c15c547b..75ed84ac8616 100644 --- a/test/files/neg/t7629-view-bounds-deprecation.check +++ b/test/files/neg/t7629-view-bounds-deprecation.check @@ -1,8 +1,8 @@ -t7629-view-bounds-deprecation.scala:2: warning: View bounds are deprecated. Use an implicit parameter instead. +t7629-view-bounds-deprecation.scala:3: warning: View bounds are deprecated. 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-deprecation.scala:3: warning: View bounds are deprecated. Use an implicit parameter instead. +t7629-view-bounds-deprecation.scala:4: warning: View bounds are deprecated. 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 ^ diff --git a/test/files/neg/t7629-view-bounds-deprecation.flags b/test/files/neg/t7629-view-bounds-deprecation.flags deleted file mode 100644 index 43a25d4ccc01..000000000000 --- a/test/files/neg/t7629-view-bounds-deprecation.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings -Xfuture diff --git a/test/files/neg/t7629-view-bounds-deprecation.scala b/test/files/neg/t7629-view-bounds-deprecation.scala index a6ede1fcc3dd..130bc97f78bb 100644 --- a/test/files/neg/t7629-view-bounds-deprecation.scala +++ b/test/files/neg/t7629-view-bounds-deprecation.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings -Xfuture object Test { def f[A <% Int](a: A) = null def g[C, B <: C, A <% B : Numeric](a: A) = null diff --git a/test/files/neg/t7669.check b/test/files/neg/t7669.check index c090ed18cebe..110c18a26570 100644 --- a/test/files/neg/t7669.check +++ b/test/files/neg/t7669.check @@ -1,4 +1,4 @@ -t7669.scala:9: warning: match may not be exhaustive. +t7669.scala:10: warning: match may not be exhaustive. It would fail on the following input: NotHandled(_) def exhausto(expr: Expr): Unit = expr match { ^ diff --git a/test/files/neg/t7669.flags b/test/files/neg/t7669.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t7669.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t7669.scala b/test/files/neg/t7669.scala index 12441ec05693..c791fdbc9021 100644 --- a/test/files/neg/t7669.scala +++ b/test/files/neg/t7669.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { sealed abstract class Expr diff --git a/test/files/neg/t7721.check b/test/files/neg/t7721.check index ade1ca3b206c..d465a4600877 100644 --- a/test/files/neg/t7721.check +++ b/test/files/neg/t7721.check @@ -1,25 +1,25 @@ -t7721.scala:11: warning: abstract type pattern A.this.Foo is unchecked since it is eliminated by erasure +t7721.scala:12: warning: abstract type pattern A.this.Foo is unchecked since it is eliminated by erasure case x: Foo with Concrete => x.bippy + x.conco ^ -t7721.scala:15: warning: abstract type pattern A.this.Foo is unchecked since it is eliminated by erasure +t7721.scala:16: warning: abstract type pattern A.this.Foo is unchecked since it is eliminated by erasure case x: Concrete with Foo => x.bippy + x.conco ^ -t7721.scala:19: warning: abstract type pattern A.this.Foo is unchecked since it is eliminated by erasure +t7721.scala:20: warning: abstract type pattern A.this.Foo is unchecked since it is eliminated by erasure case x: Foo with Bar => x.bippy + x.barry ^ -t7721.scala:19: warning: abstract type pattern A.this.Bar is unchecked since it is eliminated by erasure +t7721.scala:20: warning: abstract type pattern A.this.Bar is unchecked since it is eliminated by erasure case x: Foo with Bar => x.bippy + x.barry ^ -t7721.scala:39: warning: abstract type pattern B.this.Foo is unchecked since it is eliminated by erasure +t7721.scala:40: warning: abstract type pattern B.this.Foo is unchecked since it is eliminated by erasure case x: Foo with Concrete => x.bippy + x.dingo + x.conco ^ -t7721.scala:43: warning: abstract type pattern B.this.Foo is unchecked since it is eliminated by erasure +t7721.scala:44: warning: abstract type pattern B.this.Foo is unchecked since it is eliminated by erasure case x: Concrete with Foo => x.bippy + x.dingo + x.conco ^ -t7721.scala:47: warning: abstract type pattern B.this.Foo is unchecked since it is eliminated by erasure +t7721.scala:48: warning: abstract type pattern B.this.Foo is unchecked since it is eliminated by erasure case x: Foo with Bar with Concrete => x.bippy + x.barry + x.dingo + x.conco + x.bongo ^ -t7721.scala:47: warning: abstract type pattern B.this.Bar is unchecked since it is eliminated by erasure +t7721.scala:48: warning: abstract type pattern B.this.Bar is unchecked since it is eliminated by erasure case x: Foo with Bar with Concrete => x.bippy + x.barry + x.dingo + x.conco + x.bongo ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t7721.flags b/test/files/neg/t7721.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t7721.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t7721.scala b/test/files/neg/t7721.scala index 27884c9e35dd..e6908238e2d5 100644 --- a/test/files/neg/t7721.scala +++ b/test/files/neg/t7721.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings import scala.language.reflectiveCalls trait A { @@ -137,4 +138,4 @@ object Test { } } -// java.lang.NoSuchMethodException: Test$$anon$1.bippy() \ No newline at end of file +// java.lang.NoSuchMethodException: Test$$anon$1.bippy() diff --git a/test/files/neg/t7756b.check b/test/files/neg/t7756b.check index 2817a7e230d3..f61ff956d1a6 100644 --- a/test/files/neg/t7756b.check +++ b/test/files/neg/t7756b.check @@ -1,4 +1,4 @@ -t7756b.scala:3: warning: comparing values of types Int and String using `==' will always yield false +t7756b.scala:4: warning: comparing values of types Int and String using `==' will always yield false case _ => 0 == "" ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t7756b.flags b/test/files/neg/t7756b.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t7756b.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t7756b.scala b/test/files/neg/t7756b.scala index a2de29c8e7f0..5d1b84a9c2bd 100644 --- a/test/files/neg/t7756b.scala +++ b/test/files/neg/t7756b.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { 0 match { case _ => 0 == "" diff --git a/test/files/neg/t7783.check b/test/files/neg/t7783.check index 647cfee12152..2db01ea6771d 100644 --- a/test/files/neg/t7783.check +++ b/test/files/neg/t7783.check @@ -1,16 +1,16 @@ -t7783.scala:1: warning: type D in object O is deprecated: +t7783.scala:2: warning: type D in object O is deprecated: object O { class C; @deprecated("", "") type D = C; def foo: Seq[D] = Nil } ^ -t7783.scala:11: warning: type D in object O is deprecated: +t7783.scala:12: warning: type D in object O is deprecated: type T = O.D ^ -t7783.scala:12: warning: type D in object O is deprecated: +t7783.scala:13: warning: type D in object O is deprecated: locally(null: O.D) ^ -t7783.scala:13: warning: type D in object O is deprecated: +t7783.scala:14: warning: type D in object O is deprecated: val x: O.D = null ^ -t7783.scala:14: warning: type D in object O is deprecated: +t7783.scala:15: warning: type D in object O is deprecated: locally(null.asInstanceOf[O.D]) ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t7783.flags b/test/files/neg/t7783.flags deleted file mode 100644 index d1b831ea87cd..000000000000 --- a/test/files/neg/t7783.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t7783.scala b/test/files/neg/t7783.scala index 995b644a09ad..abfd13790fa8 100644 --- a/test/files/neg/t7783.scala +++ b/test/files/neg/t7783.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings object O { class C; @deprecated("", "") type D = C; def foo: Seq[D] = Nil } object NoWarn { diff --git a/test/files/neg/t7848-interp-warn.check b/test/files/neg/t7848-interp-warn.check index cc94cc81de16..804037cd270a 100644 --- a/test/files/neg/t7848-interp-warn.check +++ b/test/files/neg/t7848-interp-warn.check @@ -1,25 +1,25 @@ -t7848-interp-warn.scala:18: warning: possible missing interpolator: detected interpolated identifier `$foo` +t7848-interp-warn.scala:19: warning: possible missing interpolator: detected interpolated identifier `$foo` "An important $foo message!" // warn on ident in scope ^ -t7848-interp-warn.scala:22: warning: possible missing interpolator: detected an interpolated expression +t7848-interp-warn.scala:23: warning: possible missing interpolator: detected an interpolated expression "A doubly important ${foo * 2} message!" // warn on some expr, see below ^ -t7848-interp-warn.scala:25: warning: possible missing interpolator: detected interpolated identifier `$bar` +t7848-interp-warn.scala:26: warning: possible missing interpolator: detected interpolated identifier `$bar` def i = s"Try using '${ "$bar" }' instead." // was: no warn on space test ^ -t7848-interp-warn.scala:26: warning: possible missing interpolator: detected interpolated identifier `$bar` +t7848-interp-warn.scala:27: warning: possible missing interpolator: detected interpolated identifier `$bar` def j = s"Try using '${ "something like $bar" }' instead." // warn ^ -t7848-interp-warn.scala:32: warning: possible missing interpolator: detected an interpolated expression +t7848-interp-warn.scala:33: warning: possible missing interpolator: detected an interpolated expression def v = "${baz}${bar}" // warn on second expr ^ -t7848-interp-warn.scala:33: warning: possible missing interpolator: detected an interpolated expression +t7848-interp-warn.scala:34: warning: possible missing interpolator: detected an interpolated expression def w = "${ op_* }" // warn, only cheap ident parsing ^ -t7848-interp-warn.scala:34: warning: possible missing interpolator: detected an interpolated expression +t7848-interp-warn.scala:35: warning: possible missing interpolator: detected an interpolated expression def x = "${ bar }" // warn, a cheap ident in scope ^ -t7848-interp-warn.scala:36: warning: possible missing interpolator: detected an interpolated expression +t7848-interp-warn.scala:37: warning: possible missing interpolator: detected an interpolated expression def z = "${ baz * 3}" // warn, no expr parsing ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t7848-interp-warn.flags b/test/files/neg/t7848-interp-warn.flags deleted file mode 100644 index b0d7bc25cb56..000000000000 --- a/test/files/neg/t7848-interp-warn.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint:missing-interpolator -Xfatal-warnings diff --git a/test/files/neg/t7848-interp-warn.scala b/test/files/neg/t7848-interp-warn.scala index ceaf6c7d67e2..713aec202ec4 100644 --- a/test/files/neg/t7848-interp-warn.scala +++ b/test/files/neg/t7848-interp-warn.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint:missing-interpolator -Xfatal-warnings package test diff --git a/test/files/neg/t7860.check b/test/files/neg/t7860.check index 9b9d86c89d0b..6c2ad9d82a38 100644 --- a/test/files/neg/t7860.check +++ b/test/files/neg/t7860.check @@ -1,7 +1,7 @@ -t7860.scala:5: warning: private class for your eyes only in object Test is never used +t7860.scala:6: warning: private class for your eyes only in object Test is never used private implicit class `for your eyes only`(i: Int) { // warn ^ -t7860.scala:31: warning: private class C in object Test3 is never used +t7860.scala:32: warning: private class C in object Test3 is never used private implicit class C(val i: Int) extends AnyVal { // warn ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t7860.flags b/test/files/neg/t7860.flags deleted file mode 100644 index 6ff0dea0b265..000000000000 --- a/test/files/neg/t7860.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Ywarn-unused:privates diff --git a/test/files/neg/t7860.scala b/test/files/neg/t7860.scala index 6cc0d3e7f5a4..903717dc8813 100644 --- a/test/files/neg/t7860.scala +++ b/test/files/neg/t7860.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ywarn-unused:privates class Test diff --git a/test/files/neg/t7984.check b/test/files/neg/t7984.check index 0cfd7d16198c..26d64c44f3bd 100644 --- a/test/files/neg/t7984.check +++ b/test/files/neg/t7984.check @@ -1,4 +1,4 @@ -t7984.scala:4: warning: non-variable type argument Int in type pattern List[Int] (the underlying of Test.this.ListInt) is unchecked since it is eliminated by erasure +t7984.scala:5: warning: non-variable type argument Int in type pattern List[Int] (the underlying of Test.this.ListInt) is unchecked since it is eliminated by erasure case is: ListInt => is.head ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t7984.flags b/test/files/neg/t7984.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t7984.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t7984.scala b/test/files/neg/t7984.scala index ca09a89fc71c..af30ade4e26f 100644 --- a/test/files/neg/t7984.scala +++ b/test/files/neg/t7984.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class Test { type ListInt = List[Int] List[Any]("") match { diff --git a/test/files/neg/t8015-ffb.check b/test/files/neg/t8015-ffb.check index 9b2171ea471a..936ea67cdac6 100644 --- a/test/files/neg/t8015-ffb.check +++ b/test/files/neg/t8015-ffb.check @@ -1,4 +1,4 @@ -t8015-ffb.scala:10: warning: side-effecting nullary methods are discouraged: suggest defining as `def w()` instead +t8015-ffb.scala:11: warning: side-effecting nullary methods are discouraged: suggest defining as `def w()` instead def w = { x\u000c() } // ^L is colored blue on this screen, hardly visible ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t8015-ffb.flags b/test/files/neg/t8015-ffb.flags deleted file mode 100644 index 7949c2afa212..000000000000 --- a/test/files/neg/t8015-ffb.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint -Xfatal-warnings diff --git a/test/files/neg/t8015-ffb.scala b/test/files/neg/t8015-ffb.scala index dbdd94255511..a2d25c16460f 100644 --- a/test/files/neg/t8015-ffb.scala +++ b/test/files/neg/t8015-ffb.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint -Xfatal-warnings trait G { val c: Char = '\u000a' // disallowed! diff --git a/test/files/neg/t8035-deprecated.check b/test/files/neg/t8035-deprecated.check index 35aba5551db1..7380a69c491f 100644 --- a/test/files/neg/t8035-deprecated.check +++ b/test/files/neg/t8035-deprecated.check @@ -1,16 +1,16 @@ -t8035-deprecated.scala:2: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want. +t8035-deprecated.scala:3: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want. signature: GenSetLike.apply(elem: A): Boolean given arguments: after adaptation: GenSetLike((): Unit) List(1,2,3).toSet() ^ -t8035-deprecated.scala:5: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want. +t8035-deprecated.scala:6: warning: Adaptation of argument list by inserting () is deprecated: this is unlikely to be what you want. signature: A(x: T): Foo.A[T] given arguments: after adaptation: new A((): Unit) new A ^ -t8035-deprecated.scala:9: warning: Adaptation of argument list by inserting () is deprecated: leaky (Object-receiving) target makes this especially dangerous. +t8035-deprecated.scala:10: warning: Adaptation of argument list by inserting () is deprecated: leaky (Object-receiving) target makes this especially dangerous. signature: Format.format(x$1: Any): String given arguments: after adaptation: Format.format((): Unit) diff --git a/test/files/neg/t8035-deprecated.flags b/test/files/neg/t8035-deprecated.flags deleted file mode 100644 index c6bfaf1f64a4..000000000000 --- a/test/files/neg/t8035-deprecated.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings diff --git a/test/files/neg/t8035-deprecated.scala b/test/files/neg/t8035-deprecated.scala index 6423157530db..98002f8569e1 100644 --- a/test/files/neg/t8035-deprecated.scala +++ b/test/files/neg/t8035-deprecated.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings object Foo { List(1,2,3).toSet() diff --git a/test/files/neg/t8035-no-adapted-args.check b/test/files/neg/t8035-no-adapted-args.check index 0115dddc91a3..b3093bdd907f 100644 --- a/test/files/neg/t8035-no-adapted-args.check +++ b/test/files/neg/t8035-no-adapted-args.check @@ -1,19 +1,19 @@ -t8035-no-adapted-args.scala:4: warning: No automatic adaptation here: use explicit parentheses. +t8035-no-adapted-args.scala:5: warning: No automatic adaptation here: use explicit parentheses. signature: Test.f[T](x: T): Int given arguments: 1, 2, 3 after adaptation: Test.f((1, 2, 3): (Int, Int, Int)) f(1, 2, 3) ^ -t8035-no-adapted-args.scala:4: error: too many arguments (3) for method f: (x: (Int, Int, Int))Int +t8035-no-adapted-args.scala:5: error: too many arguments (3) for method f: (x: (Int, Int, Int))Int f(1, 2, 3) ^ -t8035-no-adapted-args.scala:5: warning: No automatic adaptation here: use explicit parentheses. +t8035-no-adapted-args.scala:6: warning: No automatic adaptation here: use explicit parentheses. signature: Test.f[T](x: T): Int given arguments: after adaptation: Test.f((): Unit) f() ^ -t8035-no-adapted-args.scala:5: error: not enough arguments for method f: (x: Unit)Int. +t8035-no-adapted-args.scala:6: error: not enough arguments for method f: (x: Unit)Int. Unspecified value parameter x. f() ^ diff --git a/test/files/neg/t8035-no-adapted-args.flags b/test/files/neg/t8035-no-adapted-args.flags deleted file mode 100644 index b3e8c505e215..000000000000 --- a/test/files/neg/t8035-no-adapted-args.flags +++ /dev/null @@ -1 +0,0 @@ --Yno-adapted-args \ No newline at end of file diff --git a/test/files/neg/t8035-no-adapted-args.scala b/test/files/neg/t8035-no-adapted-args.scala index 82690ebe94a9..b70dc1bfdc17 100644 --- a/test/files/neg/t8035-no-adapted-args.scala +++ b/test/files/neg/t8035-no-adapted-args.scala @@ -1,3 +1,4 @@ +// scalac: -Yno-adapted-args object Test { def f[T](x: T) = 0 diff --git a/test/files/neg/t8035-removed.check b/test/files/neg/t8035-removed.check index e24a0b4e63d8..6bd30f03f3de 100644 --- a/test/files/neg/t8035-removed.check +++ b/test/files/neg/t8035-removed.check @@ -1,14 +1,14 @@ -t8035-removed.scala:2: error: Adaptation of argument list by inserting () has been removed. +t8035-removed.scala:3: error: Adaptation of argument list by inserting () has been removed. signature: GenSetLike.apply(elem: A): Boolean given arguments: List(1,2,3).toSet() ^ -t8035-removed.scala:5: error: Adaptation of argument list by inserting () has been removed. +t8035-removed.scala:6: error: Adaptation of argument list by inserting () has been removed. signature: A(x: T): Foo.A[T] given arguments: new A ^ -t8035-removed.scala:9: error: Adaptation of argument list by inserting () has been removed. +t8035-removed.scala:10: error: Adaptation of argument list by inserting () has been removed. signature: Format.format(x$1: Any): String given arguments: sdf.format() diff --git a/test/files/neg/t8035-removed.flags b/test/files/neg/t8035-removed.flags deleted file mode 100644 index 29f4ede37ab4..000000000000 --- a/test/files/neg/t8035-removed.flags +++ /dev/null @@ -1 +0,0 @@ --Xfuture diff --git a/test/files/neg/t8035-removed.scala b/test/files/neg/t8035-removed.scala index 6423157530db..4ddfea14e6da 100644 --- a/test/files/neg/t8035-removed.scala +++ b/test/files/neg/t8035-removed.scala @@ -1,3 +1,4 @@ +// scalac: -Xfuture object Foo { List(1,2,3).toSet() diff --git a/test/files/neg/t8265.check b/test/files/neg/t8265.check index 7b1db1c4e513..0c61a935286b 100644 --- a/test/files/neg/t8265.check +++ b/test/files/neg/t8265.check @@ -1,4 +1,4 @@ -t8265.scala:1: warning: Construct depends on unsound variance analysis and will not compile in scala 2.11 and beyond +t8265.scala:2: warning: Construct depends on unsound variance analysis and will not compile in scala 2.11 and beyond class Foo[+CC[X]] { type Coll = CC[_] } ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t8265.flags b/test/files/neg/t8265.flags deleted file mode 100644 index 9d7ba7abd863..000000000000 --- a/test/files/neg/t8265.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.10 -deprecation -language:higherKinds -Xfatal-warnings diff --git a/test/files/neg/t8265.scala b/test/files/neg/t8265.scala index a215903ebc5f..48017063ef97 100644 --- a/test/files/neg/t8265.scala +++ b/test/files/neg/t8265.scala @@ -1 +1,2 @@ +// scalac: -Xsource:2.10 -deprecation -language:higherKinds -Xfatal-warnings class Foo[+CC[X]] { type Coll = CC[_] } diff --git a/test/files/neg/t8417.check b/test/files/neg/t8417.check index 6ec9e1d14d0e..5d8ac221df86 100644 --- a/test/files/neg/t8417.check +++ b/test/files/neg/t8417.check @@ -1,10 +1,10 @@ -t8417.scala:5: warning: Adapting argument list by creating a 2-tuple: this may not be what you want. +t8417.scala:6: warning: Adapting argument list by creating a 2-tuple: this may not be what you want. signature: T.f(x: Any)(y: Any): String given arguments: "hello", "world" after adaptation: T.f(("hello", "world"): (String, String)) def g = f("hello", "world")("holy", "moly") ^ -t8417.scala:5: warning: Adapting argument list by creating a 2-tuple: this may not be what you want. +t8417.scala:6: warning: Adapting argument list by creating a 2-tuple: this may not be what you want. signature: T.f(x: Any)(y: Any): String given arguments: "holy", "moly" after adaptation: T.f(("holy", "moly"): (String, String)) diff --git a/test/files/neg/t8417.flags b/test/files/neg/t8417.flags deleted file mode 100644 index 26b215ff2d2a..000000000000 --- a/test/files/neg/t8417.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Ywarn-adapted-args diff --git a/test/files/neg/t8417.scala b/test/files/neg/t8417.scala index fb6449c2d19c..2a8b8fede2c8 100644 --- a/test/files/neg/t8417.scala +++ b/test/files/neg/t8417.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ywarn-adapted-args trait T { diff --git a/test/files/neg/t8430.check b/test/files/neg/t8430.check index dbc0c70bbac1..59fbf3ebd4ca 100644 --- a/test/files/neg/t8430.check +++ b/test/files/neg/t8430.check @@ -1,7 +1,3 @@ -t8430.scala:15: warning: match may not be exhaustive. -It would fail on the following inputs: LetC, LetF, LetL(BooleanLit), LetL(IntLit), LetL(UnitLit), LetP - (tree: Tree) => tree match {case LetL(CharLit) => ??? } - ^ t8430.scala:16: warning: match may not be exhaustive. It would fail on the following inputs: LetC, LetF, LetL(BooleanLit), LetL(IntLit), LetL(UnitLit), LetP (tree: Tree) => tree match {case LetL(CharLit) => ??? } @@ -19,6 +15,10 @@ It would fail on the following inputs: LetC, LetF, LetL(BooleanLit), LetL(IntLit (tree: Tree) => tree match {case LetL(CharLit) => ??? } ^ t8430.scala:20: warning: match may not be exhaustive. +It would fail on the following inputs: LetC, LetF, LetL(BooleanLit), LetL(IntLit), LetL(UnitLit), LetP + (tree: Tree) => tree match {case LetL(CharLit) => ??? } + ^ +t8430.scala:21: warning: match may not be exhaustive. It would fail on the following inputs: LetC, LetF, LetL(BooleanLit), LetL(IntLit), LetL(UnitLit), LetP (tree: Tree) => tree match {case LetL(CharLit) => ??? } ^ diff --git a/test/files/neg/t8430.flags b/test/files/neg/t8430.flags deleted file mode 100644 index 6f60189a8de1..000000000000 --- a/test/files/neg/t8430.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Ypatmat-exhaust-depth off diff --git a/test/files/neg/t8430.scala b/test/files/neg/t8430.scala index 78f99b941dd8..6b91f07822cd 100644 --- a/test/files/neg/t8430.scala +++ b/test/files/neg/t8430.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ypatmat-exhaust-depth off sealed trait CL3Literal case object IntLit extends CL3Literal case object CharLit extends CL3Literal diff --git a/test/files/neg/t8450.check b/test/files/neg/t8450.check index eeabb9730cec..c2bbf219552a 100644 --- a/test/files/neg/t8450.check +++ b/test/files/neg/t8450.check @@ -1,4 +1,4 @@ -t8450.scala:5: warning: implicit numeric widening +t8450.scala:6: warning: implicit numeric widening def elapsed: Foo = (System.nanoTime - 100L).foo ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t8450.flags b/test/files/neg/t8450.flags deleted file mode 100644 index 9a1332d7af45..000000000000 --- a/test/files/neg/t8450.flags +++ /dev/null @@ -1 +0,0 @@ --Ywarn-numeric-widen -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t8450.scala b/test/files/neg/t8450.scala index f20ed2bc31c8..4ae709dbca40 100644 --- a/test/files/neg/t8450.scala +++ b/test/files/neg/t8450.scala @@ -1,3 +1,4 @@ +// scalac: -Ywarn-numeric-widen -Xfatal-warnings trait Foo class WarnWidening { diff --git a/test/files/neg/t8525.check b/test/files/neg/t8525.check index 5287e43b7a91..028fed915710 100644 --- a/test/files/neg/t8525.check +++ b/test/files/neg/t8525.check @@ -1,13 +1,13 @@ -t8525.scala:7: warning: Adapting argument list by creating a 2-tuple: this may not be what you want. +t8525.scala:8: warning: Adapting argument list by creating a 2-tuple: this may not be what you want. signature: X.f(p: (Int, Int)): Int given arguments: 3, 4 after adaptation: X.f((3, 4): (Int, Int)) def g = f(3, 4) // adapted ^ -t8525.scala:9: warning: private[this] value name in class X shadows mutable name inherited from class Named. Changes to name will not be visible within class X - you may want to give them distinct names. +t8525.scala:10: warning: private[this] value name in class X shadows mutable name inherited from class Named. Changes to name will not be visible within class X - you may want to give them distinct names. override def toString = name // shadowing mutable var name ^ -t8525.scala:8: warning: side-effecting nullary methods are discouraged: suggest defining as `def u()` instead +t8525.scala:9: warning: side-effecting nullary methods are discouraged: suggest defining as `def u()` instead def u: Unit = () // unitarian universalist ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t8525.flags b/test/files/neg/t8525.flags deleted file mode 100644 index 53b2dfe7ec81..000000000000 --- a/test/files/neg/t8525.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xlint:-missing-interpolator -Xlint diff --git a/test/files/neg/t8525.scala b/test/files/neg/t8525.scala index 7bed04904fb3..e1ff7ba981fd 100644 --- a/test/files/neg/t8525.scala +++ b/test/files/neg/t8525.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:-missing-interpolator -Xlint class Named(var name: String) diff --git a/test/files/neg/t8597.check b/test/files/neg/t8597.check index f5fd67fe3a2b..b7b022368da5 100644 --- a/test/files/neg/t8597.check +++ b/test/files/neg/t8597.check @@ -1,19 +1,19 @@ -t8597.scala:2: warning: abstract type T in type pattern Some[T] is unchecked since it is eliminated by erasure +t8597.scala:3: warning: abstract type T in type pattern Some[T] is unchecked since it is eliminated by erasure def nowarn[T] = (null: Any) match { case _: Some[T] => } // warn (did not warn due to scala/bug#8597) ^ -t8597.scala:5: warning: abstract type pattern T is unchecked since it is eliminated by erasure +t8597.scala:6: warning: abstract type pattern T is unchecked since it is eliminated by erasure def warn1[T] = (null: Any) match { case _: T => } // warn ^ -t8597.scala:6: warning: non-variable type argument String in type pattern Some[String] is unchecked since it is eliminated by erasure +t8597.scala:7: warning: non-variable type argument String in type pattern Some[String] is unchecked since it is eliminated by erasure def warn2 = (null: Any) match { case _: Some[String] => } // warn ^ -t8597.scala:7: warning: non-variable type argument Unchecked.this.C in type pattern Some[Unchecked.this.C] is unchecked since it is eliminated by erasure +t8597.scala:8: warning: non-variable type argument Unchecked.this.C in type pattern Some[Unchecked.this.C] is unchecked since it is eliminated by erasure (null: Any) match { case _: Some[C] => } // warn ^ -t8597.scala:18: warning: abstract type T in type pattern Array[T] is unchecked since it is eliminated by erasure +t8597.scala:19: warning: abstract type T in type pattern Array[T] is unchecked since it is eliminated by erasure def warnArray[T] = (null: Any) match { case _: Array[T] => } // warn (did not warn due to scala/bug#8597) ^ -t8597.scala:26: warning: non-variable type argument String in type pattern Array[Array[List[String]]] is unchecked since it is eliminated by erasure +t8597.scala:27: warning: non-variable type argument String in type pattern Array[Array[List[String]]] is unchecked since it is eliminated by erasure def warnArrayErasure2 = (null: Any) match {case Some(_: Array[Array[List[String]]]) => } // warn ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t8597.flags b/test/files/neg/t8597.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t8597.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t8597.scala b/test/files/neg/t8597.scala index 9318a8c7723a..0acd0211221c 100644 --- a/test/files/neg/t8597.scala +++ b/test/files/neg/t8597.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class Unchecked[C] { def nowarn[T] = (null: Any) match { case _: Some[T] => } // warn (did not warn due to scala/bug#8597) diff --git a/test/files/neg/t8597b.check b/test/files/neg/t8597b.check index 3c45a313371b..88fddcd23340 100644 --- a/test/files/neg/t8597b.check +++ b/test/files/neg/t8597b.check @@ -1,4 +1,4 @@ -t8597b.scala:18: warning: non-variable type argument T in type pattern Some[T] is unchecked since it is eliminated by erasure +t8597b.scala:19: warning: non-variable type argument T in type pattern Some[T] is unchecked since it is eliminated by erasure case _: Some[T] => // warn ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t8597b.flags b/test/files/neg/t8597b.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t8597b.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t8597b.scala b/test/files/neg/t8597b.scala index cbf0bf1c5a49..d2f5a937ab31 100644 --- a/test/files/neg/t8597b.scala +++ b/test/files/neg/t8597b.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Unchecked { (null: Any) match { case _: Some[t] => diff --git a/test/files/neg/t8610-arg.check b/test/files/neg/t8610-arg.check index d6fe2071191f..3f35c1f674a6 100644 --- a/test/files/neg/t8610-arg.check +++ b/test/files/neg/t8610-arg.check @@ -1,4 +1,4 @@ -t8610-arg.scala:8: warning: side-effecting nullary methods are discouraged: suggest defining as `def u()` instead +t8610-arg.scala:9: warning: side-effecting nullary methods are discouraged: suggest defining as `def u()` instead def u: Unit = () // unitarian universalist ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t8610-arg.flags b/test/files/neg/t8610-arg.flags deleted file mode 100644 index f331ba938345..000000000000 --- a/test/files/neg/t8610-arg.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xlint nullary-unit diff --git a/test/files/neg/t8610-arg.scala b/test/files/neg/t8610-arg.scala index 7bed04904fb3..2e1ad7669eac 100644 --- a/test/files/neg/t8610-arg.scala +++ b/test/files/neg/t8610-arg.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint nullary-unit class Named(var name: String) diff --git a/test/files/neg/t8610.check b/test/files/neg/t8610.check index 334a94754990..2166515222f0 100644 --- a/test/files/neg/t8610.check +++ b/test/files/neg/t8610.check @@ -1,16 +1,16 @@ -t8610.scala:5: warning: possible missing interpolator: detected interpolated identifier `$name` +t8610.scala:6: warning: possible missing interpolator: detected interpolated identifier `$name` def x = "Hi, $name" // missing interp ^ -t8610.scala:7: warning: Adapting argument list by creating a 2-tuple: this may not be what you want. +t8610.scala:8: warning: Adapting argument list by creating a 2-tuple: this may not be what you want. signature: X.f(p: (Int, Int)): Int given arguments: 3, 4 after adaptation: X.f((3, 4): (Int, Int)) def g = f(3, 4) // adapted ^ -t8610.scala:9: warning: private[this] value name in class X shadows mutable name inherited from class Named. Changes to name will not be visible within class X - you may want to give them distinct names. +t8610.scala:10: warning: private[this] value name in class X shadows mutable name inherited from class Named. Changes to name will not be visible within class X - you may want to give them distinct names. override def toString = name // shadowing mutable var name ^ -t8610.scala:8: warning: side-effecting nullary methods are discouraged: suggest defining as `def u()` instead +t8610.scala:9: warning: side-effecting nullary methods are discouraged: suggest defining as `def u()` instead def u: Unit = () // unitarian universalist ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t8610.flags b/test/files/neg/t8610.flags deleted file mode 100644 index 954eaba3523b..000000000000 --- a/test/files/neg/t8610.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xlint diff --git a/test/files/neg/t8610.scala b/test/files/neg/t8610.scala index 7bed04904fb3..c4b8d4b9c987 100644 --- a/test/files/neg/t8610.scala +++ b/test/files/neg/t8610.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint class Named(var name: String) diff --git a/test/files/neg/t8685.check b/test/files/neg/t8685.check index a31e2e265a93..7c395c5e63e4 100644 --- a/test/files/neg/t8685.check +++ b/test/files/neg/t8685.check @@ -1,46 +1,46 @@ -t8685.scala:6: warning: constructor D in class D is deprecated (since now): ctor D is depr +t8685.scala:7: warning: constructor D in class D is deprecated (since now): ctor D is depr case class D @deprecated("ctor D is depr", since="now") (i: Int) ^ -t8685.scala:35: warning: class C is deprecated (since now): class C is depr +t8685.scala:36: warning: class C is deprecated (since now): class C is depr def f = C(42) ^ -t8685.scala:36: warning: constructor D in class D is deprecated (since now): ctor D is depr +t8685.scala:37: warning: constructor D in class D is deprecated (since now): ctor D is depr def g = D(42) ^ -t8685.scala:37: warning: object E is deprecated (since now): module E is depr +t8685.scala:38: warning: object E is deprecated (since now): module E is depr def h = E(42) ^ -t8685.scala:37: warning: class E is deprecated (since now): class E is depr +t8685.scala:38: warning: class E is deprecated (since now): class E is depr def h = E(42) ^ -t8685.scala:38: warning: object F is deprecated (since now): module F is depr +t8685.scala:39: warning: object F is deprecated (since now): module F is depr def i = F.G(42) ^ -t8685.scala:39: warning: object F in object Extra is deprecated (since now): Extra module F is depr +t8685.scala:40: warning: object F in object Extra is deprecated (since now): Extra module F is depr def j = Extra.F.G(42) ^ -t8685.scala:43: warning: value gg in trait Applies is deprecated (since now): member gg +t8685.scala:44: warning: value gg in trait Applies is deprecated (since now): member gg def k = this.gg.H(0) ^ -t8685.scala:45: warning: class K in object J is deprecated (since now): Inner K is depr +t8685.scala:46: warning: class K in object J is deprecated (since now): Inner K is depr def l = J.K(42) ^ -t8685.scala:48: warning: class C is deprecated (since now): class C is depr +t8685.scala:49: warning: class C is deprecated (since now): class C is depr def f = new C(42) ^ -t8685.scala:49: warning: constructor D in class D is deprecated (since now): ctor D is depr +t8685.scala:50: warning: constructor D in class D is deprecated (since now): ctor D is depr def g = new D(42) ^ -t8685.scala:50: warning: class E is deprecated (since now): class E is depr +t8685.scala:51: warning: class E is deprecated (since now): class E is depr def h = new E(42) ^ -t8685.scala:51: warning: object F is deprecated (since now): module F is depr +t8685.scala:52: warning: object F is deprecated (since now): module F is depr def i = new F.G(42) ^ -t8685.scala:52: warning: object F in object Extra is deprecated (since now): Extra module F is depr +t8685.scala:53: warning: object F in object Extra is deprecated (since now): Extra module F is depr def j = new Extra.F.G(42) ^ -t8685.scala:53: warning: class K in object J is deprecated (since now): Inner K is depr +t8685.scala:54: warning: class K in object J is deprecated (since now): Inner K is depr def l = new J.K(42) ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t8685.flags b/test/files/neg/t8685.flags deleted file mode 100644 index c6bfaf1f64a4..000000000000 --- a/test/files/neg/t8685.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings diff --git a/test/files/neg/t8685.scala b/test/files/neg/t8685.scala index 711680ecbda2..28990d180e64 100644 --- a/test/files/neg/t8685.scala +++ b/test/files/neg/t8685.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings @deprecated("class C is depr", since="now") diff --git a/test/files/neg/t8700a.check b/test/files/neg/t8700a.check index ce7945a3fc65..e5b6314e9cff 100644 --- a/test/files/neg/t8700a.check +++ b/test/files/neg/t8700a.check @@ -1,8 +1,8 @@ -Bar.scala:2: warning: match may not be exhaustive. +Bar.scala:3: warning: match may not be exhaustive. It would fail on the following input: B def bar1(foo: Foo) = foo match { ^ -Bar.scala:6: warning: match may not be exhaustive. +Bar.scala:7: warning: match may not be exhaustive. It would fail on the following input: B def bar2(foo: Baz) = foo match { ^ diff --git a/test/files/neg/t8700a.flags b/test/files/neg/t8700a.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t8700a.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t8700a/Bar.scala b/test/files/neg/t8700a/Bar.scala index 33ad8e9877be..994b49d8ccdf 100644 --- a/test/files/neg/t8700a/Bar.scala +++ b/test/files/neg/t8700a/Bar.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Bar { def bar1(foo: Foo) = foo match { case Foo.A => 1 diff --git a/test/files/neg/t8700b.check b/test/files/neg/t8700b.check index 3bff78dd296d..cc4e657def2a 100644 --- a/test/files/neg/t8700b.check +++ b/test/files/neg/t8700b.check @@ -1,8 +1,8 @@ -Bar_2.scala:2: warning: match may not be exhaustive. +Bar_2.scala:3: warning: match may not be exhaustive. It would fail on the following input: B def bar1(foo: Foo_1) = foo match { ^ -Bar_2.scala:6: warning: match may not be exhaustive. +Bar_2.scala:7: warning: match may not be exhaustive. It would fail on the following input: B def bar2(foo: Baz_1) = foo match { ^ diff --git a/test/files/neg/t8700b.flags b/test/files/neg/t8700b.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t8700b.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t8700b/Bar_2.scala b/test/files/neg/t8700b/Bar_2.scala index 97ba16df27f6..8cc238171987 100644 --- a/test/files/neg/t8700b/Bar_2.scala +++ b/test/files/neg/t8700b/Bar_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Bar { def bar1(foo: Foo_1) = foo match { case Foo_1.A => 1 diff --git a/test/files/neg/t8704.check b/test/files/neg/t8704.check index b567a8bb17c4..eff35e61d653 100644 --- a/test/files/neg/t8704.check +++ b/test/files/neg/t8704.check @@ -1,10 +1,10 @@ -t8704.scala:7: warning: 2 parameter sections are effectively implicit +t8704.scala:8: warning: 2 parameter sections are effectively implicit class D(private implicit val i: Int)(implicit s: String) ^ -t8704.scala:3: error: an implicit parameter section must be last +t8704.scala:4: error: an implicit parameter section must be last class C(i: Int)(implicit j: Int)(implicit k: Int)(n: Int) { ^ -t8704.scala:3: error: multiple implicit parameter sections are not allowed +t8704.scala:4: error: multiple implicit parameter sections are not allowed class C(i: Int)(implicit j: Int)(implicit k: Int)(n: Int) { ^ one warning found diff --git a/test/files/neg/t8704.flags b/test/files/neg/t8704.flags deleted file mode 100644 index f175a06c745f..000000000000 --- a/test/files/neg/t8704.flags +++ /dev/null @@ -1 +0,0 @@ --Ywarn-extra-implicit diff --git a/test/files/neg/t8704.scala b/test/files/neg/t8704.scala index db43bfcaa5dd..dbafda12f828 100644 --- a/test/files/neg/t8704.scala +++ b/test/files/neg/t8704.scala @@ -1,3 +1,4 @@ +// scalac: -Ywarn-extra-implicit class C(i: Int)(implicit j: Int)(implicit k: Int)(n: Int) { diff --git a/test/files/neg/t8731.check b/test/files/neg/t8731.check index d47bd55b452a..9ee34ff7cbc4 100644 --- a/test/files/neg/t8731.check +++ b/test/files/neg/t8731.check @@ -1,4 +1,4 @@ -t8731.scala:10: warning: could not emit switch for @switch annotated match +t8731.scala:11: warning: could not emit switch for @switch annotated match def g(x: Int) = (x: @annotation.switch) match { ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t8731.flags b/test/files/neg/t8731.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/t8731.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/t8731.scala b/test/files/neg/t8731.scala index d93fe706ad01..588c3d6d73eb 100644 --- a/test/files/neg/t8731.scala +++ b/test/files/neg/t8731.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class C { // not a compile-time constant due to return type final val K: Int = 20 diff --git a/test/files/neg/t8736-c.check b/test/files/neg/t8736-c.check index 7debb6d51558..99d5edae7dac 100644 --- a/test/files/neg/t8736-c.check +++ b/test/files/neg/t8736-c.check @@ -1,4 +1,4 @@ -t8736-c.scala:4: warning: higher-kinded type should be enabled +t8736-c.scala:5: warning: higher-kinded type should be enabled by making the implicit value scala.language.higherKinds visible. This can be achieved by adding the import clause 'import scala.language.higherKinds' or by setting the compiler option -language:higherKinds. diff --git a/test/files/neg/t8736-c.flags b/test/files/neg/t8736-c.flags deleted file mode 100644 index fde5313c96dd..000000000000 --- a/test/files/neg/t8736-c.flags +++ /dev/null @@ -1 +0,0 @@ --feature -language:-higherKinds,_ -Xfatal-warnings diff --git a/test/files/neg/t8736-c.scala b/test/files/neg/t8736-c.scala index 8432775ae1a4..7e1a83f62274 100644 --- a/test/files/neg/t8736-c.scala +++ b/test/files/neg/t8736-c.scala @@ -1,4 +1,5 @@ // scalac: -feature -language:-higherKinds,_ -Xfatal-warnings +// scalac: -feature -language:-higherKinds,_ -Xfatal-warnings // showing that wildcard doesn't supersede explicit disablement class X { def hk[M[_]] = ??? diff --git a/test/files/neg/t9127.check b/test/files/neg/t9127.check index 2ecf8af464d2..be6e4fc65084 100644 --- a/test/files/neg/t9127.check +++ b/test/files/neg/t9127.check @@ -1,10 +1,10 @@ -t9127.scala:4: warning: possible missing interpolator: detected interpolated identifier `$s` +t9127.scala:5: warning: possible missing interpolator: detected interpolated identifier `$s` val t = "$s" ^ -t9127.scala:5: warning: possible missing interpolator: detected an interpolated expression +t9127.scala:6: warning: possible missing interpolator: detected an interpolated expression val u = "a${s}b" ^ -t9127.scala:6: warning: possible missing interpolator: detected interpolated identifier `$s` +t9127.scala:7: warning: possible missing interpolator: detected interpolated identifier `$s` val v = "a$s b" ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t9127.flags b/test/files/neg/t9127.flags deleted file mode 100644 index b0d7bc25cb56..000000000000 --- a/test/files/neg/t9127.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint:missing-interpolator -Xfatal-warnings diff --git a/test/files/neg/t9127.scala b/test/files/neg/t9127.scala index c0746144eb39..d0e7d4fda545 100644 --- a/test/files/neg/t9127.scala +++ b/test/files/neg/t9127.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint:missing-interpolator -Xfatal-warnings trait X { val s = "hello" diff --git a/test/files/neg/t9398.check b/test/files/neg/t9398.check index f0c464daa1c6..2adf7bd7e268 100644 --- a/test/files/neg/t9398.check +++ b/test/files/neg/t9398.check @@ -1,4 +1,4 @@ -match.scala:3: warning: match may not be exhaustive. +match.scala:4: warning: match may not be exhaustive. It would fail on the following input: CC(B2) def test(c: CC): Unit = c match { ^ diff --git a/test/files/neg/t9398.flags b/test/files/neg/t9398.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t9398.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t9398/data.scala b/test/files/neg/t9398/data.scala index 7a98c0e8e80e..31b2762a66d9 100644 --- a/test/files/neg/t9398/data.scala +++ b/test/files/neg/t9398/data.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed abstract class TB case object B extends TB case object B2 extends TB diff --git a/test/files/neg/t9398/match.scala b/test/files/neg/t9398/match.scala index e110c6a96aaf..28bc77c83d0c 100644 --- a/test/files/neg/t9398/match.scala +++ b/test/files/neg/t9398/match.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class Test { // Should warn that CC(B2) isn't matched def test(c: CC): Unit = c match { diff --git a/test/files/neg/t9617.check b/test/files/neg/t9617.check index 8db611817e18..825578d683c5 100644 --- a/test/files/neg/t9617.check +++ b/test/files/neg/t9617.check @@ -1,7 +1,7 @@ -Test.scala:3: warning: class DeprecatedClass in package p1 is deprecated +Test.scala:4: warning: class DeprecatedClass in package p1 is deprecated def useC = p1.DeprecatedClass.foo ^ -Test.scala:4: warning: method foo in class DeprecatedMethod is deprecated +Test.scala:5: warning: method foo in class DeprecatedMethod is deprecated def useM = p1.DeprecatedMethod.foo ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t9617/Test.flags b/test/files/neg/t9617/Test.flags deleted file mode 100644 index 7de3c0f3eea0..000000000000 --- a/test/files/neg/t9617/Test.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -deprecation diff --git a/test/files/neg/t9617/Test.scala b/test/files/neg/t9617/Test.scala index 6883855c43ad..6d5e5ab78acf 100644 --- a/test/files/neg/t9617/Test.scala +++ b/test/files/neg/t9617/Test.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -deprecation // Joint-compilation copy of test/files/neg/t10752/Test_2.scala object Test { def useC = p1.DeprecatedClass.foo diff --git a/test/files/neg/t9636.check b/test/files/neg/t9636.check index f36d1d32b226..a30d401ea909 100644 --- a/test/files/neg/t9636.check +++ b/test/files/neg/t9636.check @@ -1,4 +1,4 @@ -t9636.scala:11: warning: a type was inferred to be `AnyVal`; this may indicate a programming error. +t9636.scala:12: warning: a type was inferred to be `AnyVal`; this may indicate a programming error. if (signature.sameElements(Array(0x1F, 0x8B))) { ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t9636.flags b/test/files/neg/t9636.flags deleted file mode 100644 index 7949c2afa212..000000000000 --- a/test/files/neg/t9636.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint -Xfatal-warnings diff --git a/test/files/neg/t9636.scala b/test/files/neg/t9636.scala index 7ad5fb3e9ec3..030edb6cd1a2 100644 --- a/test/files/neg/t9636.scala +++ b/test/files/neg/t9636.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint -Xfatal-warnings import java.io._ import java.util.zip._ diff --git a/test/files/neg/t9675.check b/test/files/neg/t9675.check index 255477499c7d..c2fd4e2c5251 100644 --- a/test/files/neg/t9675.check +++ b/test/files/neg/t9675.check @@ -1,25 +1,25 @@ -t9675.scala:4: warning: comparing values of types Test.A and String using `!=' will always yield true +t9675.scala:5: warning: comparing values of types Test.A and String using `!=' will always yield true val func1 = (x: A) => { x != "x" } ^ -t9675.scala:6: warning: comparing values of types Test.A and String using `!=' will always yield true +t9675.scala:7: warning: comparing values of types Test.A and String using `!=' will always yield true val func2 = (x: A) => { x != "x" }: Boolean ^ -t9675.scala:8: warning: comparing values of types Test.A and String using `!=' will always yield true +t9675.scala:9: warning: comparing values of types Test.A and String using `!=' will always yield true val func3: Function1[A, Boolean] = (x) => { x != "x" } ^ -t9675.scala:11: warning: comparing values of types Test.A and String using `!=' will always yield true +t9675.scala:12: warning: comparing values of types Test.A and String using `!=' will always yield true def apply(x: A): Boolean = { x != "x" } ^ -t9675.scala:14: warning: comparing values of types Test.A and String using `!=' will always yield true +t9675.scala:15: warning: comparing values of types Test.A and String using `!=' will always yield true def method(x: A): Boolean = { x != "x" } ^ -t9675.scala:18: warning: comparing values of types Test.A and String using `!=' will always yield true +t9675.scala:19: warning: comparing values of types Test.A and String using `!=' will always yield true A("x") != "x" ^ -t9675.scala:20: warning: comparing values of types Test.A and String using `!=' will always yield true +t9675.scala:21: warning: comparing values of types Test.A and String using `!=' will always yield true val func5: Function1[A, Boolean] = (x) => { x != "x" } ^ -t9675.scala:22: warning: comparing values of types Test.A and String using `!=' will always yield true +t9675.scala:23: warning: comparing values of types Test.A and String using `!=' will always yield true List(A("x")).foreach((item: A) => item != "x") ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t9675.flags b/test/files/neg/t9675.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t9675.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t9675.scala b/test/files/neg/t9675.scala index f76b74b6ac5b..e981166cb978 100644 --- a/test/files/neg/t9675.scala +++ b/test/files/neg/t9675.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { case class A(x: String) diff --git a/test/files/neg/t9684.check b/test/files/neg/t9684.check index bb5669733d8f..0947d513a6ae 100644 --- a/test/files/neg/t9684.check +++ b/test/files/neg/t9684.check @@ -1,7 +1,7 @@ -t9684.scala:6: warning: object JavaConversions in package collection is deprecated (since 2.12.0): use JavaConverters +t9684.scala:7: warning: object JavaConversions in package collection is deprecated (since 2.12.0): use JavaConverters null.asInstanceOf[java.util.List[Int]] : Buffer[Int] ^ -t9684.scala:8: warning: object JavaConversions in package collection is deprecated (since 2.12.0): use JavaConverters +t9684.scala:9: warning: object JavaConversions in package collection is deprecated (since 2.12.0): use JavaConverters null.asInstanceOf[Iterable[Int]] : java.util.Collection[Int] ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t9684.flags b/test/files/neg/t9684.flags deleted file mode 100644 index c6bfaf1f64a4..000000000000 --- a/test/files/neg/t9684.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings diff --git a/test/files/neg/t9684.scala b/test/files/neg/t9684.scala index f7ece269e652..a511d8fee75d 100644 --- a/test/files/neg/t9684.scala +++ b/test/files/neg/t9684.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings import scala.collection.JavaConversions._ import scala.collection.mutable.Buffer diff --git a/test/files/neg/t9834.check b/test/files/neg/t9834.check index d07eb7f1554c..4ca451596bf1 100644 --- a/test/files/neg/t9834.check +++ b/test/files/neg/t9834.check @@ -1,4 +1,4 @@ -t9834.scala:5: error: value += is not a member of Int +t9834.scala:6: error: value += is not a member of Int Expression does not convert to assignment because: type mismatch; found : String diff --git a/test/files/neg/t9834.flags b/test/files/neg/t9834.flags deleted file mode 100644 index fcf951d90723..000000000000 --- a/test/files/neg/t9834.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos \ No newline at end of file diff --git a/test/files/neg/t9834.scala b/test/files/neg/t9834.scala index 1ecda7a2b817..4d93d449127f 100644 --- a/test/files/neg/t9834.scala +++ b/test/files/neg/t9834.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos object x { def apply() = 42 ; def update(i: Int) = () } diff --git a/test/files/neg/t9847.check b/test/files/neg/t9847.check index b2bd3864f11e..c37317ece9ab 100644 --- a/test/files/neg/t9847.check +++ b/test/files/neg/t9847.check @@ -1,43 +1,43 @@ -t9847.scala:4: warning: discarded non-Unit value +t9847.scala:5: warning: discarded non-Unit value def f(): Unit = 42 ^ -t9847.scala:5: warning: discarded non-Unit value +t9847.scala:6: warning: discarded non-Unit value def g = (42: Unit) ^ -t9847.scala:12: warning: discarded non-Unit value +t9847.scala:13: warning: discarded non-Unit value + 1 ^ -t9847.scala:16: warning: discarded non-Unit value +t9847.scala:17: warning: discarded non-Unit value x + 1 ^ -t9847.scala:19: warning: discarded non-Unit value +t9847.scala:20: warning: discarded non-Unit value def j(): Unit = x + 1 ^ -t9847.scala:4: warning: a pure expression does nothing in statement position +t9847.scala:5: warning: a pure expression does nothing in statement position def f(): Unit = 42 ^ -t9847.scala:5: warning: a pure expression does nothing in statement position +t9847.scala:6: warning: a pure expression does nothing in statement position def g = (42: Unit) ^ -t9847.scala:7: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses +t9847.scala:8: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses 1 ^ -t9847.scala:11: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses +t9847.scala:12: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses 1 ^ -t9847.scala:12: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected +t9847.scala:13: warning: multiline expressions might require enclosing parentheses; a value can be silently discarded when Unit is expected + 1 ^ -t9847.scala:12: warning: a pure expression does nothing in statement position +t9847.scala:13: warning: a pure expression does nothing in statement position + 1 ^ -t9847.scala:21: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses +t9847.scala:22: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses class C { 42 } ^ -t9847.scala:22: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses +t9847.scala:23: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses class D { 42 ; 17 } ^ -t9847.scala:22: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses +t9847.scala:23: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses class D { 42 ; 17 } ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t9847.flags b/test/files/neg/t9847.flags deleted file mode 100644 index 065e3ca61e2c..000000000000 --- a/test/files/neg/t9847.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Ywarn-value-discard diff --git a/test/files/neg/t9847.scala b/test/files/neg/t9847.scala index 51c16d815f3b..714dbf386814 100644 --- a/test/files/neg/t9847.scala +++ b/test/files/neg/t9847.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ywarn-value-discard trait T { diff --git a/test/files/neg/t9953.check b/test/files/neg/t9953.check index f5dcbcacee38..9514c5aa61d8 100644 --- a/test/files/neg/t9953.check +++ b/test/files/neg/t9953.check @@ -1,4 +1,4 @@ -t9953.scala:10: warning: Object and X are unrelated: they will never compare equal +t9953.scala:11: warning: Object and X are unrelated: they will never compare equal def b = y == x // warn ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/t9953.flags b/test/files/neg/t9953.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t9953.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t9953.scala b/test/files/neg/t9953.scala index faaee86d506d..c882f4dc673c 100644 --- a/test/files/neg/t9953.scala +++ b/test/files/neg/t9953.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class X(val v: Int) extends AnyVal trait T extends Any diff --git a/test/files/neg/trait_fields_deprecated_overriding.check b/test/files/neg/trait_fields_deprecated_overriding.check index 89dfa5c295b7..785fae02c235 100644 --- a/test/files/neg/trait_fields_deprecated_overriding.check +++ b/test/files/neg/trait_fields_deprecated_overriding.check @@ -1,4 +1,4 @@ -trait_fields_deprecated_overriding.scala:8: warning: overriding value x in trait DeprecatedOverriding is deprecated +trait_fields_deprecated_overriding.scala:9: warning: overriding value x in trait DeprecatedOverriding is deprecated override val x = 2 ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/trait_fields_deprecated_overriding.flags b/test/files/neg/trait_fields_deprecated_overriding.flags deleted file mode 100644 index c6bfaf1f64a4..000000000000 --- a/test/files/neg/trait_fields_deprecated_overriding.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings diff --git a/test/files/neg/trait_fields_deprecated_overriding.scala b/test/files/neg/trait_fields_deprecated_overriding.scala index e7d722c92f0b..f2c57be5f97d 100644 --- a/test/files/neg/trait_fields_deprecated_overriding.scala +++ b/test/files/neg/trait_fields_deprecated_overriding.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings package scala trait DeprecatedOverriding { @@ -8,4 +9,4 @@ class COverride extends DeprecatedOverriding { override val x = 2 } -class CSynthImpl extends DeprecatedOverriding \ No newline at end of file +class CSynthImpl extends DeprecatedOverriding diff --git a/test/files/neg/unchecked-abstract.check b/test/files/neg/unchecked-abstract.check index 703929dca87c..4f6edc61b9e8 100644 --- a/test/files/neg/unchecked-abstract.check +++ b/test/files/neg/unchecked-abstract.check @@ -1,37 +1,37 @@ -unchecked-abstract.scala:16: warning: abstract type H in type Contravariant[M.this.H] is unchecked since it is eliminated by erasure +unchecked-abstract.scala:17: warning: abstract type H in type Contravariant[M.this.H] is unchecked since it is eliminated by erasure /* warn */ println(x.isInstanceOf[Contravariant[H]]) ^ -unchecked-abstract.scala:21: warning: abstract type H in type Contravariant[M.this.H] is unchecked since it is eliminated by erasure +unchecked-abstract.scala:22: warning: abstract type H in type Contravariant[M.this.H] is unchecked since it is eliminated by erasure /* warn */ println(x.isInstanceOf[Contravariant[H]]) ^ -unchecked-abstract.scala:22: warning: abstract type T in type Contravariant[M.this.T] is unchecked since it is eliminated by erasure +unchecked-abstract.scala:23: warning: abstract type T in type Contravariant[M.this.T] is unchecked since it is eliminated by erasure /* warn */ println(x.isInstanceOf[Contravariant[T]]) ^ -unchecked-abstract.scala:27: warning: abstract type T in type Invariant[M.this.T] is unchecked since it is eliminated by erasure +unchecked-abstract.scala:28: warning: abstract type T in type Invariant[M.this.T] is unchecked since it is eliminated by erasure /* warn */ println(x.isInstanceOf[Invariant[T]]) ^ -unchecked-abstract.scala:28: warning: abstract type L in type Invariant[M.this.L] is unchecked since it is eliminated by erasure +unchecked-abstract.scala:29: warning: abstract type L in type Invariant[M.this.L] is unchecked since it is eliminated by erasure /* warn */ println(x.isInstanceOf[Invariant[L]]) ^ -unchecked-abstract.scala:31: warning: abstract type H in type Invariant[M.this.H] is unchecked since it is eliminated by erasure +unchecked-abstract.scala:32: warning: abstract type H in type Invariant[M.this.H] is unchecked since it is eliminated by erasure /* warn */ println(x.isInstanceOf[Invariant[H]]) ^ -unchecked-abstract.scala:33: warning: abstract type L in type Invariant[M.this.L] is unchecked since it is eliminated by erasure +unchecked-abstract.scala:34: warning: abstract type L in type Invariant[M.this.L] is unchecked since it is eliminated by erasure /* warn */ println(x.isInstanceOf[Invariant[L]]) ^ -unchecked-abstract.scala:36: warning: abstract type H in type Invariant[M.this.H] is unchecked since it is eliminated by erasure +unchecked-abstract.scala:37: warning: abstract type H in type Invariant[M.this.H] is unchecked since it is eliminated by erasure /* warn */ println(x.isInstanceOf[Invariant[H]]) ^ -unchecked-abstract.scala:37: warning: abstract type T in type Invariant[M.this.T] is unchecked since it is eliminated by erasure +unchecked-abstract.scala:38: warning: abstract type T in type Invariant[M.this.T] is unchecked since it is eliminated by erasure /* warn */ println(x.isInstanceOf[Invariant[T]]) ^ -unchecked-abstract.scala:42: warning: abstract type T in type Covariant[M.this.T] is unchecked since it is eliminated by erasure +unchecked-abstract.scala:43: warning: abstract type T in type Covariant[M.this.T] is unchecked since it is eliminated by erasure /* warn */ println(x.isInstanceOf[Covariant[T]]) ^ -unchecked-abstract.scala:43: warning: abstract type L in type Covariant[M.this.L] is unchecked since it is eliminated by erasure +unchecked-abstract.scala:44: warning: abstract type L in type Covariant[M.this.L] is unchecked since it is eliminated by erasure /* warn */ println(x.isInstanceOf[Covariant[L]]) ^ -unchecked-abstract.scala:48: warning: abstract type L in type Covariant[M.this.L] is unchecked since it is eliminated by erasure +unchecked-abstract.scala:49: warning: abstract type L in type Covariant[M.this.L] is unchecked since it is eliminated by erasure /* warn */ println(x.isInstanceOf[Covariant[L]]) ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/unchecked-abstract.flags b/test/files/neg/unchecked-abstract.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/unchecked-abstract.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/unchecked-abstract.scala b/test/files/neg/unchecked-abstract.scala index 23c8281ca82d..677483a2bb99 100644 --- a/test/files/neg/unchecked-abstract.scala +++ b/test/files/neg/unchecked-abstract.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings trait Contravariant[-X] trait Invariant[X] trait Covariant[+X] diff --git a/test/files/neg/unchecked-impossible.check b/test/files/neg/unchecked-impossible.check index d150a5a853f6..b5e1a2944fa7 100644 --- a/test/files/neg/unchecked-impossible.check +++ b/test/files/neg/unchecked-impossible.check @@ -1,7 +1,7 @@ -unchecked-impossible.scala:5: warning: fruitless type test: a value of type T2[Int,Int] cannot also be a Seq[A] +unchecked-impossible.scala:6: warning: fruitless type test: a value of type T2[Int,Int] cannot also be a Seq[A] case Seq(x) => ^ -unchecked-impossible.scala:5: error: pattern type is incompatible with expected type; +unchecked-impossible.scala:6: error: pattern type is incompatible with expected type; found : Seq[A] required: T2[Int,Int] case Seq(x) => diff --git a/test/files/neg/unchecked-impossible.flags b/test/files/neg/unchecked-impossible.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/unchecked-impossible.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/unchecked-impossible.scala b/test/files/neg/unchecked-impossible.scala index 985a2d0b0841..e6c808050ea3 100644 --- a/test/files/neg/unchecked-impossible.scala +++ b/test/files/neg/unchecked-impossible.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings final case class T2[+A, +B](a: A, b: B) class A { diff --git a/test/files/neg/unchecked-knowable.check b/test/files/neg/unchecked-knowable.check index 327a5f202d47..ef5901b012d1 100644 --- a/test/files/neg/unchecked-knowable.check +++ b/test/files/neg/unchecked-knowable.check @@ -1,7 +1,7 @@ -unchecked-knowable.scala:18: warning: fruitless type test: a value of type Bippy cannot also be a A1 +unchecked-knowable.scala:19: warning: fruitless type test: a value of type Bippy cannot also be a A1 /* warn */ (new Bippy).isInstanceOf[A1] ^ -unchecked-knowable.scala:19: warning: fruitless type test: a value of type Bippy cannot also be a B1 +unchecked-knowable.scala:20: warning: fruitless type test: a value of type Bippy cannot also be a B1 /* warn */ (new Bippy).isInstanceOf[B1] ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/unchecked-knowable.flags b/test/files/neg/unchecked-knowable.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/unchecked-knowable.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/unchecked-knowable.scala b/test/files/neg/unchecked-knowable.scala index 21624c4fb459..675e1ead2e47 100644 --- a/test/files/neg/unchecked-knowable.scala +++ b/test/files/neg/unchecked-knowable.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings /** Knowable - only final leaves */ sealed abstract class A1 sealed abstract class A2 extends A1 diff --git a/test/files/neg/unchecked-refinement.check b/test/files/neg/unchecked-refinement.check index 0bb944621be1..ae41b1ccd9c9 100644 --- a/test/files/neg/unchecked-refinement.check +++ b/test/files/neg/unchecked-refinement.check @@ -1,13 +1,13 @@ -unchecked-refinement.scala:17: warning: abstract type U in type pattern Foo[U,U,V] is unchecked since it is eliminated by erasure +unchecked-refinement.scala:18: warning: abstract type U in type pattern Foo[U,U,V] is unchecked since it is eliminated by erasure /* warn */ case _: Foo[U, U, V] if b => () ^ -unchecked-refinement.scala:19: warning: non-variable type argument Any in type pattern Foo[Any,U,V] is unchecked since it is eliminated by erasure +unchecked-refinement.scala:20: warning: non-variable type argument Any in type pattern Foo[Any,U,V] is unchecked since it is eliminated by erasure /* warn */ case _: Foo[Any, U, V] if b => () ^ -unchecked-refinement.scala:23: warning: a pattern match on a refinement type is unchecked +unchecked-refinement.scala:24: warning: a pattern match on a refinement type is unchecked /* nowarn - todo */ case x: AnyRef { def bippy: Int } if b => x.bippy // this could/should do an instance check and not warn ^ -unchecked-refinement.scala:24: warning: a pattern match on a refinement type is unchecked +unchecked-refinement.scala:25: warning: a pattern match on a refinement type is unchecked /* nowarn - todo */ case x: AnyRef { def size: Int } if b => x.size // this could/should do a static conformance test and not warn ^ warning: there was one feature warning; re-run with -feature for details diff --git a/test/files/neg/unchecked-refinement.flags b/test/files/neg/unchecked-refinement.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/unchecked-refinement.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/unchecked-refinement.scala b/test/files/neg/unchecked-refinement.scala index 79ed7f13c15b..7f87bc615a31 100644 --- a/test/files/neg/unchecked-refinement.scala +++ b/test/files/neg/unchecked-refinement.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings // a.scala // Thu Sep 27 09:42:16 PDT 2012 diff --git a/test/files/neg/unchecked-suppress.check b/test/files/neg/unchecked-suppress.check index d3dc86014ba5..1b009e86aefc 100644 --- a/test/files/neg/unchecked-suppress.check +++ b/test/files/neg/unchecked-suppress.check @@ -1,10 +1,10 @@ -unchecked-suppress.scala:4: warning: non-variable type argument Int in type pattern scala.collection.immutable.Set[Int] (the underlying of Set[Int]) is unchecked since it is eliminated by erasure +unchecked-suppress.scala:5: warning: non-variable type argument Int in type pattern scala.collection.immutable.Set[Int] (the underlying of Set[Int]) is unchecked since it is eliminated by erasure case xs: Set[Int] => xs.head // unchecked ^ -unchecked-suppress.scala:5: warning: non-variable type argument String in type pattern scala.collection.immutable.Map[String @unchecked,String] (the underlying of Map[String @unchecked,String]) is unchecked since it is eliminated by erasure +unchecked-suppress.scala:6: warning: non-variable type argument String in type pattern scala.collection.immutable.Map[String @unchecked,String] (the underlying of Map[String @unchecked,String]) is unchecked since it is eliminated by erasure case xs: Map[String @unchecked, String] => xs.head // one unchecked, one okay ^ -unchecked-suppress.scala:7: warning: non-variable type argument Int in type pattern (Int, Int) => Int is unchecked since it is eliminated by erasure +unchecked-suppress.scala:8: warning: non-variable type argument Int in type pattern (Int, Int) => Int is unchecked since it is eliminated by erasure case f: ((Int, Int) => Int) => // unchecked ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/unchecked-suppress.flags b/test/files/neg/unchecked-suppress.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/unchecked-suppress.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/unchecked-suppress.scala b/test/files/neg/unchecked-suppress.scala index 7bd61a2a4d98..f10d173ad686 100644 --- a/test/files/neg/unchecked-suppress.scala +++ b/test/files/neg/unchecked-suppress.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class A { def f(x: Any) = x match { case xs: List[String @unchecked] => xs.head // okay diff --git a/test/files/neg/unchecked.check b/test/files/neg/unchecked.check index 033cffb18f59..2071f94f5453 100644 --- a/test/files/neg/unchecked.check +++ b/test/files/neg/unchecked.check @@ -1,19 +1,19 @@ -unchecked.scala:18: warning: non-variable type argument String in type pattern Iterable[String] (the underlying of Iterable[String]) is unchecked since it is eliminated by erasure +unchecked.scala:19: warning: non-variable type argument String in type pattern Iterable[String] (the underlying of Iterable[String]) is unchecked since it is eliminated by erasure case xs: Iterable[String] => xs.head // unchecked ^ -unchecked.scala:22: warning: non-variable type argument Any in type pattern scala.collection.immutable.Set[Any] (the underlying of Set[Any]) is unchecked since it is eliminated by erasure +unchecked.scala:23: warning: non-variable type argument Any in type pattern scala.collection.immutable.Set[Any] (the underlying of Set[Any]) is unchecked since it is eliminated by erasure case xs: Set[Any] => xs.head // unchecked ^ -unchecked.scala:26: warning: non-variable type argument Any in type pattern scala.collection.immutable.Map[Any,Any] (the underlying of Map[Any,Any]) is unchecked since it is eliminated by erasure +unchecked.scala:27: warning: non-variable type argument Any in type pattern scala.collection.immutable.Map[Any,Any] (the underlying of Map[Any,Any]) is unchecked since it is eliminated by erasure case xs: Map[Any, Any] => xs.head // unchecked ^ -unchecked.scala:35: warning: non-variable type argument List[Nothing] in type pattern Test.Contra[List[Nothing]] is unchecked since it is eliminated by erasure +unchecked.scala:36: warning: non-variable type argument List[Nothing] in type pattern Test.Contra[List[Nothing]] is unchecked since it is eliminated by erasure case xs: Contra[List[Nothing]] => xs.head // unchecked ^ -unchecked.scala:50: warning: non-variable type argument String in type pattern Test.Exp[String] is unchecked since it is eliminated by erasure +unchecked.scala:51: warning: non-variable type argument String in type pattern Test.Exp[String] is unchecked since it is eliminated by erasure case ArrayApply(x: Exp[Array[T]], _, j: Exp[String]) => x // unchecked ^ -unchecked.scala:55: warning: non-variable type argument Array[T] in type pattern Test.Exp[Array[T]] is unchecked since it is eliminated by erasure +unchecked.scala:56: warning: non-variable type argument Array[T] in type pattern Test.Exp[Array[T]] is unchecked since it is eliminated by erasure case ArrayApply(x: Exp[Array[T]], _, _) => x // unchecked ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/unchecked.flags b/test/files/neg/unchecked.flags deleted file mode 100644 index 464cc20ea684..000000000000 --- a/test/files/neg/unchecked.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -unchecked \ No newline at end of file diff --git a/test/files/neg/unchecked.scala b/test/files/neg/unchecked.scala index e491b253ba9d..23343f17aa78 100644 --- a/test/files/neg/unchecked.scala +++ b/test/files/neg/unchecked.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -unchecked import language.existentials object Test { diff --git a/test/files/neg/unchecked2.check b/test/files/neg/unchecked2.check index a7b83918565f..ed1d7c71db82 100644 --- a/test/files/neg/unchecked2.check +++ b/test/files/neg/unchecked2.check @@ -1,43 +1,43 @@ -unchecked2.scala:4: warning: fruitless type test: a value of type Some[List[Int]] cannot also be a Option[List[String]] (but still might match its erasure) +unchecked2.scala:5: warning: fruitless type test: a value of type Some[List[Int]] cannot also be a Option[List[String]] (but still might match its erasure) /* warn */ Some(List(1)).isInstanceOf[Option[List[String]]] ^ -unchecked2.scala:5: warning: non-variable type argument Option[_] in type Option[Option[_]] is unchecked since it is eliminated by erasure +unchecked2.scala:6: warning: non-variable type argument Option[_] in type Option[Option[_]] is unchecked since it is eliminated by erasure /* warn */ Some(123).isInstanceOf[Option[Option[_]]] ^ -unchecked2.scala:6: warning: fruitless type test: a value of type Some[Int] cannot also be a Option[String] (but still might match its erasure) +unchecked2.scala:7: warning: fruitless type test: a value of type Some[Int] cannot also be a Option[String] (but still might match its erasure) /* warn */ Some(123).isInstanceOf[Option[String]] ^ -unchecked2.scala:7: warning: fruitless type test: a value of type Some[Int] cannot also be a Option[List[String]] (but still might match its erasure) +unchecked2.scala:8: warning: fruitless type test: a value of type Some[Int] cannot also be a Option[List[String]] (but still might match its erasure) /* warn */ Some(123).isInstanceOf[Option[List[String]]] ^ -unchecked2.scala:8: warning: fruitless type test: a value of type Some[Int] cannot also be a Option[List[Int => String]] (but still might match its erasure) +unchecked2.scala:9: warning: fruitless type test: a value of type Some[Int] cannot also be a Option[List[Int => String]] (but still might match its erasure) /* warn */ Some(123).isInstanceOf[Option[List[Int => String]]] ^ -unchecked2.scala:9: warning: fruitless type test: a value of type Some[Int] cannot also be a Option[(String, Double)] (but still might match its erasure) +unchecked2.scala:10: warning: fruitless type test: a value of type Some[Int] cannot also be a Option[(String, Double)] (but still might match its erasure) /* warn */ Some(123).isInstanceOf[Option[(String, Double)]] ^ -unchecked2.scala:10: warning: fruitless type test: a value of type Some[Int] cannot also be a Option[String => Double] (but still might match its erasure) +unchecked2.scala:11: warning: fruitless type test: a value of type Some[Int] cannot also be a Option[String => Double] (but still might match its erasure) /* warn */ Some(123).isInstanceOf[Option[String => Double]] ^ -unchecked2.scala:14: warning: non-variable type argument List[String] in type Option[List[String]] is unchecked since it is eliminated by erasure +unchecked2.scala:15: warning: non-variable type argument List[String] in type Option[List[String]] is unchecked since it is eliminated by erasure /* warn */ (Some(List(1)): Any).isInstanceOf[Option[List[String]]] ^ -unchecked2.scala:15: warning: non-variable type argument Int in type Option[Int] is unchecked since it is eliminated by erasure +unchecked2.scala:16: warning: non-variable type argument Int in type Option[Int] is unchecked since it is eliminated by erasure /* warn */ (Some(123): Any).isInstanceOf[Option[Int]] ^ -unchecked2.scala:16: warning: non-variable type argument String in type Option[String] is unchecked since it is eliminated by erasure +unchecked2.scala:17: warning: non-variable type argument String in type Option[String] is unchecked since it is eliminated by erasure /* warn */ (Some(123): Any).isInstanceOf[Option[String]] ^ -unchecked2.scala:17: warning: non-variable type argument List[String] in type Option[List[String]] is unchecked since it is eliminated by erasure +unchecked2.scala:18: warning: non-variable type argument List[String] in type Option[List[String]] is unchecked since it is eliminated by erasure /* warn */ (Some(123): Any).isInstanceOf[Option[List[String]]] ^ -unchecked2.scala:18: warning: non-variable type argument List[Int => String] in type Option[List[Int => String]] is unchecked since it is eliminated by erasure +unchecked2.scala:19: warning: non-variable type argument List[Int => String] in type Option[List[Int => String]] is unchecked since it is eliminated by erasure /* warn */ (Some(123): Any).isInstanceOf[Option[List[Int => String]]] ^ -unchecked2.scala:19: warning: non-variable type argument (String, Double) in type Option[(String, Double)] is unchecked since it is eliminated by erasure +unchecked2.scala:20: warning: non-variable type argument (String, Double) in type Option[(String, Double)] is unchecked since it is eliminated by erasure /* warn */ (Some(123): Any).isInstanceOf[Option[(String, Double)]] ^ -unchecked2.scala:20: warning: non-variable type argument String => Double in type Option[String => Double] is unchecked since it is eliminated by erasure +unchecked2.scala:21: warning: non-variable type argument String => Double in type Option[String => Double] is unchecked since it is eliminated by erasure /* warn */ (Some(123): Any).isInstanceOf[Option[String => Double]] ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/unchecked2.flags b/test/files/neg/unchecked2.flags deleted file mode 100644 index 144ddac9d3d8..000000000000 --- a/test/files/neg/unchecked2.flags +++ /dev/null @@ -1 +0,0 @@ --unchecked -Xfatal-warnings diff --git a/test/files/neg/unchecked2.scala b/test/files/neg/unchecked2.scala index 616b05aad8b1..851eeee08473 100644 --- a/test/files/neg/unchecked2.scala +++ b/test/files/neg/unchecked2.scala @@ -1,3 +1,4 @@ +// scalac: -unchecked -Xfatal-warnings object Test { // These warn because it can be statically shown they won't match. diff --git a/test/files/neg/unchecked3.check b/test/files/neg/unchecked3.check index 0a526050fcb4..bff551d55898 100644 --- a/test/files/neg/unchecked3.check +++ b/test/files/neg/unchecked3.check @@ -1,40 +1,40 @@ -unchecked3.scala:24: warning: non-variable type argument Double in type pattern E1[Double] is unchecked since it is eliminated by erasure +unchecked3.scala:25: warning: non-variable type argument Double in type pattern E1[Double] is unchecked since it is eliminated by erasure /* warn */ def peerTypes2(x: B1[Int]) = x match { case _: E1[Double] => true } ^ -unchecked3.scala:25: warning: non-variable type argument Double in type pattern F1[Double] is unchecked since it is eliminated by erasure +unchecked3.scala:26: warning: non-variable type argument Double in type pattern F1[Double] is unchecked since it is eliminated by erasure /* warn */ def peerTypes3(x: B1[_]) = x match { case _: F1[Double] => true } ^ -unchecked3.scala:28: warning: non-variable type argument Int in type pattern A2[Int] is unchecked since it is eliminated by erasure +unchecked3.scala:29: warning: non-variable type argument Int in type pattern A2[Int] is unchecked since it is eliminated by erasure /* warn */ def twotypes1[T](x: B2[T, Int]) = x match { case _: A2[Int] => true } ^ -unchecked3.scala:32: warning: non-variable type argument Int in type pattern B2[_,Int] is unchecked since it is eliminated by erasure +unchecked3.scala:33: warning: non-variable type argument Int in type pattern B2[_,Int] is unchecked since it is eliminated by erasure /* warn */ def twotypes5[T](x: A2[T]) = x match { case _: B2[_, Int] => true } ^ -unchecked3.scala:40: warning: non-variable type argument String in type pattern Array[List[String]] is unchecked since it is eliminated by erasure +unchecked3.scala:41: warning: non-variable type argument String in type pattern Array[List[String]] is unchecked since it is eliminated by erasure /* warn */ case _: Array[List[String]] => () ^ -unchecked3.scala:43: warning: non-variable type argument String in type pattern Array[Array[List[String]]] is unchecked since it is eliminated by erasure +unchecked3.scala:44: warning: non-variable type argument String in type pattern Array[Array[List[String]]] is unchecked since it is eliminated by erasure /* warn */ case _: Array[Array[List[String]]] => () ^ -unchecked3.scala:50: warning: non-variable type argument String in type pattern Array[List[String]] is unchecked since it is eliminated by erasure +unchecked3.scala:51: warning: non-variable type argument String in type pattern Array[List[String]] is unchecked since it is eliminated by erasure /* warn */ case _: Array[List[String]] => () ^ -unchecked3.scala:53: warning: non-variable type argument String in type pattern Array[Array[List[String]]] is unchecked since it is eliminated by erasure +unchecked3.scala:54: warning: non-variable type argument String in type pattern Array[Array[List[String]]] is unchecked since it is eliminated by erasure /* warn */ case _: Array[Array[List[String]]] => () ^ -unchecked3.scala:60: warning: non-variable type argument String in type pattern Array[List[String]] is unchecked since it is eliminated by erasure +unchecked3.scala:61: warning: non-variable type argument String in type pattern Array[List[String]] is unchecked since it is eliminated by erasure /* warn */ case _: Array[List[String]] => () ^ -unchecked3.scala:62: warning: non-variable type argument Array[String] in type pattern Array[List[Array[String]]] is unchecked since it is eliminated by erasure +unchecked3.scala:63: warning: non-variable type argument Array[String] in type pattern Array[List[Array[String]]] is unchecked since it is eliminated by erasure /* warn */ case _: Array[List[Array[String]]] => () ^ -unchecked3.scala:63: warning: non-variable type argument String in type pattern Array[Array[List[String]]] is unchecked since it is eliminated by erasure +unchecked3.scala:64: warning: non-variable type argument String in type pattern Array[Array[List[String]]] is unchecked since it is eliminated by erasure /* warn */ case _: Array[Array[List[String]]] => () ^ -unchecked3.scala:75: warning: abstract type A in type pattern scala.collection.immutable.Set[Q.this.A] (the underlying of Set[Q.this.A]) is unchecked since it is eliminated by erasure +unchecked3.scala:76: warning: abstract type A in type pattern scala.collection.immutable.Set[Q.this.A] (the underlying of Set[Q.this.A]) is unchecked since it is eliminated by erasure /* warn */ case xs: Set[A] => xs.head ^ -unchecked3.scala:62: warning: unreachable code +unchecked3.scala:63: warning: unreachable code /* warn */ case _: Array[List[Array[String]]] => () ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/unchecked3.flags b/test/files/neg/unchecked3.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/unchecked3.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/unchecked3.scala b/test/files/neg/unchecked3.scala index 7b8c13e8f88f..3834952a7e2b 100644 --- a/test/files/neg/unchecked3.scala +++ b/test/files/neg/unchecked3.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed trait A2[T1] final class B2[T1, T2] extends A2[T1] diff --git a/test/files/neg/unit-returns-value.check b/test/files/neg/unit-returns-value.check index a35e38f0a965..7ee462b8ee1d 100644 --- a/test/files/neg/unit-returns-value.check +++ b/test/files/neg/unit-returns-value.check @@ -1,13 +1,13 @@ -unit-returns-value.scala:4: warning: enclosing method f has result type Unit: return value of type Int(5) discarded +unit-returns-value.scala:5: warning: enclosing method f has result type Unit: return value of type Int(5) discarded if (b) return 5 ^ -unit-returns-value.scala:4: warning: a pure expression does nothing in statement position +unit-returns-value.scala:5: warning: a pure expression does nothing in statement position if (b) return 5 ^ -unit-returns-value.scala:22: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses +unit-returns-value.scala:23: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses i1 // warn ^ -unit-returns-value.scala:23: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses +unit-returns-value.scala:24: warning: a pure expression does nothing in statement position; multiline expressions might require enclosing parentheses i2 // warn ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/unit-returns-value.flags b/test/files/neg/unit-returns-value.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/unit-returns-value.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/unit-returns-value.scala b/test/files/neg/unit-returns-value.scala index fc5a37069fc7..586135df91f7 100644 --- a/test/files/neg/unit-returns-value.scala +++ b/test/files/neg/unit-returns-value.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { def f { var b = false diff --git a/test/files/neg/unreachablechar.check b/test/files/neg/unreachablechar.check index a621196c568c..e88919c3201b 100644 --- a/test/files/neg/unreachablechar.check +++ b/test/files/neg/unreachablechar.check @@ -1,10 +1,10 @@ -unreachablechar.scala:4: warning: patterns after a variable pattern cannot match (SLS 8.1.1) +unreachablechar.scala:5: warning: patterns after a variable pattern cannot match (SLS 8.1.1) case _ => println("stuff"); ^ -unreachablechar.scala:5: warning: unreachable code due to variable pattern on line 4 +unreachablechar.scala:6: warning: unreachable code due to variable pattern on line 5 case 'f' => println("not stuff?"); ^ -unreachablechar.scala:5: warning: unreachable code +unreachablechar.scala:6: warning: unreachable code case 'f' => println("not stuff?"); ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/unreachablechar.flags b/test/files/neg/unreachablechar.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/unreachablechar.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/unreachablechar.scala b/test/files/neg/unreachablechar.scala index ed04c5cd3584..1290b4b33167 100644 --- a/test/files/neg/unreachablechar.scala +++ b/test/files/neg/unreachablechar.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Foo extends App{ 'f' match { case 'o'|'c'|'b' => println("Oooo"); diff --git a/test/files/neg/virtpatmat_exhaust_big.check b/test/files/neg/virtpatmat_exhaust_big.check index fddc85a36295..37aa7cdfd213 100644 --- a/test/files/neg/virtpatmat_exhaust_big.check +++ b/test/files/neg/virtpatmat_exhaust_big.check @@ -1,4 +1,4 @@ -virtpatmat_exhaust_big.scala:27: warning: match may not be exhaustive. +virtpatmat_exhaust_big.scala:28: warning: match may not be exhaustive. It would fail on the following input: Z11() def foo(z: Z) = z match { ^ diff --git a/test/files/neg/virtpatmat_exhaust_big.flags b/test/files/neg/virtpatmat_exhaust_big.flags deleted file mode 100644 index b5a874865273..000000000000 --- a/test/files/neg/virtpatmat_exhaust_big.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -unchecked diff --git a/test/files/neg/virtpatmat_exhaust_big.scala b/test/files/neg/virtpatmat_exhaust_big.scala index dd639eb56ee0..8d74bacc44de 100644 --- a/test/files/neg/virtpatmat_exhaust_big.scala +++ b/test/files/neg/virtpatmat_exhaust_big.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -unchecked sealed abstract class Z object Z { object Z0 extends Z diff --git a/test/files/neg/virtpatmat_exhaust_compound.check b/test/files/neg/virtpatmat_exhaust_compound.check index 72e034068263..a6c263882583 100644 --- a/test/files/neg/virtpatmat_exhaust_compound.check +++ b/test/files/neg/virtpatmat_exhaust_compound.check @@ -1,12 +1,12 @@ -virtpatmat_exhaust_compound.scala:14: warning: match may not be exhaustive. +virtpatmat_exhaust_compound.scala:15: warning: match may not be exhaustive. It would fail on the following inputs: O1, O2, O4 a match { ^ -virtpatmat_exhaust_compound.scala:18: warning: match may not be exhaustive. +virtpatmat_exhaust_compound.scala:19: warning: match may not be exhaustive. It would fail on the following input: O4 def t1(a: Product with Base with Base2) = a match { ^ -virtpatmat_exhaust_compound.scala:22: warning: match may not be exhaustive. +virtpatmat_exhaust_compound.scala:23: warning: match may not be exhaustive. It would fail on the following input: O2 def t2(a: Product with Base { def foo: Int }) = a match { ^ diff --git a/test/files/neg/virtpatmat_exhaust_compound.flags b/test/files/neg/virtpatmat_exhaust_compound.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/virtpatmat_exhaust_compound.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/virtpatmat_exhaust_compound.scala b/test/files/neg/virtpatmat_exhaust_compound.scala index 4ff04dd06a35..79b52dc74222 100644 --- a/test/files/neg/virtpatmat_exhaust_compound.scala +++ b/test/files/neg/virtpatmat_exhaust_compound.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed trait Base case object O1 extends Base case object O2 extends Base { diff --git a/test/files/neg/virtpatmat_reach_null.check b/test/files/neg/virtpatmat_reach_null.check index e0c36c8c5b3c..b0e7638d0afc 100644 --- a/test/files/neg/virtpatmat_reach_null.check +++ b/test/files/neg/virtpatmat_reach_null.check @@ -1,4 +1,4 @@ -virtpatmat_reach_null.scala:13: warning: unreachable code +virtpatmat_reach_null.scala:14: warning: unreachable code case _ => // unreachable ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/virtpatmat_reach_null.flags b/test/files/neg/virtpatmat_reach_null.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/virtpatmat_reach_null.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/virtpatmat_reach_null.scala b/test/files/neg/virtpatmat_reach_null.scala index 6314a5b1d84a..60b94a277a5e 100644 --- a/test/files/neg/virtpatmat_reach_null.scala +++ b/test/files/neg/virtpatmat_reach_null.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed abstract class Const { final def excludes(other: Const) = (this, other) match { diff --git a/test/files/neg/virtpatmat_reach_sealed_unsealed.check b/test/files/neg/virtpatmat_reach_sealed_unsealed.check index 064a12bcaa4b..6e8b3b8f230c 100644 --- a/test/files/neg/virtpatmat_reach_sealed_unsealed.check +++ b/test/files/neg/virtpatmat_reach_sealed_unsealed.check @@ -1,14 +1,14 @@ -virtpatmat_reach_sealed_unsealed.scala:16: warning: match may not be exhaustive. +virtpatmat_reach_sealed_unsealed.scala:17: warning: match may not be exhaustive. It would fail on the following input: false (true: Boolean) match { case true => } // not exhaustive, but reachable ^ -virtpatmat_reach_sealed_unsealed.scala:18: warning: unreachable code +virtpatmat_reach_sealed_unsealed.scala:19: warning: unreachable code (true: Boolean) match { case true => case false => case _ => } // exhaustive, last case is unreachable ^ -virtpatmat_reach_sealed_unsealed.scala:19: warning: unreachable code +virtpatmat_reach_sealed_unsealed.scala:20: warning: unreachable code (true: Boolean) match { case true => case false => case _: Boolean => } // exhaustive, last case is unreachable ^ -virtpatmat_reach_sealed_unsealed.scala:20: warning: unreachable code +virtpatmat_reach_sealed_unsealed.scala:21: warning: unreachable code (true: Boolean) match { case true => case false => case _: Any => } // exhaustive, last case is unreachable ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/virtpatmat_reach_sealed_unsealed.flags b/test/files/neg/virtpatmat_reach_sealed_unsealed.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/neg/virtpatmat_reach_sealed_unsealed.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/virtpatmat_reach_sealed_unsealed.scala b/test/files/neg/virtpatmat_reach_sealed_unsealed.scala index 13911dbd7869..b701a292d07c 100644 --- a/test/files/neg/virtpatmat_reach_sealed_unsealed.scala +++ b/test/files/neg/virtpatmat_reach_sealed_unsealed.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed abstract class X sealed case class A(x: Int) extends X @@ -18,4 +19,4 @@ object Test extends App { (true: Boolean) match { case true => case false => case _ => } // exhaustive, last case is unreachable (true: Boolean) match { case true => case false => case _: Boolean => } // exhaustive, last case is unreachable (true: Boolean) match { case true => case false => case _: Any => } // exhaustive, last case is unreachable -} \ No newline at end of file +} diff --git a/test/files/neg/virtpatmat_unreach_select.check b/test/files/neg/virtpatmat_unreach_select.check index 4fc78cd4122d..bfcc79ced172 100644 --- a/test/files/neg/virtpatmat_unreach_select.check +++ b/test/files/neg/virtpatmat_unreach_select.check @@ -1,4 +1,4 @@ -virtpatmat_unreach_select.scala:10: warning: unreachable code +virtpatmat_unreach_select.scala:11: warning: unreachable code case WARNING.id => // unreachable ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/virtpatmat_unreach_select.flags b/test/files/neg/virtpatmat_unreach_select.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/virtpatmat_unreach_select.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/virtpatmat_unreach_select.scala b/test/files/neg/virtpatmat_unreach_select.scala index c46ff15453de..e76a5149d7cc 100644 --- a/test/files/neg/virtpatmat_unreach_select.scala +++ b/test/files/neg/virtpatmat_unreach_select.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class Test { object severity extends Enumeration class Severity(val id: Int) extends severity.Value diff --git a/test/files/neg/warn-inferred-any.check b/test/files/neg/warn-inferred-any.check index 2b321a83c99a..8381b8e70d55 100644 --- a/test/files/neg/warn-inferred-any.check +++ b/test/files/neg/warn-inferred-any.check @@ -1,13 +1,13 @@ -warn-inferred-any.scala:8: warning: a type was inferred to be `Any`; this may indicate a programming error. +warn-inferred-any.scala:9: warning: a type was inferred to be `Any`; this may indicate a programming error. { List(1, 2, 3) contains "a" } // only this warns ^ -warn-inferred-any.scala:16: warning: a type was inferred to be `AnyVal`; this may indicate a programming error. +warn-inferred-any.scala:17: warning: a type was inferred to be `AnyVal`; this may indicate a programming error. { 1l to 5l contains 5 } ^ -warn-inferred-any.scala:17: warning: a type was inferred to be `AnyVal`; this may indicate a programming error. +warn-inferred-any.scala:18: warning: a type was inferred to be `AnyVal`; this may indicate a programming error. { 1l to 5l contains 5d } ^ -warn-inferred-any.scala:25: warning: a type was inferred to be `Any`; this may indicate a programming error. +warn-inferred-any.scala:26: warning: a type was inferred to be `Any`; this may indicate a programming error. def za = f(1, "one") ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/warn-inferred-any.flags b/test/files/neg/warn-inferred-any.flags deleted file mode 100644 index b580dfbbe3d7..000000000000 --- a/test/files/neg/warn-inferred-any.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xlint:infer-any diff --git a/test/files/neg/warn-inferred-any.scala b/test/files/neg/warn-inferred-any.scala index 693c33e7be06..a2d3f40630c6 100644 --- a/test/files/neg/warn-inferred-any.scala +++ b/test/files/neg/warn-inferred-any.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:infer-any trait Foo[-A <: AnyRef, +B <: AnyRef] { def run[U](x: A)(action: B => U): Boolean = ??? diff --git a/test/files/neg/warn-unused-implicits.check b/test/files/neg/warn-unused-implicits.check index 4cc583680006..ca6bb32dc5e4 100644 --- a/test/files/neg/warn-unused-implicits.check +++ b/test/files/neg/warn-unused-implicits.check @@ -1,7 +1,7 @@ -warn-unused-implicits.scala:11: warning: parameter value s in method f is never used +warn-unused-implicits.scala:12: warning: parameter value s in method f is never used )(implicit s: String): Int = { // warn ^ -warn-unused-implicits.scala:31: warning: parameter value s in method i is never used +warn-unused-implicits.scala:32: warning: parameter value s in method i is never used def i(implicit s: String, t: Int) = t // yes, warn ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/warn-unused-implicits.flags b/test/files/neg/warn-unused-implicits.flags deleted file mode 100644 index 18169f3218f7..000000000000 --- a/test/files/neg/warn-unused-implicits.flags +++ /dev/null @@ -1 +0,0 @@ --Ywarn-unused:implicits -Xfatal-warnings diff --git a/test/files/neg/warn-unused-implicits.scala b/test/files/neg/warn-unused-implicits.scala index 54f924eac002..5114bb9db663 100644 --- a/test/files/neg/warn-unused-implicits.scala +++ b/test/files/neg/warn-unused-implicits.scala @@ -1,3 +1,4 @@ +// scalac: -Ywarn-unused:implicits -Xfatal-warnings trait InterFace { /** Call something. */ diff --git a/test/files/neg/warn-unused-imports.check b/test/files/neg/warn-unused-imports.check index 0a53d7a9cd24..90533f0078fb 100644 --- a/test/files/neg/warn-unused-imports.check +++ b/test/files/neg/warn-unused-imports.check @@ -1,54 +1,54 @@ -warn-unused-imports_2.scala:133: error: type mismatch; +warn-unused-imports_2.scala:134: error: type mismatch; found : Int(42) required: Sample.X f(42) // error ^ -warn-unused-imports_2.scala:57: warning: Unused import +warn-unused-imports_2.scala:58: warning: Unused import import p1.A // warn ^ -warn-unused-imports_2.scala:62: warning: Unused import +warn-unused-imports_2.scala:63: warning: Unused import import p1.{ A, B } // warn on A ^ -warn-unused-imports_2.scala:67: warning: Unused import +warn-unused-imports_2.scala:68: warning: Unused import import p1.{ A, B } // warn on both ^ -warn-unused-imports_2.scala:67: warning: Unused import +warn-unused-imports_2.scala:68: warning: Unused import import p1.{ A, B } // warn on both ^ -warn-unused-imports_2.scala:73: warning: Unused import +warn-unused-imports_2.scala:74: warning: Unused import import c._ // warn ^ -warn-unused-imports_2.scala:78: warning: Unused import +warn-unused-imports_2.scala:79: warning: Unused import import p1._ // warn ^ -warn-unused-imports_2.scala:85: warning: Unused import +warn-unused-imports_2.scala:86: warning: Unused import import c._ // warn ^ -warn-unused-imports_2.scala:91: warning: Unused import +warn-unused-imports_2.scala:92: warning: Unused import import p1.c._ // warn ^ -warn-unused-imports_2.scala:98: warning: Unused import +warn-unused-imports_2.scala:99: warning: Unused import import p1._ // warn ^ -warn-unused-imports_2.scala:118: warning: Unused import +warn-unused-imports_2.scala:119: warning: Unused import import p1.A // warn ^ -warn-unused-imports_2.scala:132: warning: Unused import +warn-unused-imports_2.scala:133: warning: Unused import import Sample.Implicits._ // warn ^ -warn-unused-imports_2.scala:143: warning: Unused import +warn-unused-imports_2.scala:144: warning: Unused import import Sample.Implicits.useless // warn ^ -warn-unused-imports_2.scala:147: warning: Unused import +warn-unused-imports_2.scala:148: warning: Unused import import java.io.File // warn ^ -warn-unused-imports_2.scala:148: warning: Unused import +warn-unused-imports_2.scala:149: warning: Unused import import scala.concurrent.Future // warn ^ -warn-unused-imports_2.scala:149: warning: Unused import +warn-unused-imports_2.scala:150: warning: Unused import import scala.concurrent.ExecutionContext.Implicits.global // warn ^ -warn-unused-imports_2.scala:150: warning: Unused import +warn-unused-imports_2.scala:151: warning: Unused import import p1.A // warn ^ 16 warnings found diff --git a/test/files/neg/warn-unused-imports.flags b/test/files/neg/warn-unused-imports.flags deleted file mode 100644 index c4e11e7fe70c..000000000000 --- a/test/files/neg/warn-unused-imports.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Ywarn-unused:imports diff --git a/test/files/neg/warn-unused-imports/sample_1.scala b/test/files/neg/warn-unused-imports/sample_1.scala index eea4d0eb4c51..d07b82ac24bc 100644 --- a/test/files/neg/warn-unused-imports/sample_1.scala +++ b/test/files/neg/warn-unused-imports/sample_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ywarn-unused:imports import language._ diff --git a/test/files/neg/warn-unused-imports/warn-unused-imports_2.scala b/test/files/neg/warn-unused-imports/warn-unused-imports_2.scala index 47db5f5ecab9..ccee51b9d8b7 100644 --- a/test/files/neg/warn-unused-imports/warn-unused-imports_2.scala +++ b/test/files/neg/warn-unused-imports/warn-unused-imports_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ywarn-unused:imports class Bippo { def length: Int = 123 class Tree diff --git a/test/files/neg/warn-unused-locals.check b/test/files/neg/warn-unused-locals.check index bc74cb2c1bc4..dfa8bed6ae1b 100644 --- a/test/files/neg/warn-unused-locals.check +++ b/test/files/neg/warn-unused-locals.check @@ -1,22 +1,22 @@ -warn-unused-locals.scala:7: warning: local var x in method f0 is never used +warn-unused-locals.scala:8: warning: local var x in method f0 is never used var x = 1 // warn ^ -warn-unused-locals.scala:14: warning: local val b in method f1 is never used +warn-unused-locals.scala:15: warning: local val b in method f1 is never used val b = new Outer // warn ^ -warn-unused-locals.scala:25: warning: local object HiObject in method l1 is never used +warn-unused-locals.scala:26: warning: local object HiObject in method l1 is never used object HiObject { def f = this } // warn ^ -warn-unused-locals.scala:26: warning: local class Hi is never used +warn-unused-locals.scala:27: warning: local class Hi is never used class Hi { // warn ^ -warn-unused-locals.scala:30: warning: local class DingDongDoobie is never used +warn-unused-locals.scala:31: warning: local class DingDongDoobie is never used class DingDongDoobie // warn ^ -warn-unused-locals.scala:33: warning: local type OtherThing is never used +warn-unused-locals.scala:34: warning: local type OtherThing is never used type OtherThing = String // warn ^ -warn-unused-locals.scala:18: warning: local var x in method f2 is never updated: consider using immutable val +warn-unused-locals.scala:19: warning: local var x in method f2 is never updated: consider using immutable val var x = 100 // warn about it being a var ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/warn-unused-locals.flags b/test/files/neg/warn-unused-locals.flags deleted file mode 100644 index d5de20558576..000000000000 --- a/test/files/neg/warn-unused-locals.flags +++ /dev/null @@ -1 +0,0 @@ --Ywarn-unused:locals -Xfatal-warnings \ No newline at end of file diff --git a/test/files/neg/warn-unused-locals.scala b/test/files/neg/warn-unused-locals.scala index 712f3c221a1e..4940ba77d3e0 100644 --- a/test/files/neg/warn-unused-locals.scala +++ b/test/files/neg/warn-unused-locals.scala @@ -1,3 +1,4 @@ +// scalac: -Ywarn-unused:locals -Xfatal-warnings class Outer { class Inner } diff --git a/test/files/neg/warn-unused-params.check b/test/files/neg/warn-unused-params.check index 7a14cb3dc83d..89c4368e3267 100644 --- a/test/files/neg/warn-unused-params.check +++ b/test/files/neg/warn-unused-params.check @@ -1,22 +1,22 @@ -warn-unused-params.scala:9: warning: parameter value b in method f is never used +warn-unused-params.scala:10: warning: parameter value b in method f is never used b: String, // warn ^ -warn-unused-params.scala:32: warning: parameter value s in method i is never used +warn-unused-params.scala:33: warning: parameter value s in method i is never used def i(implicit s: String) = 42 // yes, warn ^ -warn-unused-params.scala:49: warning: parameter value u in class Unusing is never used +warn-unused-params.scala:50: warning: parameter value u in class Unusing is never used class Unusing(u: Int) { // warn ^ -warn-unused-params.scala:59: warning: parameter value s in class CaseyAtTheBat is never used +warn-unused-params.scala:60: warning: parameter value s in class CaseyAtTheBat is never used case class CaseyAtTheBat(k: Int)(s: String) // warn ^ -warn-unused-params.scala:62: warning: parameter value readResolve in method f is never used +warn-unused-params.scala:63: warning: parameter value readResolve in method f is never used def f(readResolve: Int) = 42 // warn ^ -warn-unused-params.scala:76: warning: parameter value i in value $anonfun is never used +warn-unused-params.scala:77: warning: parameter value i in value $anonfun is never used def f = (i: Int) => 42 // warn ^ -warn-unused-params.scala:82: warning: parameter value i in value $anonfun is never used +warn-unused-params.scala:83: warning: parameter value i in value $anonfun is never used def g = for (i <- List(1)) yield 42 // warn map.(i => 42) ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/warn-unused-params.flags b/test/files/neg/warn-unused-params.flags deleted file mode 100644 index 795fb74272e8..000000000000 --- a/test/files/neg/warn-unused-params.flags +++ /dev/null @@ -1 +0,0 @@ --Ywarn-unused:params -Xfatal-warnings diff --git a/test/files/neg/warn-unused-params.scala b/test/files/neg/warn-unused-params.scala index 246098176950..1fe87efaf265 100644 --- a/test/files/neg/warn-unused-params.scala +++ b/test/files/neg/warn-unused-params.scala @@ -1,3 +1,4 @@ +// scalac: -Ywarn-unused:params -Xfatal-warnings trait InterFace { /** Call something. */ diff --git a/test/files/neg/warn-unused-patvars.check b/test/files/neg/warn-unused-patvars.check index 9f89a001cd1a..0acb6fb05e67 100644 --- a/test/files/neg/warn-unused-patvars.check +++ b/test/files/neg/warn-unused-patvars.check @@ -1,4 +1,4 @@ -warn-unused-patvars.scala:9: warning: private val x in trait Boundings is never used +warn-unused-patvars.scala:10: warning: private val x in trait Boundings is never used private val x = 42 // warn, sanity check ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/warn-unused-patvars.flags b/test/files/neg/warn-unused-patvars.flags deleted file mode 100644 index d5bd86a65814..000000000000 --- a/test/files/neg/warn-unused-patvars.flags +++ /dev/null @@ -1 +0,0 @@ --Ywarn-unused:-patvars,_ -Xfatal-warnings diff --git a/test/files/neg/warn-unused-patvars.scala b/test/files/neg/warn-unused-patvars.scala index c6130fdeea8a..34905a31ecc8 100644 --- a/test/files/neg/warn-unused-patvars.scala +++ b/test/files/neg/warn-unused-patvars.scala @@ -1,3 +1,4 @@ +// scalac: -Ywarn-unused:-patvars,_ -Xfatal-warnings // verify no warning when -Ywarn-unused:-patvars diff --git a/test/files/neg/warn-unused-privates.check b/test/files/neg/warn-unused-privates.check index 36fe7eae1e21..bfec9ad9e8c3 100644 --- a/test/files/neg/warn-unused-privates.check +++ b/test/files/neg/warn-unused-privates.check @@ -1,70 +1,70 @@ -warn-unused-privates.scala:2: warning: private constructor in class Bippy is never used +warn-unused-privates.scala:3: warning: private constructor in class Bippy is never used private def this(c: Int) = this(c, c) // warn ^ -warn-unused-privates.scala:4: warning: private method boop in class Bippy is never used +warn-unused-privates.scala:5: warning: private method boop in class Bippy is never used private def boop(x: Int) = x+a+b // warn ^ -warn-unused-privates.scala:6: warning: private val MILLIS2 in class Bippy is never used +warn-unused-privates.scala:7: warning: private val MILLIS2 in class Bippy is never used final private val MILLIS2: Int = 1000 // warn ^ -warn-unused-privates.scala:13: warning: private val HEY_INSTANCE in object Bippy is never used +warn-unused-privates.scala:14: warning: private val HEY_INSTANCE in object Bippy is never used private val HEY_INSTANCE: Int = 1000 // warn ^ -warn-unused-privates.scala:14: warning: private val BOOL in object Bippy is never used +warn-unused-privates.scala:15: warning: private val BOOL in object Bippy is never used private lazy val BOOL: Boolean = true // warn ^ -warn-unused-privates.scala:36: warning: private val hummer in class Boppy is never used +warn-unused-privates.scala:37: warning: private val hummer in class Boppy is never used private val hummer = "def" // warn ^ -warn-unused-privates.scala:43: warning: private var v1 in trait Accessors is never used +warn-unused-privates.scala:44: warning: private var v1 in trait Accessors is never used private var v1: Int = 0 // warn ^ -warn-unused-privates.scala:44: warning: private var v2 in trait Accessors is never used +warn-unused-privates.scala:45: warning: private var v2 in trait Accessors is never used private var v2: Int = 0 // warn, never set ^ -warn-unused-privates.scala:45: warning: private var v3 in trait Accessors is never used +warn-unused-privates.scala:46: warning: private var v3 in trait Accessors is never used private var v3: Int = 0 // warn, never got ^ -warn-unused-privates.scala:56: warning: private var s1 in class StableAccessors is never used +warn-unused-privates.scala:57: warning: private var s1 in class StableAccessors is never used private var s1: Int = 0 // warn ^ -warn-unused-privates.scala:57: warning: private var s2 in class StableAccessors is never updated: consider using immutable val +warn-unused-privates.scala:58: warning: private var s2 in class StableAccessors is never updated: consider using immutable val private var s2: Int = 0 // warn, never set ^ -warn-unused-privates.scala:58: warning: private var s3 in class StableAccessors is never used +warn-unused-privates.scala:59: warning: private var s3 in class StableAccessors is never used private var s3: Int = 0 // warn, never got ^ -warn-unused-privates.scala:70: warning: private default argument in trait DefaultArgs is never used +warn-unused-privates.scala:71: warning: private default argument in trait DefaultArgs is never used private def bippy(x1: Int, x2: Int = 10, x3: Int = 15): Int = x1 + x2 + x3 ^ -warn-unused-privates.scala:70: warning: private default argument in trait DefaultArgs is never used +warn-unused-privates.scala:71: warning: private default argument in trait DefaultArgs is never used private def bippy(x1: Int, x2: Int = 10, x3: Int = 15): Int = x1 + x2 + x3 ^ -warn-unused-privates.scala:103: warning: private object Dongo in object Types is never used +warn-unused-privates.scala:104: warning: private object Dongo in object Types is never used private object Dongo { def f = this } // warn ^ -warn-unused-privates.scala:136: warning: private method x_= in class OtherNames is never used +warn-unused-privates.scala:137: warning: private method x_= in class OtherNames is never used private def x_=(i: Int): Unit = () ^ -warn-unused-privates.scala:137: warning: private method x in class OtherNames is never used +warn-unused-privates.scala:138: warning: private method x in class OtherNames is never used private def x: Int = 42 ^ -warn-unused-privates.scala:138: warning: private method y_= in class OtherNames is never used +warn-unused-privates.scala:139: warning: private method y_= in class OtherNames is never used private def y_=(i: Int): Unit = () ^ -warn-unused-privates.scala:104: warning: private class Bar1 in object Types is never used +warn-unused-privates.scala:105: warning: private class Bar1 in object Types is never used private class Bar1 // warn ^ -warn-unused-privates.scala:106: warning: private type Alias1 in object Types is never used +warn-unused-privates.scala:107: warning: private type Alias1 in object Types is never used private type Alias1 = String // warn ^ -warn-unused-privates.scala:216: warning: private class for your eyes only in object not even using companion privates is never used +warn-unused-privates.scala:217: warning: private class for your eyes only in object not even using companion privates is never used private implicit class `for your eyes only`(i: Int) { // warn ^ -warn-unused-privates.scala:232: warning: private class D in class nonprivate alias is enclosing is never used +warn-unused-privates.scala:233: warning: private class D in class nonprivate alias is enclosing is never used private class D extends C2 // warn ^ -warn-unused-privates.scala:97: warning: local var x in method f2 is never updated: consider using immutable val +warn-unused-privates.scala:98: warning: local var x in method f2 is never updated: consider using immutable val var x = 100 // warn about it being a var ^ error: No warnings can be incurred under -Xfatal-warnings. diff --git a/test/files/neg/warn-unused-privates.flags b/test/files/neg/warn-unused-privates.flags deleted file mode 100644 index 9479643bd5c2..000000000000 --- a/test/files/neg/warn-unused-privates.flags +++ /dev/null @@ -1 +0,0 @@ --Ywarn-unused:privates -Xfatal-warnings diff --git a/test/files/neg/warn-unused-privates.scala b/test/files/neg/warn-unused-privates.scala index a061279df2f6..fd408f89e007 100644 --- a/test/files/neg/warn-unused-privates.scala +++ b/test/files/neg/warn-unused-privates.scala @@ -1,3 +1,4 @@ +// scalac: -Ywarn-unused:privates -Xfatal-warnings class Bippy(a: Int, b: Int) { private def this(c: Int) = this(c, c) // warn private def bippy(x: Int): Int = bippy(x) // TODO: could warn diff --git a/test/files/pos/annotated-treecopy.flags b/test/files/pos/annotated-treecopy.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/pos/annotated-treecopy.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/pos/annotated-treecopy/Impls_Macros_1.scala b/test/files/pos/annotated-treecopy/Impls_Macros_1.scala index 79edbfffd8a4..8fed06e4f629 100644 --- a/test/files/pos/annotated-treecopy/Impls_Macros_1.scala +++ b/test/files/pos/annotated-treecopy/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context import collection.mutable.ListBuffer @@ -51,4 +52,4 @@ object Macros { case _ => sys.error("Bad function type") } } -} \ No newline at end of file +} diff --git a/test/files/pos/annotated-treecopy/Test_2.scala b/test/files/pos/annotated-treecopy/Test_2.scala index 836e0d888dd0..1dc433c77798 100644 --- a/test/files/pos/annotated-treecopy/Test_2.scala +++ b/test/files/pos/annotated-treecopy/Test_2.scala @@ -1,5 +1,6 @@ +// scalac: -language:experimental.macros object Test extends App { import Macros._ // tree { (x:((Int,Int,Int),(Int,Int,Int))) => { val y=x; val ((r1,m1,c1),(r2,m2,c2))=y; (r1, m1 + m2 + r1 * c1 * c2, c2) } } tree { (x:((Int,Int,Int),(Int,Int,Int))) => { val ((r1,m1,c1),(r2,m2,c2))=x; (r1, m1 + m2 + r1 * c1 * c2, c2) } } -} \ No newline at end of file +} diff --git a/test/files/pos/attachments-typed-another-ident.flags b/test/files/pos/attachments-typed-another-ident.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/pos/attachments-typed-another-ident.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/pos/attachments-typed-another-ident/Impls_1.scala b/test/files/pos/attachments-typed-another-ident/Impls_1.scala index 98062a9c764b..7213e543a90e 100644 --- a/test/files/pos/attachments-typed-another-ident/Impls_1.scala +++ b/test/files/pos/attachments-typed-another-ident/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context import language.experimental.macros diff --git a/test/files/pos/attachments-typed-another-ident/Macros_Test_2.scala b/test/files/pos/attachments-typed-another-ident/Macros_Test_2.scala index 022639bfe9b8..90b2e3de4fbd 100644 --- a/test/files/pos/attachments-typed-another-ident/Macros_Test_2.scala +++ b/test/files/pos/attachments-typed-another-ident/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { def bar = 2 Macros.foo diff --git a/test/files/pos/attachments-typed-ident.flags b/test/files/pos/attachments-typed-ident.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/pos/attachments-typed-ident.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/pos/attachments-typed-ident/Impls_1.scala b/test/files/pos/attachments-typed-ident/Impls_1.scala index 25c08918808c..7213e543a90e 100644 --- a/test/files/pos/attachments-typed-ident/Impls_1.scala +++ b/test/files/pos/attachments-typed-ident/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context import language.experimental.macros @@ -15,4 +16,4 @@ object Macros { } def foo = macro impl -} \ No newline at end of file +} diff --git a/test/files/pos/attachments-typed-ident/Macros_Test_2.scala b/test/files/pos/attachments-typed-ident/Macros_Test_2.scala index 37065ead4b4d..8604eb40017d 100644 --- a/test/files/pos/attachments-typed-ident/Macros_Test_2.scala +++ b/test/files/pos/attachments-typed-ident/Macros_Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { def bar = 2 Macros.foo -} \ No newline at end of file +} diff --git a/test/files/pos/case-object-add-serializable.flags b/test/files/pos/case-object-add-serializable.flags deleted file mode 100644 index 1134633fd40a..000000000000 --- a/test/files/pos/case-object-add-serializable.flags +++ /dev/null @@ -1 +0,0 @@ --Xdev -Xfatal-warnings diff --git a/test/files/pos/case-object-add-serializable.scala b/test/files/pos/case-object-add-serializable.scala index dae3e9ab922d..92866b487837 100644 --- a/test/files/pos/case-object-add-serializable.scala +++ b/test/files/pos/case-object-add-serializable.scala @@ -1,3 +1,4 @@ +// scalac: -Xdev -Xfatal-warnings // Was: "warning: !!! base trait Serializable not found in basetypes of object Person. This might indicate incorrect caching of TypeRef#parents." // under -Xdev class Test { diff --git a/test/files/pos/classtag-pos.flags b/test/files/pos/classtag-pos.flags deleted file mode 100644 index 281f0a10cdc3..000000000000 --- a/test/files/pos/classtag-pos.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos diff --git a/test/files/pos/classtag-pos.scala b/test/files/pos/classtag-pos.scala index 768d2e27f4ef..f30c3c3c1685 100644 --- a/test/files/pos/classtag-pos.scala +++ b/test/files/pos/classtag-pos.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos import scala.reflect.runtime.universe._ class A { diff --git a/test/files/pos/comp-rec-test.flags b/test/files/pos/comp-rec-test.flags deleted file mode 100644 index ad928f52a0f2..000000000000 --- a/test/files/pos/comp-rec-test.flags +++ /dev/null @@ -1 +0,0 @@ --Yrecursion 1 diff --git a/test/files/pos/comp-rec-test.scala b/test/files/pos/comp-rec-test.scala index c3e6f8c19624..05031da0235f 100644 --- a/test/files/pos/comp-rec-test.scala +++ b/test/files/pos/comp-rec-test.scala @@ -1,3 +1,4 @@ +// scalac: -Yrecursion 1 object Comp extends App { trait Family { diff --git a/test/files/pos/cycle-jsoup.flags b/test/files/pos/cycle-jsoup.flags deleted file mode 100644 index ca20f55172e9..000000000000 --- a/test/files/pos/cycle-jsoup.flags +++ /dev/null @@ -1 +0,0 @@ --Ybreak-cycles diff --git a/test/files/pos/cycle-jsoup/Test_2.scala b/test/files/pos/cycle-jsoup/Test_2.scala index f60c50f74345..d1c45580ff9d 100644 --- a/test/files/pos/cycle-jsoup/Test_2.scala +++ b/test/files/pos/cycle-jsoup/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -Ybreak-cycles object Test { def main(args : Array[String]): Unit = { org.jsoup.Jsoup_1.parse(null: java.net.URL, 3000) diff --git a/test/files/pos/cycle.flags b/test/files/pos/cycle.flags deleted file mode 100644 index ca20f55172e9..000000000000 --- a/test/files/pos/cycle.flags +++ /dev/null @@ -1 +0,0 @@ --Ybreak-cycles diff --git a/test/files/pos/cycle/X_2.scala b/test/files/pos/cycle/X_2.scala index c1840f3b99b7..68c22b86446f 100644 --- a/test/files/pos/cycle/X_2.scala +++ b/test/files/pos/cycle/X_2.scala @@ -1,3 +1,4 @@ +// scalac: -Ybreak-cycles import bar.J_1._ //<--- illegal cyclic reference involving class X diff --git a/test/files/pos/debug-reset-local-attrs.flags b/test/files/pos/debug-reset-local-attrs.flags deleted file mode 100644 index 9c7d6400fc4d..000000000000 --- a/test/files/pos/debug-reset-local-attrs.flags +++ /dev/null @@ -1 +0,0 @@ --Ydebug diff --git a/test/files/pos/debug-reset-local-attrs.scala b/test/files/pos/debug-reset-local-attrs.scala index 83486579650a..94d68ff9c0f7 100644 --- a/test/files/pos/debug-reset-local-attrs.scala +++ b/test/files/pos/debug-reset-local-attrs.scala @@ -1 +1,2 @@ +// scalac: -Ydebug case class FT(f : Float) diff --git a/test/files/pos/dotless-targs-ranged.flags b/test/files/pos/dotless-targs-ranged.flags deleted file mode 100644 index 80532ccc754d..000000000000 --- a/test/files/pos/dotless-targs-ranged.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos:true diff --git a/test/files/pos/dotless-targs-ranged.scala b/test/files/pos/dotless-targs-ranged.scala index 372f2df4e013..67d4f8d80dcb 100644 --- a/test/files/pos/dotless-targs-ranged.scala +++ b/test/files/pos/dotless-targs-ranged.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos:true class A { def fn1 = List apply 1 def fn2 = List apply[Int] 2 diff --git a/test/files/pos/dotless-targs.flags b/test/files/pos/dotless-targs.flags deleted file mode 100644 index ea7fc37e1af3..000000000000 --- a/test/files/pos/dotless-targs.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos:false diff --git a/test/files/pos/dotless-targs.scala b/test/files/pos/dotless-targs.scala index 8c0e244e4e8e..e88f7206dc6f 100644 --- a/test/files/pos/dotless-targs.scala +++ b/test/files/pos/dotless-targs.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos:false class A { def fn1 = List apply 1 def fn2 = List apply[Int] 2 diff --git a/test/files/pos/exhaust_alternatives.flags b/test/files/pos/exhaust_alternatives.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/exhaust_alternatives.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/exhaust_alternatives.scala b/test/files/pos/exhaust_alternatives.scala index cc81d0be7d75..07bd1e01775e 100644 --- a/test/files/pos/exhaust_alternatives.scala +++ b/test/files/pos/exhaust_alternatives.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed abstract class X sealed case class A(x: Boolean) extends X case object B extends X @@ -7,4 +8,4 @@ object Test { case A(true) => case A(false) | B => } -} \ No newline at end of file +} diff --git a/test/files/pos/existential-slow-compile1.flags b/test/files/pos/existential-slow-compile1.flags deleted file mode 100644 index 7f7581974db7..000000000000 --- a/test/files/pos/existential-slow-compile1.flags +++ /dev/null @@ -1 +0,0 @@ --Ystop-after:refchecks diff --git a/test/files/pos/existential-slow-compile1.scala b/test/files/pos/existential-slow-compile1.scala index 8602afd9dbb8..bd7407e32fd0 100644 --- a/test/files/pos/existential-slow-compile1.scala +++ b/test/files/pos/existential-slow-compile1.scala @@ -1,3 +1,4 @@ +// scalac: -Ystop-after:refchecks class C { type L[+A] = scala.collection.immutable.List[A] def test = { diff --git a/test/files/pos/generic-sigs.flags b/test/files/pos/generic-sigs.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/generic-sigs.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/generic-sigs.scala b/test/files/pos/generic-sigs.scala index 98c50b8e8250..f1293f8da12f 100644 --- a/test/files/pos/generic-sigs.scala +++ b/test/files/pos/generic-sigs.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings import language.existentials object A { diff --git a/test/files/pos/hkarray.flags b/test/files/pos/hkarray.flags deleted file mode 100644 index e745d8bbe3e8..000000000000 --- a/test/files/pos/hkarray.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -language:higherKinds \ No newline at end of file diff --git a/test/files/pos/hkarray.scala b/test/files/pos/hkarray.scala index af1160300a60..11e7b50f53ca 100644 --- a/test/files/pos/hkarray.scala +++ b/test/files/pos/hkarray.scala @@ -1,5 +1,6 @@ +// scalac: -Xfatal-warnings -language:higherKinds trait Foo[CC[_]] { } class Bip { val x = new Foo[Array] { } -} \ No newline at end of file +} diff --git a/test/files/pos/implicit-anyval-2.10.flags b/test/files/pos/implicit-anyval-2.10.flags deleted file mode 100644 index 94c80567477b..000000000000 --- a/test/files/pos/implicit-anyval-2.10.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.10 diff --git a/test/files/pos/implicit-anyval-2.10.scala b/test/files/pos/implicit-anyval-2.10.scala index 3082af73b810..918eebc0729e 100644 --- a/test/files/pos/implicit-anyval-2.10.scala +++ b/test/files/pos/implicit-anyval-2.10.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.10 object Test { "": AnyVal // newly prohibited in 2.11, allowed under -Xsourse:2.10 -} \ No newline at end of file +} diff --git a/test/files/pos/infer_override_def_args.flags b/test/files/pos/infer_override_def_args.flags deleted file mode 100644 index d1a824416911..000000000000 --- a/test/files/pos/infer_override_def_args.flags +++ /dev/null @@ -1 +0,0 @@ --Yinfer-argument-types \ No newline at end of file diff --git a/test/files/pos/infer_override_def_args.scala b/test/files/pos/infer_override_def_args.scala index ac10720c8128..5d9f8645ccab 100644 --- a/test/files/pos/infer_override_def_args.scala +++ b/test/files/pos/infer_override_def_args.scala @@ -1,5 +1,6 @@ +// scalac: -Yinfer-argument-types abstract class A { def foo(a: Int): A } class B extends A { implicit def spackle(x: Int): A = new B def foo(a) = a -} \ No newline at end of file +} diff --git a/test/files/pos/infersingle.flags b/test/files/pos/infersingle.flags deleted file mode 100644 index e1b37447c953..000000000000 --- a/test/files/pos/infersingle.flags +++ /dev/null @@ -1 +0,0 @@ --Xexperimental \ No newline at end of file diff --git a/test/files/pos/infersingle.scala b/test/files/pos/infersingle.scala index 60f4ff07e60d..0d317e858354 100644 --- a/test/files/pos/infersingle.scala +++ b/test/files/pos/infersingle.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental object Test1 { def one[T](x: T): Option[T] = Some(x) val x = "one" diff --git a/test/files/pos/inline-access-levels.flags b/test/files/pos/inline-access-levels.flags deleted file mode 100644 index 8cc02f83658b..000000000000 --- a/test/files/pos/inline-access-levels.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** -Xfatal-warnings -opt-warnings diff --git a/test/files/pos/inline-access-levels/A_1.scala b/test/files/pos/inline-access-levels/A_1.scala index 479fe0fc7163..3ae205dc45a7 100644 --- a/test/files/pos/inline-access-levels/A_1.scala +++ b/test/files/pos/inline-access-levels/A_1.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** -Xfatal-warnings -opt-warnings package test object A { diff --git a/test/files/pos/inline-access-levels/Test_2.scala b/test/files/pos/inline-access-levels/Test_2.scala index 12c9eb540f73..4bb4ac2130a7 100644 --- a/test/files/pos/inline-access-levels/Test_2.scala +++ b/test/files/pos/inline-access-levels/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** -Xfatal-warnings -opt-warnings package test object Test { diff --git a/test/files/pos/java-import-static-from-subclass.flags b/test/files/pos/java-import-static-from-subclass.flags deleted file mode 100644 index 8c8cf255b979..000000000000 --- a/test/files/pos/java-import-static-from-subclass.flags +++ /dev/null @@ -1 +0,0 @@ --Ypickle-java diff --git a/test/files/pos/java-import-static-from-subclass/Test.scala b/test/files/pos/java-import-static-from-subclass/Test.scala index be7795442a7a..7d2326b519e1 100644 --- a/test/files/pos/java-import-static-from-subclass/Test.scala +++ b/test/files/pos/java-import-static-from-subclass/Test.scala @@ -1 +1,2 @@ +// scalac: -Ypickle-java class Test diff --git a/test/files/pos/macro-deprecate-dont-touch-backquotedidents.flags b/test/files/pos/macro-deprecate-dont-touch-backquotedidents.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/macro-deprecate-dont-touch-backquotedidents.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/macro-deprecate-dont-touch-backquotedidents.scala b/test/files/pos/macro-deprecate-dont-touch-backquotedidents.scala index 69a73330115b..204a41ca94b0 100644 --- a/test/files/pos/macro-deprecate-dont-touch-backquotedidents.scala +++ b/test/files/pos/macro-deprecate-dont-touch-backquotedidents.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test1 { val `macro` = ??? } @@ -53,4 +54,4 @@ package foo { object Test13 { def `macro` = 2 -} \ No newline at end of file +} diff --git a/test/files/pos/native-warning.flags b/test/files/pos/native-warning.flags deleted file mode 100644 index 65faf53579c2..000000000000 --- a/test/files/pos/native-warning.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -deprecation \ No newline at end of file diff --git a/test/files/pos/native-warning.scala b/test/files/pos/native-warning.scala index a2918c11b597..7f47e94604a9 100644 --- a/test/files/pos/native-warning.scala +++ b/test/files/pos/native-warning.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -deprecation class A { @native def setup(): Unit diff --git a/test/files/pos/nonlocal-unchecked.flags b/test/files/pos/nonlocal-unchecked.flags deleted file mode 100644 index 144ddac9d3d8..000000000000 --- a/test/files/pos/nonlocal-unchecked.flags +++ /dev/null @@ -1 +0,0 @@ --unchecked -Xfatal-warnings diff --git a/test/files/pos/nonlocal-unchecked.scala b/test/files/pos/nonlocal-unchecked.scala index 6bd3dc479ebf..75abff2d4b93 100644 --- a/test/files/pos/nonlocal-unchecked.scala +++ b/test/files/pos/nonlocal-unchecked.scala @@ -1,3 +1,4 @@ +// scalac: -unchecked -Xfatal-warnings class A { def f: Boolean = { val xs = Nil map (_ => return false) diff --git a/test/files/pos/override-object-yes.flags b/test/files/pos/override-object-yes.flags deleted file mode 100644 index 22e9a95c4ff7..000000000000 --- a/test/files/pos/override-object-yes.flags +++ /dev/null @@ -1 +0,0 @@ --Yoverride-objects \ No newline at end of file diff --git a/test/files/pos/override-object-yes.scala b/test/files/pos/override-object-yes.scala index 858f9b21fcf6..250d161d7fab 100644 --- a/test/files/pos/override-object-yes.scala +++ b/test/files/pos/override-object-yes.scala @@ -1,3 +1,4 @@ +// scalac: -Yoverride-objects package case1 { class Bippy { def f = 1 diff --git a/test/files/pos/package-ob-case.flags b/test/files/pos/package-ob-case.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/package-ob-case.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/package-ob-case/A_1.scala b/test/files/pos/package-ob-case/A_1.scala index 91a1fb7e4856..39f68eef9dbb 100644 --- a/test/files/pos/package-ob-case/A_1.scala +++ b/test/files/pos/package-ob-case/A_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings package foo { package object foo { case class X(z: Int) { } diff --git a/test/files/pos/package-ob-case/B_2.scala b/test/files/pos/package-ob-case/B_2.scala index 91a1fb7e4856..39f68eef9dbb 100644 --- a/test/files/pos/package-ob-case/B_2.scala +++ b/test/files/pos/package-ob-case/B_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings package foo { package object foo { case class X(z: Int) { } diff --git a/test/files/pos/patmat-hk.flags b/test/files/pos/patmat-hk.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/pos/patmat-hk.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/pos/patmat-hk.scala b/test/files/pos/patmat-hk.scala index 701a9e7aaf25..95f08e018d25 100644 --- a/test/files/pos/patmat-hk.scala +++ b/test/files/pos/patmat-hk.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 case class Foo[F[_]]() case class APair[F[_], G[_], A](f: F[A], g: G[A]) diff --git a/test/files/pos/patmat-suppress.flags b/test/files/pos/patmat-suppress.flags deleted file mode 100644 index a988a5b807e1..000000000000 --- a/test/files/pos/patmat-suppress.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xno-patmat-analysis \ No newline at end of file diff --git a/test/files/pos/patmat-suppress.scala b/test/files/pos/patmat-suppress.scala index 7c8aded690db..b56a0f42430a 100644 --- a/test/files/pos/patmat-suppress.scala +++ b/test/files/pos/patmat-suppress.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xno-patmat-analysis // test that none of these warn due to -Xno-patmat-analysis // tests taken from test/files/neg/patmatexhaust.scala, test/files/neg/pat_unreachable.scala class TestSealedExhaustive { // compile only diff --git a/test/files/pos/polymorphic-case-class.flags b/test/files/pos/polymorphic-case-class.flags deleted file mode 100644 index 464cc20ea684..000000000000 --- a/test/files/pos/polymorphic-case-class.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -unchecked \ No newline at end of file diff --git a/test/files/pos/polymorphic-case-class.scala b/test/files/pos/polymorphic-case-class.scala index 5ed5eeddc993..c47f208ae211 100644 --- a/test/files/pos/polymorphic-case-class.scala +++ b/test/files/pos/polymorphic-case-class.scala @@ -1,2 +1,3 @@ +// scalac: -Xfatal-warnings -unchecked // no unchecked warnings case class Bippy[T, -U, +V](x: T, z: V) { } diff --git a/test/files/pos/proj-rec-test.flags b/test/files/pos/proj-rec-test.flags deleted file mode 100644 index ad928f52a0f2..000000000000 --- a/test/files/pos/proj-rec-test.flags +++ /dev/null @@ -1 +0,0 @@ --Yrecursion 1 diff --git a/test/files/pos/proj-rec-test.scala b/test/files/pos/proj-rec-test.scala index b7efcf3e8dda..d5bec2f892ec 100644 --- a/test/files/pos/proj-rec-test.scala +++ b/test/files/pos/proj-rec-test.scala @@ -1,3 +1,4 @@ +// scalac: -Yrecursion 1 object ProjTest { trait MInt { type Type } trait _0 extends MInt { type Type = Boolean } diff --git a/test/files/pos/rangepos-anonapply.flags b/test/files/pos/rangepos-anonapply.flags deleted file mode 100644 index 281f0a10cdc3..000000000000 --- a/test/files/pos/rangepos-anonapply.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos diff --git a/test/files/pos/rangepos-anonapply.scala b/test/files/pos/rangepos-anonapply.scala index 2f3e4ad6cd7f..2a069e31bb62 100644 --- a/test/files/pos/rangepos-anonapply.scala +++ b/test/files/pos/rangepos-anonapply.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos class Test { trait PropTraverser { def apply(x: Int): Unit = {} diff --git a/test/files/pos/rangepos-patmat.flags b/test/files/pos/rangepos-patmat.flags deleted file mode 100644 index 281f0a10cdc3..000000000000 --- a/test/files/pos/rangepos-patmat.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos diff --git a/test/files/pos/rangepos-patmat.scala b/test/files/pos/rangepos-patmat.scala index 98c842aaf8ff..0a7cab6b2d23 100644 --- a/test/files/pos/rangepos-patmat.scala +++ b/test/files/pos/rangepos-patmat.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos class Foo { def test: PartialFunction[Any, String] = { case _ => "ok" } diff --git a/test/files/pos/rangepos.flags b/test/files/pos/rangepos.flags deleted file mode 100644 index fcf951d90723..000000000000 --- a/test/files/pos/rangepos.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos \ No newline at end of file diff --git a/test/files/pos/rangepos.scala b/test/files/pos/rangepos.scala index 623b096acb17..99ed30a96991 100644 --- a/test/files/pos/rangepos.scala +++ b/test/files/pos/rangepos.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos class Foo(val x: Double) extends AnyVal { } object Pretty { diff --git a/test/files/pos/setter-not-implicit.flags b/test/files/pos/setter-not-implicit.flags deleted file mode 100644 index 792c40565bbc..000000000000 --- a/test/files/pos/setter-not-implicit.flags +++ /dev/null @@ -1 +0,0 @@ --feature -Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/setter-not-implicit.scala b/test/files/pos/setter-not-implicit.scala index 9bfffc2ceb3e..c499f4a124a8 100644 --- a/test/files/pos/setter-not-implicit.scala +++ b/test/files/pos/setter-not-implicit.scala @@ -1,3 +1,4 @@ +// scalac: -feature -Xfatal-warnings object O { implicit var x: Int = 0 } diff --git a/test/files/pos/t10093.flags b/test/files/pos/t10093.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t10093.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t10093.scala b/test/files/pos/t10093.scala index a894a5492681..30c3e60a086d 100644 --- a/test/files/pos/t10093.scala +++ b/test/files/pos/t10093.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class A[@specialized(Int) T](val value: T) { trait B def useValue(x:T): Unit = () diff --git a/test/files/pos/t10185.flags b/test/files/pos/t10185.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/pos/t10185.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/pos/t10185.scala b/test/files/pos/t10185.scala index 28bc78a72068..673b1c1491d4 100644 --- a/test/files/pos/t10185.scala +++ b/test/files/pos/t10185.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 sealed trait Foo[A, F[_ <: A]] case class Bar[A, F[_ <: A]]() extends Foo[A, F] diff --git a/test/files/pos/t10195.flags b/test/files/pos/t10195.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/pos/t10195.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/pos/t10195.scala b/test/files/pos/t10195.scala index c0682c4c1d69..07f92078e2e3 100644 --- a/test/files/pos/t10195.scala +++ b/test/files/pos/t10195.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 sealed trait Foo[F[_]] case class Bar[F[_]]() extends Foo[F] diff --git a/test/files/pos/t10195b.flags b/test/files/pos/t10195b.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/pos/t10195b.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/pos/t10195b.scala b/test/files/pos/t10195b.scala index 9c1eaeb8a70a..8e6122560447 100644 --- a/test/files/pos/t10195b.scala +++ b/test/files/pos/t10195b.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 sealed trait Foo[F[_]] case class Bar[F[_]]() extends Foo[F] diff --git a/test/files/pos/t10197.flags b/test/files/pos/t10197.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/pos/t10197.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/pos/t10197.scala b/test/files/pos/t10197.scala index 54d7d6db20b7..de3c3ae9929b 100644 --- a/test/files/pos/t10197.scala +++ b/test/files/pos/t10197.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 import scala.language.higherKinds final case class Getter[S, A](get: S => A) diff --git a/test/files/pos/t10213.flags b/test/files/pos/t10213.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/pos/t10213.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/pos/t10213.scala b/test/files/pos/t10213.scala index 7f5a44197eef..2fcd9fb22847 100644 --- a/test/files/pos/t10213.scala +++ b/test/files/pos/t10213.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 import scala.language.higherKinds final case class Coproduct[F[_], G[_], A](run: Either[F[A], G[A]]) diff --git a/test/files/pos/t10238.flags b/test/files/pos/t10238.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/pos/t10238.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/pos/t10238.scala b/test/files/pos/t10238.scala index 4fa06af7b5cb..02ab8cd69744 100644 --- a/test/files/pos/t10238.scala +++ b/test/files/pos/t10238.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 object Test { // Data types diff --git a/test/files/pos/t10270.flags b/test/files/pos/t10270.flags deleted file mode 100644 index c4e11e7fe70c..000000000000 --- a/test/files/pos/t10270.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Ywarn-unused:imports diff --git a/test/files/pos/t10270/Macros_1.scala b/test/files/pos/t10270/Macros_1.scala index 056995d2497a..0d9f51e2c260 100644 --- a/test/files/pos/t10270/Macros_1.scala +++ b/test/files/pos/t10270/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ywarn-unused:imports import language.experimental.macros import scala.reflect.macros.blackbox.Context diff --git a/test/files/pos/t10270/Main_2.scala b/test/files/pos/t10270/Main_2.scala index 33d34b8f7e6b..58d21e8e0c00 100644 --- a/test/files/pos/t10270/Main_2.scala +++ b/test/files/pos/t10270/Main_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ywarn-unused:imports object Main extends App { diff --git a/test/files/pos/t10288.flags b/test/files/pos/t10288.flags deleted file mode 100644 index 3e1952020a23..000000000000 --- a/test/files/pos/t10288.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 \ No newline at end of file diff --git a/test/files/pos/t10288.scala b/test/files/pos/t10288.scala index a5f0a7712aa1..7c76a8965d24 100644 --- a/test/files/pos/t10288.scala +++ b/test/files/pos/t10288.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 trait Target trait Unrelated @@ -16,4 +17,4 @@ object Test { consumer(new From) // works consumer(new From with Unrelated) // breaks consumer(new From {}) // breaks also -} \ No newline at end of file +} diff --git a/test/files/pos/t10296-before.flags b/test/files/pos/t10296-before.flags deleted file mode 100644 index 7a639c3fb054..000000000000 --- a/test/files/pos/t10296-before.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xlint:unused -Ywarn-macros:before diff --git a/test/files/pos/t10296-before/UnusedMacro_1.scala b/test/files/pos/t10296-before/UnusedMacro_1.scala index 8d08c39ce102..220ae4edcaad 100644 --- a/test/files/pos/t10296-before/UnusedMacro_1.scala +++ b/test/files/pos/t10296-before/UnusedMacro_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:unused -Ywarn-macros:before import scala.reflect.macros.whitebox.Context diff --git a/test/files/pos/t10296-before/Unused_2.scala b/test/files/pos/t10296-before/Unused_2.scala index 56feb4a3740c..9df8dc3e9381 100644 --- a/test/files/pos/t10296-before/Unused_2.scala +++ b/test/files/pos/t10296-before/Unused_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:unused -Ywarn-macros:before import scala.language.experimental.macros diff --git a/test/files/pos/t10296.flags b/test/files/pos/t10296.flags deleted file mode 100644 index ae548523beb5..000000000000 --- a/test/files/pos/t10296.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xlint:unused diff --git a/test/files/pos/t10296/UnusedMacro_1.scala b/test/files/pos/t10296/UnusedMacro_1.scala index d3576ee731f0..f3b33c38d561 100644 --- a/test/files/pos/t10296/UnusedMacro_1.scala +++ b/test/files/pos/t10296/UnusedMacro_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:unused import scala.reflect.macros.blackbox diff --git a/test/files/pos/t10296/Unused_2.scala b/test/files/pos/t10296/Unused_2.scala index 51d191f1a4b2..7f1e2ec869a2 100644 --- a/test/files/pos/t10296/Unused_2.scala +++ b/test/files/pos/t10296/Unused_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:unused import scala.language.experimental.macros diff --git a/test/files/pos/t10372.flags b/test/files/pos/t10372.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/pos/t10372.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/pos/t10372.scala b/test/files/pos/t10372.scala index 9923457ebc57..68f19c27c039 100644 --- a/test/files/pos/t10372.scala +++ b/test/files/pos/t10372.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 import scala.language.higherKinds import scala.language.implicitConversions diff --git a/test/files/pos/t10394.flags b/test/files/pos/t10394.flags deleted file mode 100644 index 437ae36b0ea3..000000000000 --- a/test/files/pos/t10394.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Ywarn-unused:patvars diff --git a/test/files/pos/t10394.scala b/test/files/pos/t10394.scala index 091fa5bc8d17..abdfe65f4b11 100644 --- a/test/files/pos/t10394.scala +++ b/test/files/pos/t10394.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ywarn-unused:patvars trait T { def f = for (i: Int <- List(42)) yield i diff --git a/test/files/pos/t10623.flags b/test/files/pos/t10623.flags deleted file mode 100644 index ae548523beb5..000000000000 --- a/test/files/pos/t10623.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xlint:unused diff --git a/test/files/pos/t10623.scala b/test/files/pos/t10623.scala index 4907f01a1be9..8d574849e319 100644 --- a/test/files/pos/t10623.scala +++ b/test/files/pos/t10623.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:unused import language.higherKinds diff --git a/test/files/pos/t10643.flags b/test/files/pos/t10643.flags deleted file mode 100644 index fcf951d90723..000000000000 --- a/test/files/pos/t10643.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos \ No newline at end of file diff --git a/test/files/pos/t10643.scala b/test/files/pos/t10643.scala index 697039dae4c4..f59d305ffd6b 100644 --- a/test/files/pos/t10643.scala +++ b/test/files/pos/t10643.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos trait AA trait BB trait Foo { diff --git a/test/files/pos/t10644.flags b/test/files/pos/t10644.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t10644.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t10644/Objs_1.scala b/test/files/pos/t10644/Objs_1.scala index 18c3bdb375b7..804cfa435c18 100644 --- a/test/files/pos/t10644/Objs_1.scala +++ b/test/files/pos/t10644/Objs_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings case object A ; case object B object C { // inferred refinement type `Product with Serializable` of val `objs` has owner `C` diff --git a/test/files/pos/t10644/Test_2.scala b/test/files/pos/t10644/Test_2.scala index 185cb83b66b2..97aab8bfef03 100644 --- a/test/files/pos/t10644/Test_2.scala +++ b/test/files/pos/t10644/Test_2.scala @@ -1,6 +1,7 @@ +// scalac: -Xfatal-warnings object Test { // Should not result in the spurious warning: // comparing non-null values of types Product with Serializable // and A.type using `==' will always yield false assert(C.objs.head == A) -} \ No newline at end of file +} diff --git a/test/files/pos/t10763.flags b/test/files/pos/t10763.flags deleted file mode 100644 index 23e3c2aaabce..000000000000 --- a/test/files/pos/t10763.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Ywarn-unused diff --git a/test/files/pos/t10763.scala b/test/files/pos/t10763.scala index 5900986d1d40..6dae1ae0fed9 100644 --- a/test/files/pos/t10763.scala +++ b/test/files/pos/t10763.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ywarn-unused class Test { def xsUnused = { val xs: List[Int] = List(0) diff --git a/test/files/pos/t11538.flags b/test/files/pos/t11538.flags deleted file mode 100644 index 7882ee62698f..000000000000 --- a/test/files/pos/t11538.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -deprecation -stop:refchecks \ No newline at end of file diff --git a/test/files/pos/t11538.scala b/test/files/pos/t11538.scala index 77c931e2c202..815f0f996d9a 100644 --- a/test/files/pos/t11538.scala +++ b/test/files/pos/t11538.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -deprecation -stop:refchecks package t11538 @deprecated("not for you", since = "just now") @@ -10,4 +11,4 @@ object Bizzle { def mipple: Abhorrent = wobble @deprecated("use wibble instead", since = "recently") var wobble: Abhorrent = wibble -} \ No newline at end of file +} diff --git a/test/files/pos/t11917.flags b/test/files/pos/t11917.flags deleted file mode 100644 index 1ccd397fa0fe..000000000000 --- a/test/files/pos/t11917.flags +++ /dev/null @@ -1 +0,0 @@ --Ypickle-java \ No newline at end of file diff --git a/test/files/pos/t11917/Z.scala b/test/files/pos/t11917/Z.scala index 9159fdc3bf96..1ebadbc9ae48 100644 --- a/test/files/pos/t11917/Z.scala +++ b/test/files/pos/t11917/Z.scala @@ -1,3 +1,4 @@ +// scalac: -Ypickle-java package bar -class Z \ No newline at end of file +class Z diff --git a/test/files/pos/t1439.flags b/test/files/pos/t1439.flags deleted file mode 100644 index bca57e478568..000000000000 --- a/test/files/pos/t1439.flags +++ /dev/null @@ -1 +0,0 @@ --unchecked -Xfatal-warnings -language:higherKinds diff --git a/test/files/pos/t1439.scala b/test/files/pos/t1439.scala index 0efcc74b6545..10e43fb5a374 100644 --- a/test/files/pos/t1439.scala +++ b/test/files/pos/t1439.scala @@ -1,3 +1,4 @@ +// scalac: -unchecked -Xfatal-warnings -language:higherKinds // no unchecked warnings class View[C[A]] { } diff --git a/test/files/pos/t1803.flags b/test/files/pos/t1803.flags deleted file mode 100644 index d1a824416911..000000000000 --- a/test/files/pos/t1803.flags +++ /dev/null @@ -1 +0,0 @@ --Yinfer-argument-types \ No newline at end of file diff --git a/test/files/pos/t1803.scala b/test/files/pos/t1803.scala index 42f4e784a345..85b3f6315518 100644 --- a/test/files/pos/t1803.scala +++ b/test/files/pos/t1803.scala @@ -1,2 +1,3 @@ +// scalac: -Yinfer-argument-types class A { def foo[A](a: A) = a } class B extends A { override def foo[A](b) = b } diff --git a/test/files/pos/t2066-2.10-compat.flags b/test/files/pos/t2066-2.10-compat.flags deleted file mode 100644 index 94c80567477b..000000000000 --- a/test/files/pos/t2066-2.10-compat.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.10 diff --git a/test/files/pos/t2066-2.10-compat.scala b/test/files/pos/t2066-2.10-compat.scala index fb8103e4adcf..ff7d18e24d8c 100644 --- a/test/files/pos/t2066-2.10-compat.scala +++ b/test/files/pos/t2066-2.10-compat.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.10 import language._ trait A1 { def f[T[_]] = () diff --git a/test/files/pos/t2712-1.flags b/test/files/pos/t2712-1.flags deleted file mode 100644 index 41565c7e32bd..000000000000 --- a/test/files/pos/t2712-1.flags +++ /dev/null @@ -1 +0,0 @@ --Ypartial-unification diff --git a/test/files/pos/t2712-1.scala b/test/files/pos/t2712-1.scala index 0c3ac4242e19..5a1585e7fdfb 100644 --- a/test/files/pos/t2712-1.scala +++ b/test/files/pos/t2712-1.scala @@ -1,3 +1,4 @@ +// scalac: -Ypartial-unification package test // Original test case from, diff --git a/test/files/pos/t2712-2.flags b/test/files/pos/t2712-2.flags deleted file mode 100644 index 7d49efbb8e6c..000000000000 --- a/test/files/pos/t2712-2.flags +++ /dev/null @@ -1,2 +0,0 @@ --Ypartial-unification - diff --git a/test/files/pos/t2712-2.scala b/test/files/pos/t2712-2.scala index 39f22dd92a79..81f2e9ecfe92 100644 --- a/test/files/pos/t2712-2.scala +++ b/test/files/pos/t2712-2.scala @@ -1,3 +1,4 @@ +// scalac: -Ypartial-unification package test // See: https://github.com/milessabin/si2712fix-demo/issues/3 diff --git a/test/files/pos/t2712-3.flags b/test/files/pos/t2712-3.flags deleted file mode 100644 index 7d49efbb8e6c..000000000000 --- a/test/files/pos/t2712-3.flags +++ /dev/null @@ -1,2 +0,0 @@ --Ypartial-unification - diff --git a/test/files/pos/t2712-3.scala b/test/files/pos/t2712-3.scala index 46445f9289f7..c8b8666efd21 100644 --- a/test/files/pos/t2712-3.scala +++ b/test/files/pos/t2712-3.scala @@ -1,3 +1,4 @@ +// scalac: -Ypartial-unification package test object Test1 { diff --git a/test/files/pos/t2712-4.flags b/test/files/pos/t2712-4.flags deleted file mode 100644 index 7d49efbb8e6c..000000000000 --- a/test/files/pos/t2712-4.flags +++ /dev/null @@ -1,2 +0,0 @@ --Ypartial-unification - diff --git a/test/files/pos/t2712-4.scala b/test/files/pos/t2712-4.scala index 3e2e5cddaedf..2814e3658cc2 100644 --- a/test/files/pos/t2712-4.scala +++ b/test/files/pos/t2712-4.scala @@ -1,3 +1,4 @@ +// scalac: -Ypartial-unification package test object Test1 { diff --git a/test/files/pos/t2712-5.flags b/test/files/pos/t2712-5.flags deleted file mode 100644 index 41565c7e32bd..000000000000 --- a/test/files/pos/t2712-5.flags +++ /dev/null @@ -1 +0,0 @@ --Ypartial-unification diff --git a/test/files/pos/t2712-5.scala b/test/files/pos/t2712-5.scala index ed96d4c06fcc..ed9de2ca4a91 100644 --- a/test/files/pos/t2712-5.scala +++ b/test/files/pos/t2712-5.scala @@ -1,3 +1,4 @@ +// scalac: -Ypartial-unification package test import scala.language.higherKinds diff --git a/test/files/pos/t2712-6.flags b/test/files/pos/t2712-6.flags deleted file mode 100644 index 41565c7e32bd..000000000000 --- a/test/files/pos/t2712-6.flags +++ /dev/null @@ -1 +0,0 @@ --Ypartial-unification diff --git a/test/files/pos/t2712-6.scala b/test/files/pos/t2712-6.scala index eefe769ad652..c693ad7caa28 100644 --- a/test/files/pos/t2712-6.scala +++ b/test/files/pos/t2712-6.scala @@ -1,3 +1,4 @@ +// scalac: -Ypartial-unification package test object Tags { diff --git a/test/files/pos/t2712-7.flags b/test/files/pos/t2712-7.flags deleted file mode 100644 index 41565c7e32bd..000000000000 --- a/test/files/pos/t2712-7.flags +++ /dev/null @@ -1 +0,0 @@ --Ypartial-unification diff --git a/test/files/pos/t2712-7.scala b/test/files/pos/t2712-7.scala index d9c5243f132d..558fe5450a79 100644 --- a/test/files/pos/t2712-7.scala +++ b/test/files/pos/t2712-7.scala @@ -1,3 +1,4 @@ +// scalac: -Ypartial-unification package test // Cats Xor, Scalaz \/, scala.util.Either diff --git a/test/files/pos/t2799.flags b/test/files/pos/t2799.flags deleted file mode 100644 index d1b831ea87cd..000000000000 --- a/test/files/pos/t2799.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t2799.scala b/test/files/pos/t2799.scala index 7710cce26cdc..2c63b39b65bf 100644 --- a/test/files/pos/t2799.scala +++ b/test/files/pos/t2799.scala @@ -1 +1,2 @@ +// scalac: -deprecation -Xfatal-warnings @deprecated("hi mom", "") case class Bob () diff --git a/test/files/pos/t3234.flags b/test/files/pos/t3234.flags deleted file mode 100644 index 1eb9dcb5e68d..000000000000 --- a/test/files/pos/t3234.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** -opt-warnings -Xfatal-warnings diff --git a/test/files/pos/t3234.scala b/test/files/pos/t3234.scala index 8c588e5aa941..3430c3e751c9 100644 --- a/test/files/pos/t3234.scala +++ b/test/files/pos/t3234.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** -opt-warnings -Xfatal-warnings trait Trait1 { @inline final def foo2(n: Int) = n*n } diff --git a/test/files/pos/t3368.flags b/test/files/pos/t3368.flags deleted file mode 100644 index cb20509902e5..000000000000 --- a/test/files/pos/t3368.flags +++ /dev/null @@ -1 +0,0 @@ --Ystop-after:parser diff --git a/test/files/pos/t3368.scala b/test/files/pos/t3368.scala index c8e861a89900..1f4e6fb29295 100644 --- a/test/files/pos/t3368.scala +++ b/test/files/pos/t3368.scala @@ -1,3 +1,4 @@ +// scalac: -Ystop-after:parser trait X { // error: in XML literal: name expected, but char '!' cannot start a name diff --git a/test/files/pos/t3420.flags b/test/files/pos/t3420.flags deleted file mode 100644 index 7cf8ab26381e..000000000000 --- a/test/files/pos/t3420.flags +++ /dev/null @@ -1 +0,0 @@ --opt-warnings -opt:l:inline -opt-inline-from:** -Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t3420.scala b/test/files/pos/t3420.scala index 0fc56ed67bd8..e8aaef8eece6 100644 --- a/test/files/pos/t3420.scala +++ b/test/files/pos/t3420.scala @@ -1,3 +1,4 @@ +// scalac: -opt-warnings -opt:l:inline -opt-inline-from:** -Xfatal-warnings class C { val cv = Map[Int, Int](1 -> 2) lazy val cl = Map[Int, Int](1 -> 2) diff --git a/test/files/pos/t3495.flags b/test/files/pos/t3495.flags deleted file mode 100644 index 08de722af064..000000000000 --- a/test/files/pos/t3495.flags +++ /dev/null @@ -1 +0,0 @@ --Dsoot.class.path=bin:. diff --git a/test/files/pos/t3495.scala b/test/files/pos/t3495.scala index 8d5dff43020e..9d0980ace0a2 100644 --- a/test/files/pos/t3495.scala +++ b/test/files/pos/t3495.scala @@ -1,2 +1,3 @@ +// scalac: -Dsoot.class.path=bin:. class Foo { } diff --git a/test/files/pos/t3960.flags b/test/files/pos/t3960.flags deleted file mode 100644 index 4449dbbdf333..000000000000 --- a/test/files/pos/t3960.flags +++ /dev/null @@ -1 +0,0 @@ --Ycheck:typer \ No newline at end of file diff --git a/test/files/pos/t3960.scala b/test/files/pos/t3960.scala index 5c658e9fbc75..509b79c43f29 100644 --- a/test/files/pos/t3960.scala +++ b/test/files/pos/t3960.scala @@ -1,3 +1,4 @@ +// scalac: -Ycheck:typer class A { class C[x] val cs = new scala.collection.mutable.HashMap[C[_], Int] diff --git a/test/files/pos/t4020.flags b/test/files/pos/t4020.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t4020.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t4020.scala b/test/files/pos/t4020.scala index f9764601910a..bc91cfc9e1e6 100644 --- a/test/files/pos/t4020.scala +++ b/test/files/pos/t4020.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class A { sealed trait Foo } @@ -22,4 +23,4 @@ class B { // case a1.Foo1(i) => i } } -} \ No newline at end of file +} diff --git a/test/files/pos/t4494.flags b/test/files/pos/t4494.flags deleted file mode 100644 index 281f0a10cdc3..000000000000 --- a/test/files/pos/t4494.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos diff --git a/test/files/pos/t4494.scala b/test/files/pos/t4494.scala index ef38a19083a1..ef6e45fbecb5 100644 --- a/test/files/pos/t4494.scala +++ b/test/files/pos/t4494.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos object A { List(1) } diff --git a/test/files/pos/t4649.flags b/test/files/pos/t4649.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t4649.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t4649.scala b/test/files/pos/t4649.scala index 0d6caa8d7a6a..4f811d108549 100644 --- a/test/files/pos/t4649.scala +++ b/test/files/pos/t4649.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { // @annotation.tailrec def lazyFilter[E](s: Stream[E], p: E => Boolean): Stream[E] = s match { diff --git a/test/files/pos/t4744.flags b/test/files/pos/t4744.flags deleted file mode 100644 index ca20f55172e9..000000000000 --- a/test/files/pos/t4744.flags +++ /dev/null @@ -1 +0,0 @@ --Ybreak-cycles diff --git a/test/files/pos/t4744/Bar.scala b/test/files/pos/t4744/Bar.scala index 1fb6d7897362..01182d0a9a9f 100644 --- a/test/files/pos/t4744/Bar.scala +++ b/test/files/pos/t4744/Bar.scala @@ -1 +1,2 @@ +// scalac: -Ybreak-cycles class Bar { val quux = new Foo[java.lang.Integer]() } diff --git a/test/files/pos/t4840.flags b/test/files/pos/t4840.flags deleted file mode 100644 index 0f85fc3bd844..000000000000 --- a/test/files/pos/t4840.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** \ No newline at end of file diff --git a/test/files/pos/t4840.scala b/test/files/pos/t4840.scala index bf44f71d7a88..9cd95db67baa 100644 --- a/test/files/pos/t4840.scala +++ b/test/files/pos/t4840.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** class Crashy { def g(): Option[Any] = None diff --git a/test/files/pos/t4911.flags b/test/files/pos/t4911.flags deleted file mode 100644 index 779916d58f80..000000000000 --- a/test/files/pos/t4911.flags +++ /dev/null @@ -1 +0,0 @@ --unchecked -Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t4911.scala b/test/files/pos/t4911.scala index 66c867a37f8c..e3a6d18347a4 100644 --- a/test/files/pos/t4911.scala +++ b/test/files/pos/t4911.scala @@ -1,3 +1,4 @@ +// scalac: -unchecked -Xfatal-warnings import language._ object Test { @@ -13,4 +14,4 @@ object Test { // ./b.scala:4: warning: non variable type-argument T in type pattern Test.Foo[T] is unchecked since it is eliminated by erasure // def f2[M[_], T](x: M[T]) = x match { case Foo(y) => y } // ^ -// one warning found \ No newline at end of file +// one warning found diff --git a/test/files/pos/t5029.flags b/test/files/pos/t5029.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t5029.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t5029.scala b/test/files/pos/t5029.scala index 6f9a329b80c6..fe14e12b9c8f 100644 --- a/test/files/pos/t5029.scala +++ b/test/files/pos/t5029.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { (Vector(): Seq[_]) match { case List() => true; case Nil => false } -} \ No newline at end of file +} diff --git a/test/files/pos/t5165b.flags b/test/files/pos/t5165b.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t5165b.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t5165b/TestObject_3.scala b/test/files/pos/t5165b/TestObject_3.scala index eaf244e9d0b3..b7082983646e 100644 --- a/test/files/pos/t5165b/TestObject_3.scala +++ b/test/files/pos/t5165b/TestObject_3.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object TestObject extends TestTrait diff --git a/test/files/pos/t5165b/TestTrait_2.scala b/test/files/pos/t5165b/TestTrait_2.scala index ab4facebcd90..99ff458d3e4a 100644 --- a/test/files/pos/t5165b/TestTrait_2.scala +++ b/test/files/pos/t5165b/TestTrait_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings @TestAnnotation_1(one=TestAnnotation_1.TestEnumOne.A, two=TestAnnotation_1.TestEnumTwo.C, strVal="something") trait TestTrait diff --git a/test/files/pos/t5175.flags b/test/files/pos/t5175.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t5175.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t5175.scala b/test/files/pos/t5175.scala index e15cc3affd48..2e500381827d 100644 --- a/test/files/pos/t5175.scala +++ b/test/files/pos/t5175.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { def ==(p: Phase): Int = 0 diff --git a/test/files/pos/t5542.flags b/test/files/pos/t5542.flags deleted file mode 100644 index 464cc20ea684..000000000000 --- a/test/files/pos/t5542.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -unchecked \ No newline at end of file diff --git a/test/files/pos/t5542.scala b/test/files/pos/t5542.scala index 80b8cef03046..b44fa72aea73 100644 --- a/test/files/pos/t5542.scala +++ b/test/files/pos/t5542.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -unchecked class Test { Option(3) match { case Some(n) => n; case None => 0 } -} \ No newline at end of file +} diff --git a/test/files/pos/t5639.flags b/test/files/pos/t5639.flags deleted file mode 100644 index 0acce1e7ce9c..000000000000 --- a/test/files/pos/t5639.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.12 diff --git a/test/files/pos/t5639/A_1.scala b/test/files/pos/t5639/A_1.scala index c5da10eae4f9..4bbfcf908968 100644 --- a/test/files/pos/t5639/A_1.scala +++ b/test/files/pos/t5639/A_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.12 import Implicits._ class Baz diff --git a/test/files/pos/t5639/A_2.scala b/test/files/pos/t5639/A_2.scala index 2bb36273e093..3659c20fecab 100644 --- a/test/files/pos/t5639/A_2.scala +++ b/test/files/pos/t5639/A_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.12 import Implicits._ class Baz diff --git a/test/files/pos/t5683.flags b/test/files/pos/t5683.flags deleted file mode 100644 index 41565c7e32bd..000000000000 --- a/test/files/pos/t5683.flags +++ /dev/null @@ -1 +0,0 @@ --Ypartial-unification diff --git a/test/files/pos/t5683.scala b/test/files/pos/t5683.scala index 05ab03579274..cd340f805765 100644 --- a/test/files/pos/t5683.scala +++ b/test/files/pos/t5683.scala @@ -1,3 +1,4 @@ +// scalac: -Ypartial-unification object Test { trait NT[X] trait W[W, A] extends NT[Int] diff --git a/test/files/pos/t5706.flags b/test/files/pos/t5706.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/pos/t5706.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/pos/t5706.scala b/test/files/pos/t5706.scala index 6f0207366b14..eb58e8412229 100644 --- a/test/files/pos/t5706.scala +++ b/test/files/pos/t5706.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.{Context => BlackboxContext} import scala.reflect.macros.whitebox.{Context => WhiteboxContext} diff --git a/test/files/pos/t5809.flags b/test/files/pos/t5809.flags deleted file mode 100644 index e93641e9319e..000000000000 --- a/test/files/pos/t5809.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint -Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t5809.scala b/test/files/pos/t5809.scala index 6101f546b34c..c5235b34e7a6 100644 --- a/test/files/pos/t5809.scala +++ b/test/files/pos/t5809.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint -Xfatal-warnings package object foo { implicit class EnrichedInt(foo: Int) { def bar = ??? diff --git a/test/files/pos/t5818.flags b/test/files/pos/t5818.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/pos/t5818.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/pos/t5818.scala b/test/files/pos/t5818.scala index a4ea7ddc9f28..dba5479e9823 100644 --- a/test/files/pos/t5818.scala +++ b/test/files/pos/t5818.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 abstract class Abstract { type TypeMember val member: TypeMember diff --git a/test/files/pos/t5897.flags b/test/files/pos/t5897.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t5897.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t5897.scala b/test/files/pos/t5897.scala index 2e9751afe08e..2e4afe61ada9 100644 --- a/test/files/pos/t5897.scala +++ b/test/files/pos/t5897.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings // no warning here // (strangely, if there's an unreachable code warning *anywhere in this compilation unit*, // the non-sensical warning goes away under -Xfatal-warnings) diff --git a/test/files/pos/t5899.flags b/test/files/pos/t5899.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t5899.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t5899.scala b/test/files/pos/t5899.scala index 885baca790e7..92bb85186cd8 100644 --- a/test/files/pos/t5899.scala +++ b/test/files/pos/t5899.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings import scala.tools.nsc._ trait Foo { @@ -17,4 +18,4 @@ trait Foo { case Bippy(_) => 3 } } -} \ No newline at end of file +} diff --git a/test/files/pos/t5930.flags b/test/files/pos/t5930.flags deleted file mode 100644 index c7d406c649e8..000000000000 --- a/test/files/pos/t5930.flags +++ /dev/null @@ -1 +0,0 @@ --Ywarn-dead-code -Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t5930.scala b/test/files/pos/t5930.scala index de9d62cfe8a5..845ac9a3bfe2 100644 --- a/test/files/pos/t5930.scala +++ b/test/files/pos/t5930.scala @@ -1,4 +1,5 @@ +// scalac: -Ywarn-dead-code -Xfatal-warnings // should not warn about dead code (`matchEnd(throw new MatchError)`) class Test { 0 match { case x: Int => } -} \ No newline at end of file +} diff --git a/test/files/pos/t5932.flags b/test/files/pos/t5932.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t5932.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t5932.scala b/test/files/pos/t5932.scala index d824523d5b05..78a29e2d6079 100644 --- a/test/files/pos/t5932.scala +++ b/test/files/pos/t5932.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class A case object B extends A diff --git a/test/files/pos/t5954c.flags b/test/files/pos/t5954c.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t5954c.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t5954c/A_1.scala b/test/files/pos/t5954c/A_1.scala index 29ad9547a232..f7d2b98074b3 100644 --- a/test/files/pos/t5954c/A_1.scala +++ b/test/files/pos/t5954c/A_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings package object A { // these used to should be prevented by the implementation restriction // but are now allowed diff --git a/test/files/pos/t5954c/B_2.scala b/test/files/pos/t5954c/B_2.scala index 29ad9547a232..f7d2b98074b3 100644 --- a/test/files/pos/t5954c/B_2.scala +++ b/test/files/pos/t5954c/B_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings package object A { // these used to should be prevented by the implementation restriction // but are now allowed diff --git a/test/files/pos/t5954d.flags b/test/files/pos/t5954d.flags deleted file mode 100644 index 6ced0e709065..000000000000 --- a/test/files/pos/t5954d.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xdev diff --git a/test/files/pos/t5954d/A_1.scala b/test/files/pos/t5954d/A_1.scala index 8465e8f8c6ce..ea096f9c8877 100644 --- a/test/files/pos/t5954d/A_1.scala +++ b/test/files/pos/t5954d/A_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xdev package p { package object base { class B diff --git a/test/files/pos/t5954d/B_2.scala b/test/files/pos/t5954d/B_2.scala index a4aa2eb587e1..6ee13ab07dfe 100644 --- a/test/files/pos/t5954d/B_2.scala +++ b/test/files/pos/t5954d/B_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xdev package p { trait T { class B diff --git a/test/files/pos/t5968.flags b/test/files/pos/t5968.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t5968.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t5968.scala b/test/files/pos/t5968.scala index dd4c7da31400..da5f05da5685 100644 --- a/test/files/pos/t5968.scala +++ b/test/files/pos/t5968.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object X { def f(e: Either[Int, X.type]) = e match { case Left(i) => i diff --git a/test/files/pos/t6008.flags b/test/files/pos/t6008.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t6008.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t6008.scala b/test/files/pos/t6008.scala index 84ae19b21170..737941095c01 100644 --- a/test/files/pos/t6008.scala +++ b/test/files/pos/t6008.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings // none of these should complain about exhaustivity class Test { // It would fail on the following inputs: (_, false), (_, true) @@ -9,4 +10,4 @@ class Test { // Keeping the explicit type for the Int but dropping the one for Boolean presents a spurious warning again: // It would fail on the following input: (_, _) def z(in: (Int, Boolean)) = in match { case (i: Int, b) => 3 } -} \ No newline at end of file +} diff --git a/test/files/pos/t6022.flags b/test/files/pos/t6022.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t6022.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t6022.scala b/test/files/pos/t6022.scala index 522c3352c76c..07d34271c23a 100644 --- a/test/files/pos/t6022.scala +++ b/test/files/pos/t6022.scala @@ -1,7 +1,8 @@ +// scalac: -Xfatal-warnings class Test { (null: Any) match { case x: AnyRef if false => case list: Option[_] => case product: Product => // change Product to String and it's all good } -} \ No newline at end of file +} diff --git a/test/files/pos/t6047.flags b/test/files/pos/t6047.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/pos/t6047.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/pos/t6047.scala b/test/files/pos/t6047.scala index 8c3dd189531d..0960c8b02515 100644 --- a/test/files/pos/t6047.scala +++ b/test/files/pos/t6047.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context import java.io.InputStream @@ -17,4 +18,4 @@ object Macros { unpackcode(implicitly[c.WeakTypeTag[A]].tpe) ??? } - } \ No newline at end of file + } diff --git a/test/files/pos/t6091.flags b/test/files/pos/t6091.flags deleted file mode 100644 index 954eaba3523b..000000000000 --- a/test/files/pos/t6091.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xlint diff --git a/test/files/pos/t6091.scala b/test/files/pos/t6091.scala index 0318640e7b02..ecc32bf64b3a 100644 --- a/test/files/pos/t6091.scala +++ b/test/files/pos/t6091.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint object Foo { def eq(x: Int) = x } class X { def ==(other: String) = other.nonEmpty } diff --git a/test/files/pos/t6123-explaintypes-implicits.flags b/test/files/pos/t6123-explaintypes-implicits.flags deleted file mode 100644 index b36707c7cfcf..000000000000 --- a/test/files/pos/t6123-explaintypes-implicits.flags +++ /dev/null @@ -1 +0,0 @@ --explaintypes diff --git a/test/files/pos/t6123-explaintypes-implicits.scala b/test/files/pos/t6123-explaintypes-implicits.scala index 5242b443d58f..2268e3f3ca6c 100644 --- a/test/files/pos/t6123-explaintypes-implicits.scala +++ b/test/files/pos/t6123-explaintypes-implicits.scala @@ -1,3 +1,4 @@ +// scalac: -explaintypes object ImplicitBugReport { trait Exp[+T] trait CanBuildExp[-Elem, +To] extends (Exp[Elem] => To) diff --git a/test/files/pos/t6146.flags b/test/files/pos/t6146.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t6146.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t6146.scala b/test/files/pos/t6146.scala index b5bde826b1c1..9f20a6b28e73 100644 --- a/test/files/pos/t6146.scala +++ b/test/files/pos/t6146.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings // No unreachable or exhaustiveness warnings, please. // diff --git a/test/files/pos/t6162-inheritance.flags b/test/files/pos/t6162-inheritance.flags deleted file mode 100644 index c6bfaf1f64a4..000000000000 --- a/test/files/pos/t6162-inheritance.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings diff --git a/test/files/pos/t6162-inheritance.scala b/test/files/pos/t6162-inheritance.scala index fca751edabd7..50cc1079fa9f 100644 --- a/test/files/pos/t6162-inheritance.scala +++ b/test/files/pos/t6162-inheritance.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings package scala.t6126 // Don't warn about inheritance in the same file. diff --git a/test/files/pos/t6210.flags b/test/files/pos/t6210.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t6210.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t6210.scala b/test/files/pos/t6210.scala index 855c621b8e39..56108f8fcfd1 100644 --- a/test/files/pos/t6210.scala +++ b/test/files/pos/t6210.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings abstract sealed trait AST abstract sealed trait AExpr extends AST case class AAssign(name: String, v: AExpr) extends AExpr diff --git a/test/files/pos/t6260.flags b/test/files/pos/t6260.flags deleted file mode 100644 index 2349d8294d80..000000000000 --- a/test/files/pos/t6260.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:inline diff --git a/test/files/pos/t6260.scala b/test/files/pos/t6260.scala index 93b5448227d5..1bab9c021fda 100644 --- a/test/files/pos/t6260.scala +++ b/test/files/pos/t6260.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:inline class Box[X](val x: X) extends AnyVal { def map[Y](f: X => Y): Box[Y] = ((bx: Box[X]) => new Box(f(bx.x)))(this) diff --git a/test/files/pos/t6275.flags b/test/files/pos/t6275.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t6275.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t6275.scala b/test/files/pos/t6275.scala index 6b5ec7dcebfb..cd59c5d5ee5b 100644 --- a/test/files/pos/t6275.scala +++ b/test/files/pos/t6275.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed trait A[T] final class B[T] extends A[T] diff --git a/test/files/pos/t6537.flags b/test/files/pos/t6537.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t6537.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t6537.scala b/test/files/pos/t6537.scala index d0ca3ba435a8..ce159f000d02 100644 --- a/test/files/pos/t6537.scala +++ b/test/files/pos/t6537.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings package tester object PatMatWarning { diff --git a/test/files/pos/t6595.flags b/test/files/pos/t6595.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t6595.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t6595.scala b/test/files/pos/t6595.scala index 437c0bcf05e6..08a2873c45f0 100644 --- a/test/files/pos/t6595.scala +++ b/test/files/pos/t6595.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings import scala.annotation.switch class Foo extends { diff --git a/test/files/pos/t6675.flags b/test/files/pos/t6675.flags deleted file mode 100644 index d1b831ea87cd..000000000000 --- a/test/files/pos/t6675.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t6675.scala b/test/files/pos/t6675.scala index f3bebea5be94..d0d863292037 100644 --- a/test/files/pos/t6675.scala +++ b/test/files/pos/t6675.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation -Xfatal-warnings object LeftOrRight { def unapply[A](value: Either[A, A]): Option[A] = value match { case scala.Left(x) => Some(x) diff --git a/test/files/pos/t6771.flags b/test/files/pos/t6771.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t6771.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t6771.scala b/test/files/pos/t6771.scala index 0f0bd4e4a09e..e5668e6883b6 100644 --- a/test/files/pos/t6771.scala +++ b/test/files/pos/t6771.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { type Id[X] = X val a: Id[Option[Int]] = None diff --git a/test/files/pos/t6891.flags b/test/files/pos/t6891.flags deleted file mode 100644 index fe048006aa8d..000000000000 --- a/test/files/pos/t6891.flags +++ /dev/null @@ -1 +0,0 @@ --Ycheck:extmethods -Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t6891.scala b/test/files/pos/t6891.scala index bed2d0d77770..01ab44bd6d35 100644 --- a/test/files/pos/t6891.scala +++ b/test/files/pos/t6891.scala @@ -1,3 +1,4 @@ +// scalac: -Ycheck:extmethods -Xfatal-warnings object O { implicit class Foo[A](val value: String) extends AnyVal { def bippy() = { diff --git a/test/files/pos/t6895b-2.flags b/test/files/pos/t6895b-2.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/pos/t6895b-2.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/pos/t6895b-2.scala b/test/files/pos/t6895b-2.scala index 3be68cd3bf9a..079f3904842c 100644 --- a/test/files/pos/t6895b-2.scala +++ b/test/files/pos/t6895b-2.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 trait Foo[F[_]] trait Bar[F[_], A] diff --git a/test/files/pos/t6895b.flags b/test/files/pos/t6895b.flags deleted file mode 100644 index 7d49efbb8e6c..000000000000 --- a/test/files/pos/t6895b.flags +++ /dev/null @@ -1,2 +0,0 @@ --Ypartial-unification - diff --git a/test/files/pos/t6895b.scala b/test/files/pos/t6895b.scala index 3be68cd3bf9a..735dba55690c 100644 --- a/test/files/pos/t6895b.scala +++ b/test/files/pos/t6895b.scala @@ -1,3 +1,4 @@ +// scalac: -Ypartial-unification trait Foo[F[_]] trait Bar[F[_], A] diff --git a/test/files/pos/t6896.flags b/test/files/pos/t6896.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t6896.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t6896.scala b/test/files/pos/t6896.scala index ab527a804aee..76e357da1049 100644 --- a/test/files/pos/t6896.scala +++ b/test/files/pos/t6896.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object TooManyMains { def main(args: Array[String]): Unit = { println("Hello, World!") diff --git a/test/files/pos/t6942.flags b/test/files/pos/t6942.flags deleted file mode 100644 index 0f96f1f872a4..000000000000 --- a/test/files/pos/t6942.flags +++ /dev/null @@ -1 +0,0 @@ --nowarn \ No newline at end of file diff --git a/test/files/pos/t6942/t6942.scala b/test/files/pos/t6942/t6942.scala index 77963d263487..b6fa968cc670 100644 --- a/test/files/pos/t6942/t6942.scala +++ b/test/files/pos/t6942/t6942.scala @@ -1,3 +1,4 @@ +// scalac: -nowarn // not a peep out of the pattern matcher's unreachability analysis // its budget should suffice for these simple matches (they do have a large search space) class Test { diff --git a/test/files/pos/t6963c.flags b/test/files/pos/t6963c.flags deleted file mode 100644 index 4d6e04914f18..000000000000 --- a/test/files/pos/t6963c.flags +++ /dev/null @@ -1 +0,0 @@ --Xmigration:2.9 -Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t6963c.scala b/test/files/pos/t6963c.scala index d3c3616eb248..4d1ba4bb0b1f 100644 --- a/test/files/pos/t6963c.scala +++ b/test/files/pos/t6963c.scala @@ -1,3 +1,4 @@ +// scalac: -Xmigration:2.9 -Xfatal-warnings object Test { def f1(x: Any) = x.isInstanceOf[Seq[_]] def f2(x: Any) = x match { diff --git a/test/files/pos/t6978.flags b/test/files/pos/t6978.flags deleted file mode 100644 index 7949c2afa212..000000000000 --- a/test/files/pos/t6978.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint -Xfatal-warnings diff --git a/test/files/pos/t6978/S.scala b/test/files/pos/t6978/S.scala index 41897db5ac20..d620c02e7bd2 100644 --- a/test/files/pos/t6978/S.scala +++ b/test/files/pos/t6978/S.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint -Xfatal-warnings trait X { def f: Int } diff --git a/test/files/pos/t6994.flags b/test/files/pos/t6994.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t6994.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t6994.scala b/test/files/pos/t6994.scala index d70719642347..dd8132374ec9 100644 --- a/test/files/pos/t6994.scala +++ b/test/files/pos/t6994.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { object NF { def unapply(t: Throwable): Option[Throwable] = None diff --git a/test/files/pos/t7011.flags b/test/files/pos/t7011.flags deleted file mode 100644 index a4c161553eea..000000000000 --- a/test/files/pos/t7011.flags +++ /dev/null @@ -1 +0,0 @@ --Ydebug -Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t7011.scala b/test/files/pos/t7011.scala index 539f662bc0cf..5f49b029d02e 100644 --- a/test/files/pos/t7011.scala +++ b/test/files/pos/t7011.scala @@ -1,7 +1,8 @@ +// scalac: -Ydebug -Xfatal-warnings object bar { def foo { lazy val x = 42 {()=>x} } -} \ No newline at end of file +} diff --git a/test/files/pos/t7183.flags b/test/files/pos/t7183.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t7183.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t7183.scala b/test/files/pos/t7183.scala index 7647c1634bf8..2efc51684ea7 100644 --- a/test/files/pos/t7183.scala +++ b/test/files/pos/t7183.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class A object A { def unapply(a: A): Some[A] = Some(a) // Change return type to Option[A] and the warning is gone diff --git a/test/files/pos/t7232.flags b/test/files/pos/t7232.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t7232.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t7232/Test.scala b/test/files/pos/t7232/Test.scala index 49c3c12aed02..175db0af4300 100644 --- a/test/files/pos/t7232/Test.scala +++ b/test/files/pos/t7232/Test.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { import pack._ Foo.okay().size() diff --git a/test/files/pos/t7232b.flags b/test/files/pos/t7232b.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t7232b.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t7232b/Test.scala b/test/files/pos/t7232b/Test.scala index 6377e26becc5..33cc6587ae2c 100644 --- a/test/files/pos/t7232b/Test.scala +++ b/test/files/pos/t7232b/Test.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { import pack._ diff --git a/test/files/pos/t7232c.flags b/test/files/pos/t7232c.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t7232c.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t7232c/Test.scala b/test/files/pos/t7232c/Test.scala index aa7c71094839..0fe46e78dd88 100644 --- a/test/files/pos/t7232c/Test.scala +++ b/test/files/pos/t7232c/Test.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { import pack._ Foo.innerList().isInnerList() diff --git a/test/files/pos/t7232d.flags b/test/files/pos/t7232d.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t7232d.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t7232d/Test.scala b/test/files/pos/t7232d/Test.scala index 89a8063b3c17..042e0396d761 100644 --- a/test/files/pos/t7232d/Test.scala +++ b/test/files/pos/t7232d/Test.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { import pack._ Foo.mapEntry().getKey() diff --git a/test/files/pos/t7285a.flags b/test/files/pos/t7285a.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t7285a.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t7285a.scala b/test/files/pos/t7285a.scala index 34e79c741b5b..830807fce2a3 100644 --- a/test/files/pos/t7285a.scala +++ b/test/files/pos/t7285a.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed abstract class Base object Test { diff --git a/test/files/pos/t7315.flags b/test/files/pos/t7315.flags deleted file mode 100644 index d1b831ea87cd..000000000000 --- a/test/files/pos/t7315.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation -Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t7315.scala b/test/files/pos/t7315.scala index 0abcea245158..82a7e727c20a 100644 --- a/test/files/pos/t7315.scala +++ b/test/files/pos/t7315.scala @@ -1,4 +1,5 @@ +// scalac: -deprecation -Xfatal-warnings package scala.pack @deprecatedInheritance -class C[@specialized A] \ No newline at end of file +class C[@specialized A] diff --git a/test/files/pos/t7369.flags b/test/files/pos/t7369.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t7369.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t7369.scala b/test/files/pos/t7369.scala index 2f31c93d2971..3f0d3b60b856 100644 --- a/test/files/pos/t7369.scala +++ b/test/files/pos/t7369.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { val X, Y = true (null: Tuple1[Boolean]) match { @@ -34,4 +35,4 @@ object Test3 { case _ => throw new IllegalArgumentException("Invalid") } } -} \ No newline at end of file +} diff --git a/test/files/pos/t7427.flags b/test/files/pos/t7427.flags deleted file mode 100644 index 9c7d6400fc4d..000000000000 --- a/test/files/pos/t7427.flags +++ /dev/null @@ -1 +0,0 @@ --Ydebug diff --git a/test/files/pos/t7427.scala b/test/files/pos/t7427.scala index cca52950d10f..73ae2b05c937 100644 --- a/test/files/pos/t7427.scala +++ b/test/files/pos/t7427.scala @@ -1,3 +1,4 @@ +// scalac: -Ydebug // Compiles with no options // Compiles with -Ydebug -Ydisable-unreachable-prevention // Crashes with -Ydebug diff --git a/test/files/pos/t7433.flags b/test/files/pos/t7433.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t7433.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t7433.scala b/test/files/pos/t7433.scala index f2109f4afad1..674b49fe5269 100644 --- a/test/files/pos/t7433.scala +++ b/test/files/pos/t7433.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { def foo() { try { diff --git a/test/files/pos/t7551.flags b/test/files/pos/t7551.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t7551.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t7551/T.scala b/test/files/pos/t7551/T.scala index 017926e0e28e..ca9a32e0a410 100644 --- a/test/files/pos/t7551/T.scala +++ b/test/files/pos/t7551/T.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings package p @A(subInterface = classOf[T.S]) diff --git a/test/files/pos/t7551/Test.scala b/test/files/pos/t7551/Test.scala index c1f529c4b1a9..6031bc9f5225 100644 --- a/test/files/pos/t7551/Test.scala +++ b/test/files/pos/t7551/Test.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings package p object Foo { diff --git a/test/files/pos/t7649.flags b/test/files/pos/t7649.flags deleted file mode 100644 index fcf951d90723..000000000000 --- a/test/files/pos/t7649.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos \ No newline at end of file diff --git a/test/files/pos/t7649.scala b/test/files/pos/t7649.scala index d70dc05ea49e..4bcb6068c0fa 100644 --- a/test/files/pos/t7649.scala +++ b/test/files/pos/t7649.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos object Test { val c: scala.reflect.macros.blackbox.Context = ??? import c.universe._ diff --git a/test/files/pos/t7683-stop-after-parser/sample_2.flags b/test/files/pos/t7683-stop-after-parser/sample_2.flags deleted file mode 100644 index 99672cdfd3c4..000000000000 --- a/test/files/pos/t7683-stop-after-parser/sample_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. -Xplugin-require:timebomb -Ystop-after:parser diff --git a/test/files/pos/t7683-stop-after-parser/sample_2.scala b/test/files/pos/t7683-stop-after-parser/sample_2.scala index 7eb11b8204e4..f7a84923593f 100644 --- a/test/files/pos/t7683-stop-after-parser/sample_2.scala +++ b/test/files/pos/t7683-stop-after-parser/sample_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Xplugin-require:timebomb -Ystop-after:parser package sample diff --git a/test/files/pos/t7750.flags b/test/files/pos/t7750.flags deleted file mode 100644 index b216e74c977e..000000000000 --- a/test/files/pos/t7750.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -feature diff --git a/test/files/pos/t7750.scala b/test/files/pos/t7750.scala index befec76949e6..a819a6f06e14 100644 --- a/test/files/pos/t7750.scala +++ b/test/files/pos/t7750.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -feature trait LazyCombiner[Elem, +To, Buff <: Growable[Elem] with Sizing] trait Growable[T] trait Sizing diff --git a/test/files/pos/t7864.flags b/test/files/pos/t7864.flags deleted file mode 100644 index 7ccd56103ae5..000000000000 --- a/test/files/pos/t7864.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint \ No newline at end of file diff --git a/test/files/pos/t7864.scala b/test/files/pos/t7864.scala index b2d8911a179d..42b04187d063 100644 --- a/test/files/pos/t7864.scala +++ b/test/files/pos/t7864.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint object Test { val f = 0; ({ toString; (x: Any) => x})("$f ") diff --git a/test/files/pos/t8001.flags b/test/files/pos/t8001.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/pos/t8001.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t8001/Macros_1.scala b/test/files/pos/t8001/Macros_1.scala index 3b80b88295a7..aee595979679 100644 --- a/test/files/pos/t8001/Macros_1.scala +++ b/test/files/pos/t8001/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context @@ -7,4 +8,4 @@ object Macros { import c.universe._ q"()" } -} \ No newline at end of file +} diff --git a/test/files/pos/t8001/Test_2.scala b/test/files/pos/t8001/Test_2.scala index 6d72d9607045..e4a131b4ea23 100644 --- a/test/files/pos/t8001/Test_2.scala +++ b/test/files/pos/t8001/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -Xfatal-warnings object Test extends App { Macros.foo (): Unit -} \ No newline at end of file +} diff --git a/test/files/pos/t8013.flags b/test/files/pos/t8013.flags deleted file mode 100644 index 219723cec9a1..000000000000 --- a/test/files/pos/t8013.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Xlint:missing-interpolator diff --git a/test/files/pos/t8013/inpervolated_2.scala b/test/files/pos/t8013/inpervolated_2.scala index 90e571b42c8c..757d9af839dc 100644 --- a/test/files/pos/t8013/inpervolated_2.scala +++ b/test/files/pos/t8013/inpervolated_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:missing-interpolator /* * scalac: -Xfatal-warnings -Xlint */ diff --git a/test/files/pos/t8013/inpervolator_1.scala b/test/files/pos/t8013/inpervolator_1.scala index 612e1d727df8..04959a18e2ae 100644 --- a/test/files/pos/t8013/inpervolator_1.scala +++ b/test/files/pos/t8013/inpervolator_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Xlint:missing-interpolator package t8013 diff --git a/test/files/pos/t8040.flags b/test/files/pos/t8040.flags deleted file mode 100644 index 3126c059f0f6..000000000000 --- a/test/files/pos/t8040.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -Ywarn-unused:params diff --git a/test/files/pos/t8040.scala b/test/files/pos/t8040.scala index 3e01014ab40f..65cb992980e8 100644 --- a/test/files/pos/t8040.scala +++ b/test/files/pos/t8040.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -Ywarn-unused:params object Test { implicit class C(val sc: StringContext) { // no warn unused sc diff --git a/test/files/pos/t8064.flags b/test/files/pos/t8064.flags deleted file mode 100644 index 281f0a10cdc3..000000000000 --- a/test/files/pos/t8064.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos diff --git a/test/files/pos/t8064/Client_2.scala b/test/files/pos/t8064/Client_2.scala index 44106782c781..64ce75cbdee6 100644 --- a/test/files/pos/t8064/Client_2.scala +++ b/test/files/pos/t8064/Client_2.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos object Test { Macro { def s = "" @@ -5,4 +6,4 @@ object Test { ??? } } -// Was: a range position validation error (unpositioned tree) \ No newline at end of file +// Was: a range position validation error (unpositioned tree) diff --git a/test/files/pos/t8064/Macro_1.scala b/test/files/pos/t8064/Macro_1.scala index 9f1e6955b4c5..c8de31aad5c9 100644 --- a/test/files/pos/t8064/Macro_1.scala +++ b/test/files/pos/t8064/Macro_1.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos import language.experimental.macros import scala.reflect.macros.blackbox.Context diff --git a/test/files/pos/t8064b.flags b/test/files/pos/t8064b.flags deleted file mode 100644 index 281f0a10cdc3..000000000000 --- a/test/files/pos/t8064b.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos diff --git a/test/files/pos/t8064b/Client_2.scala b/test/files/pos/t8064b/Client_2.scala index a7bf2b9fb4ae..6eac7dc4184b 100644 --- a/test/files/pos/t8064b/Client_2.scala +++ b/test/files/pos/t8064b/Client_2.scala @@ -1,6 +1,7 @@ +// scalac: -Yrangepos object Test { Macro { "".reverse } } -// Was: a range position validation error (tree with offset position enclosing tree with range position) \ No newline at end of file +// Was: a range position validation error (tree with offset position enclosing tree with range position) diff --git a/test/files/pos/t8064b/Macro_1.scala b/test/files/pos/t8064b/Macro_1.scala index 60996bfeca3e..941f7ffd2465 100644 --- a/test/files/pos/t8064b/Macro_1.scala +++ b/test/files/pos/t8064b/Macro_1.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos import language.experimental.macros import scala.reflect.macros.blackbox.Context diff --git a/test/files/pos/t8157-2.10.flags b/test/files/pos/t8157-2.10.flags deleted file mode 100644 index 94c80567477b..000000000000 --- a/test/files/pos/t8157-2.10.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.10 diff --git a/test/files/pos/t8157-2.10.scala b/test/files/pos/t8157-2.10.scala index 597585a96d32..c8ce34be79f0 100644 --- a/test/files/pos/t8157-2.10.scala +++ b/test/files/pos/t8157-2.10.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.10 object Test { // PolyTYped function default arg unicity check, // fails in 2.11, authorized under -Xsource:2.10 def foo(printer: Any, question: => String, show: Boolean = false)(op: => Any): Any = ??? diff --git a/test/files/pos/t8363.flags b/test/files/pos/t8363.flags deleted file mode 100644 index 48b438ddf86a..000000000000 --- a/test/files/pos/t8363.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method diff --git a/test/files/pos/t8363.scala b/test/files/pos/t8363.scala index 639faf4120a7..0b42a9c4d206 100644 --- a/test/files/pos/t8363.scala +++ b/test/files/pos/t8363.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method class C(a: Any) class Test { def foo: Any = { diff --git a/test/files/pos/t8410.flags b/test/files/pos/t8410.flags deleted file mode 100644 index b73762e97091..000000000000 --- a/test/files/pos/t8410.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** -Xfatal-warnings -deprecation:false -opt-warnings:none diff --git a/test/files/pos/t8410.scala b/test/files/pos/t8410.scala index 4d862311fab5..ada06474f64b 100644 --- a/test/files/pos/t8410.scala +++ b/test/files/pos/t8410.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** -Xfatal-warnings -deprecation:false -opt-warnings:none object Test extends App { @deprecated("","") def f = 42 diff --git a/test/files/pos/t8523.flags b/test/files/pos/t8523.flags deleted file mode 100644 index c7d406c649e8..000000000000 --- a/test/files/pos/t8523.flags +++ /dev/null @@ -1 +0,0 @@ --Ywarn-dead-code -Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t8523.scala b/test/files/pos/t8523.scala index dfcb35404df8..96b835aea9c4 100644 --- a/test/files/pos/t8523.scala +++ b/test/files/pos/t8523.scala @@ -1,3 +1,4 @@ +// scalac: -Ywarn-dead-code -Xfatal-warnings import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context @@ -7,4 +8,4 @@ class Impl(val c: Context) { object Macros { def foo: Any = macro Impl.impl -} \ No newline at end of file +} diff --git a/test/files/pos/t8546.flags b/test/files/pos/t8546.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t8546.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t8546.scala b/test/files/pos/t8546.scala index c39d749b4c45..8fc4506e2180 100644 --- a/test/files/pos/t8546.scala +++ b/test/files/pos/t8546.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings package test class F1() { @@ -46,4 +47,4 @@ object Test { new F1().test(1) new F2[Int]().test(1) } -} \ No newline at end of file +} diff --git a/test/files/pos/t8578.flags b/test/files/pos/t8578.flags deleted file mode 100644 index 48b438ddf86a..000000000000 --- a/test/files/pos/t8578.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method diff --git a/test/files/pos/t8578.scala b/test/files/pos/t8578.scala index 879b5f55504d..0e070c1d2a20 100644 --- a/test/files/pos/t8578.scala +++ b/test/files/pos/t8578.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method class DuplicateClassName { () => { {() => ()} @@ -15,4 +16,4 @@ class DuplicateClassName { } // Was: // Different class symbols have the same bytecode-level internal name: -// name: DuplicateClassName$lambda$$$anonfun$111 \ No newline at end of file +// name: DuplicateClassName$lambda$$$anonfun$111 diff --git a/test/files/pos/t8596.flags b/test/files/pos/t8596.flags deleted file mode 100644 index 281f0a10cdc3..000000000000 --- a/test/files/pos/t8596.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos diff --git a/test/files/pos/t8596.scala b/test/files/pos/t8596.scala index bfed58eadfc3..1bed37636484 100644 --- a/test/files/pos/t8596.scala +++ b/test/files/pos/t8596.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos class TypeTreeObjects { class Container { def typeParamAndDefaultArg[C](name: String = ""): String = "" diff --git a/test/files/pos/t8617.flags b/test/files/pos/t8617.flags deleted file mode 100644 index 281f0a10cdc3..000000000000 --- a/test/files/pos/t8617.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos diff --git a/test/files/pos/t8617.scala b/test/files/pos/t8617.scala index fc825bbcbadd..1f536086cb15 100644 --- a/test/files/pos/t8617.scala +++ b/test/files/pos/t8617.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos object Test { def foo[A] = implicitly[OptManifest[A]] // was "unpositioned tree" under -Yrangepos diff --git a/test/files/pos/t8736-b.flags b/test/files/pos/t8736-b.flags deleted file mode 100644 index 1ad4eabe0f4c..000000000000 --- a/test/files/pos/t8736-b.flags +++ /dev/null @@ -1 +0,0 @@ --feature -language:_ -Xfatal-warnings diff --git a/test/files/pos/t8736.flags b/test/files/pos/t8736.flags deleted file mode 100644 index 7fe42f7340ea..000000000000 --- a/test/files/pos/t8736.flags +++ /dev/null @@ -1 +0,0 @@ --feature -language:implicitConversions -language:higherKinds -language:-implicitConversions -Xfatal-warnings diff --git a/test/files/pos/t8781/Test_2.flags b/test/files/pos/t8781/Test_2.flags deleted file mode 100644 index 24e210969040..000000000000 --- a/test/files/pos/t8781/Test_2.flags +++ /dev/null @@ -1 +0,0 @@ --Ymacro-expand:discard -Ystop-after:typer diff --git a/test/files/pos/t8781/Test_2.scala b/test/files/pos/t8781/Test_2.scala index 3ca64065992d..bd86664ac4e8 100644 --- a/test/files/pos/t8781/Test_2.scala +++ b/test/files/pos/t8781/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -Ymacro-expand:discard -Ystop-after:typer object Test { implicit class RichT(t: T) { def augmented = "" } diff --git a/test/files/pos/t8828.flags b/test/files/pos/t8828.flags deleted file mode 100644 index e68991f64344..000000000000 --- a/test/files/pos/t8828.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint:inaccessible -Xfatal-warnings diff --git a/test/files/pos/t8828.scala b/test/files/pos/t8828.scala index 182aba54c092..ea242656bcd8 100644 --- a/test/files/pos/t8828.scala +++ b/test/files/pos/t8828.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint:inaccessible -Xfatal-warnings package outer diff --git a/test/files/pos/t8861.flags b/test/files/pos/t8861.flags deleted file mode 100644 index 99a63910585e..000000000000 --- a/test/files/pos/t8861.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint:infer-any -Xfatal-warnings diff --git a/test/files/pos/t8861.scala b/test/files/pos/t8861.scala index 816d15700eb7..5f1c6161a4ae 100644 --- a/test/files/pos/t8861.scala +++ b/test/files/pos/t8861.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint:infer-any -Xfatal-warnings trait Test { type R = PartialFunction[Any, Unit] diff --git a/test/files/pos/t8934a/Test_2.flags b/test/files/pos/t8934a/Test_2.flags deleted file mode 100644 index 618dfe2b756b..000000000000 --- a/test/files/pos/t8934a/Test_2.flags +++ /dev/null @@ -1 +0,0 @@ --Ystop-after:typer -Ymacro-expand:discard -nowarn diff --git a/test/files/pos/t8934a/Test_2.scala b/test/files/pos/t8934a/Test_2.scala index e1792ed3c5af..ecc922db0859 100644 --- a/test/files/pos/t8934a/Test_2.scala +++ b/test/files/pos/t8934a/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -Ystop-after:typer -Ymacro-expand:discard -nowarn object Test { "" match { case Unapply(a, b) => diff --git a/test/files/pos/t8954.flags b/test/files/pos/t8954.flags deleted file mode 100644 index 7de3c0f3eea0..000000000000 --- a/test/files/pos/t8954.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -deprecation diff --git a/test/files/pos/t8954/t1.scala b/test/files/pos/t8954/t1.scala index 3986d9f3b546..1f015a7d48d0 100644 --- a/test/files/pos/t8954/t1.scala +++ b/test/files/pos/t8954/t1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -deprecation package scala.foo // 1. a class about to be made final diff --git a/test/files/pos/t8954/t2.scala b/test/files/pos/t8954/t2.scala index c178486bc98b..899ad407015d 100644 --- a/test/files/pos/t8954/t2.scala +++ b/test/files/pos/t8954/t2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -deprecation package scala.foo // 1.2 deprecated children should be fine... diff --git a/test/files/pos/t8965.flags b/test/files/pos/t8965.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t8965.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t8965.scala b/test/files/pos/t8965.scala index 4f39330f4e9d..84f7bc479053 100644 --- a/test/files/pos/t8965.scala +++ b/test/files/pos/t8965.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class A { def f(x: Any with AnyRef, y: Any with AnyRef) = x eq y // a.scala:2: warning: Any and Any are unrelated: they will most likely never compare equal diff --git a/test/files/pos/t8999.flags b/test/files/pos/t8999.flags deleted file mode 100644 index 0f96f1f872a4..000000000000 --- a/test/files/pos/t8999.flags +++ /dev/null @@ -1 +0,0 @@ --nowarn \ No newline at end of file diff --git a/test/files/pos/t8999.scala b/test/files/pos/t8999.scala index 99c4b2ad84e5..ad2f99b906ba 100644 --- a/test/files/pos/t8999.scala +++ b/test/files/pos/t8999.scala @@ -1,3 +1,4 @@ +// scalac: -nowarn object Types { abstract sealed class Type @@ -268,4 +269,4 @@ object Main { _: JSEnvInfo | _: Literal | EmptyTree => } } -} \ No newline at end of file +} diff --git a/test/files/pos/t9020.flags b/test/files/pos/t9020.flags deleted file mode 100644 index efb2dd3e6fa9..000000000000 --- a/test/files/pos/t9020.flags +++ /dev/null @@ -1 +0,0 @@ --Ywarn-value-discard -Xfatal-warnings diff --git a/test/files/pos/t9020.scala b/test/files/pos/t9020.scala index c77a63cb1a47..b43e7516ae6c 100644 --- a/test/files/pos/t9020.scala +++ b/test/files/pos/t9020.scala @@ -1,3 +1,4 @@ +// scalac: -Ywarn-value-discard -Xfatal-warnings trait ValueDiscard[@specialized U] { def u: U } diff --git a/test/files/pos/t9111-inliner-workaround.flags b/test/files/pos/t9111-inliner-workaround.flags deleted file mode 100644 index 0f85fc3bd844..000000000000 --- a/test/files/pos/t9111-inliner-workaround.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** \ No newline at end of file diff --git a/test/files/pos/t9111-inliner-workaround/Test_1.scala b/test/files/pos/t9111-inliner-workaround/Test_1.scala index dc61db14eae9..cd477ddb4161 100644 --- a/test/files/pos/t9111-inliner-workaround/Test_1.scala +++ b/test/files/pos/t9111-inliner-workaround/Test_1.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** object Test extends App { println(new A_1.Inner()) diff --git a/test/files/pos/t9178b.flags b/test/files/pos/t9178b.flags deleted file mode 100644 index 48fd867160ba..000000000000 --- a/test/files/pos/t9178b.flags +++ /dev/null @@ -1 +0,0 @@ --Xexperimental diff --git a/test/files/pos/t9178b.scala b/test/files/pos/t9178b.scala index cbeaed4f17fe..a1d3837ed650 100644 --- a/test/files/pos/t9178b.scala +++ b/test/files/pos/t9178b.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental abstract class Test{ val writeInput: java.io.OutputStream => Unit def getOutputStream(): java.io.OutputStream diff --git a/test/files/pos/t9220.flags b/test/files/pos/t9220.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t9220.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t9220.scala b/test/files/pos/t9220.scala index 067341da5315..7e4f11ba2829 100644 --- a/test/files/pos/t9220.scala +++ b/test/files/pos/t9220.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { trait Command object Command { diff --git a/test/files/pos/t9285.flags b/test/files/pos/t9285.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t9285.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t9285.scala b/test/files/pos/t9285.scala index b7146cdf1c42..2fedc05f5bbf 100644 --- a/test/files/pos/t9285.scala +++ b/test/files/pos/t9285.scala @@ -1 +1,2 @@ +// scalac: -Xfatal-warnings case class C(placeholder: Unit) diff --git a/test/files/pos/t9369.flags b/test/files/pos/t9369.flags deleted file mode 100644 index b5a874865273..000000000000 --- a/test/files/pos/t9369.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings -unchecked diff --git a/test/files/pos/t9369.scala b/test/files/pos/t9369.scala index 94be2ea4e797..ed8edf5a462b 100644 --- a/test/files/pos/t9369.scala +++ b/test/files/pos/t9369.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings -unchecked object Test { trait Tree @@ -21,4 +22,4 @@ object Test { case Not(Not(prop)) => ??? case _ => ??? } -} \ No newline at end of file +} diff --git a/test/files/pos/t9370/sample_2.flags b/test/files/pos/t9370/sample_2.flags deleted file mode 100644 index dd7eb55d3308..000000000000 --- a/test/files/pos/t9370/sample_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:/tmp -Xplugin:. -Xplugin-require:timebomb -Ystop-after:parser diff --git a/test/files/pos/t9370/sample_2.scala b/test/files/pos/t9370/sample_2.scala index 7eb11b8204e4..3149d56c2942 100644 --- a/test/files/pos/t9370/sample_2.scala +++ b/test/files/pos/t9370/sample_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:/tmp -Xplugin:. -Xplugin-require:timebomb -Ystop-after:parser package sample diff --git a/test/files/pos/t9399.flags b/test/files/pos/t9399.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t9399.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t9399.scala b/test/files/pos/t9399.scala index e8a8720f9408..572dc1423790 100644 --- a/test/files/pos/t9399.scala +++ b/test/files/pos/t9399.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed abstract class TA sealed abstract class TB extends TA case object A extends TA diff --git a/test/files/pos/t9411a.flags b/test/files/pos/t9411a.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t9411a.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t9411a.scala b/test/files/pos/t9411a.scala index d5264663ece9..b97b07c92715 100644 --- a/test/files/pos/t9411a.scala +++ b/test/files/pos/t9411a.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object OhNoes { sealed trait F diff --git a/test/files/pos/t9411b.flags b/test/files/pos/t9411b.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t9411b.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t9411b.scala b/test/files/pos/t9411b.scala index 6888ba9382c8..738b80db5c8a 100644 --- a/test/files/pos/t9411b.scala +++ b/test/files/pos/t9411b.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object OhNoes { sealed trait F diff --git a/test/files/pos/t9630.flags b/test/files/pos/t9630.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t9630.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t9630/t9630a.scala b/test/files/pos/t9630/t9630a.scala index c76ecd2ff217..6629bd350f06 100644 --- a/test/files/pos/t9630/t9630a.scala +++ b/test/files/pos/t9630/t9630a.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed trait Base final case class Base_1(sameName: Some[Any]) extends Base diff --git a/test/files/pos/t9630/t9630b.scala b/test/files/pos/t9630/t9630b.scala index 3e1787ec5207..84d6382bdc39 100644 --- a/test/files/pos/t9630/t9630b.scala +++ b/test/files/pos/t9630/t9630b.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings class Test { def test(b: Base): Unit = b match { diff --git a/test/files/pos/unchecked-a.flags b/test/files/pos/unchecked-a.flags deleted file mode 100644 index 779916d58f80..000000000000 --- a/test/files/pos/unchecked-a.flags +++ /dev/null @@ -1 +0,0 @@ --unchecked -Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/unchecked-a.scala b/test/files/pos/unchecked-a.scala index deceb91c3662..0ca406b72af4 100644 --- a/test/files/pos/unchecked-a.scala +++ b/test/files/pos/unchecked-a.scala @@ -1,3 +1,4 @@ +// scalac: -unchecked -Xfatal-warnings trait Y trait Z extends Y class X[+A <: Y] diff --git a/test/files/pos/value-class-override-no-spec.flags b/test/files/pos/value-class-override-no-spec.flags deleted file mode 100644 index a7e64e4f0c3f..000000000000 --- a/test/files/pos/value-class-override-no-spec.flags +++ /dev/null @@ -1 +0,0 @@ --no-specialization \ No newline at end of file diff --git a/test/files/pos/value-class-override-no-spec.scala b/test/files/pos/value-class-override-no-spec.scala index 79de5d93054a..368101df4885 100644 --- a/test/files/pos/value-class-override-no-spec.scala +++ b/test/files/pos/value-class-override-no-spec.scala @@ -1,3 +1,4 @@ +// scalac: -no-specialization // There are two versions of this tests: one with and one without specialization. // The bug was only exposed *without* specialization. trait T extends Any { diff --git a/test/files/pos/virtpatmat_alts_subst.flags b/test/files/pos/virtpatmat_alts_subst.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/pos/virtpatmat_alts_subst.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/pos/virtpatmat_alts_subst.scala b/test/files/pos/virtpatmat_alts_subst.scala index e27c52f9c772..b03bbe3b0390 100644 --- a/test/files/pos/virtpatmat_alts_subst.scala +++ b/test/files/pos/virtpatmat_alts_subst.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental case class Foo(s: String) { def appliedType(tycon: Any) = tycon match { diff --git a/test/files/pos/virtpatmat_binding_opt.flags b/test/files/pos/virtpatmat_binding_opt.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/pos/virtpatmat_binding_opt.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/pos/virtpatmat_binding_opt.scala b/test/files/pos/virtpatmat_binding_opt.scala index 8ec931fe78fa..489950d090da 100644 --- a/test/files/pos/virtpatmat_binding_opt.scala +++ b/test/files/pos/virtpatmat_binding_opt.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental class Test { def combine = this match { case that if that eq this => this // just return this diff --git a/test/files/pos/virtpatmat_castbinder.flags b/test/files/pos/virtpatmat_castbinder.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/pos/virtpatmat_castbinder.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/pos/virtpatmat_castbinder.scala b/test/files/pos/virtpatmat_castbinder.scala index be269638ceb9..82a97faed59b 100644 --- a/test/files/pos/virtpatmat_castbinder.scala +++ b/test/files/pos/virtpatmat_castbinder.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental class IntMap[+V] case class Bin[+T](m: IntMap[T]) extends IntMap[T] case class Tip[+T](x: T) extends IntMap[T] @@ -12,4 +13,4 @@ trait IntMapIterator[V, T] { valueOf(t) } } -} \ No newline at end of file +} diff --git a/test/files/pos/virtpatmat_exhaust_unchecked.flags b/test/files/pos/virtpatmat_exhaust_unchecked.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/virtpatmat_exhaust_unchecked.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/virtpatmat_exhaust_unchecked.scala b/test/files/pos/virtpatmat_exhaust_unchecked.scala index 641f2b4f9a32..d97dc04eea8d 100644 --- a/test/files/pos/virtpatmat_exhaust_unchecked.scala +++ b/test/files/pos/virtpatmat_exhaust_unchecked.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed trait Option {} case class Choice(a: Option, b: Option) extends Option; case class Some(x: Boolean) extends Option; diff --git a/test/files/pos/virtpatmat_exist1.flags b/test/files/pos/virtpatmat_exist1.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/pos/virtpatmat_exist1.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/pos/virtpatmat_exist1.scala b/test/files/pos/virtpatmat_exist1.scala index 1f24892489f1..a8c1322e61e8 100644 --- a/test/files/pos/virtpatmat_exist1.scala +++ b/test/files/pos/virtpatmat_exist1.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental import annotation.unchecked.{ uncheckedVariance=> uV } import scala.collection.immutable.{ListMap, ListSet} import scala.collection.mutable.{HashMap, HashSet} diff --git a/test/files/pos/virtpatmat_exist2.flags b/test/files/pos/virtpatmat_exist2.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/pos/virtpatmat_exist2.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/pos/virtpatmat_exist2.scala b/test/files/pos/virtpatmat_exist2.scala index ee186074ab01..e9859f4d49ec 100644 --- a/test/files/pos/virtpatmat_exist2.scala +++ b/test/files/pos/virtpatmat_exist2.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental class ParseResult[+T] case class MemoEntry[+T](var r: Either[Nothing,ParseResult[_]]) @@ -17,4 +18,4 @@ object Test { // one[ParseResult[T]](x6.asInstanceOf[ParseResult[T]]))))))))): Option[ParseResult[T]] // ).orElse[ParseResult[T]]((zero: Option[ParseResult[T]])))) // } -} \ No newline at end of file +} diff --git a/test/files/pos/virtpatmat_exist3.flags b/test/files/pos/virtpatmat_exist3.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/pos/virtpatmat_exist3.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/pos/virtpatmat_exist3.scala b/test/files/pos/virtpatmat_exist3.scala index 94385f32c98e..09ce4883f360 100644 --- a/test/files/pos/virtpatmat_exist3.scala +++ b/test/files/pos/virtpatmat_exist3.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental class ReferenceQueue[T] { def wrapper(jref: ReferenceQueue[_]): ReferenceQueue[T] = jref match { @@ -9,4 +10,4 @@ class ReferenceQueue[T] { // OptionMatching.one(null))): Option[ReferenceQueue[T]]).orElse( // (OptionMatching.zero: Option[ReferenceQueue[T]]))) // ) -} \ No newline at end of file +} diff --git a/test/files/pos/virtpatmat_gadt_array.flags b/test/files/pos/virtpatmat_gadt_array.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/pos/virtpatmat_gadt_array.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/pos/virtpatmat_gadt_array.scala b/test/files/pos/virtpatmat_gadt_array.scala index f3332a897fd1..b1c6befb0e4e 100644 --- a/test/files/pos/virtpatmat_gadt_array.scala +++ b/test/files/pos/virtpatmat_gadt_array.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental import scala.collection.mutable._ object Test { def genericArrayOps[T](xs: Array[T]): ArrayOps[T] = xs match { @@ -12,4 +13,4 @@ object Test { // OptionMatching.one(null))): Option[scala.collection.mutable.ArrayOps[T]])): Option[scala.collection.mutable.ArrayOps[T]]).orElse((OptionMatching.zero: Option[scala.collection.mutable.ArrayOps[T]])))) def refArrayOps[T <: AnyRef](xs: Array[T]): ArrayOps[T] = new ArrayOps.ofRef[T](xs) -} \ No newline at end of file +} diff --git a/test/files/pos/virtpatmat_infer_single_1.flags b/test/files/pos/virtpatmat_infer_single_1.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/pos/virtpatmat_infer_single_1.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/pos/virtpatmat_infer_single_1.scala b/test/files/pos/virtpatmat_infer_single_1.scala index b42af956cc5e..a12a67a7e30b 100644 --- a/test/files/pos/virtpatmat_infer_single_1.scala +++ b/test/files/pos/virtpatmat_infer_single_1.scala @@ -1,7 +1,8 @@ +// scalac: -Xexperimental case class TypeBounds(a: Type, b: Type) class Type { def bounds: TypeBounds = bounds match { case TypeBounds(_: this.type, _: this.type) => TypeBounds(this, this) case oftp => oftp } -} \ No newline at end of file +} diff --git a/test/files/pos/virtpatmat_instof_valuetype.flags b/test/files/pos/virtpatmat_instof_valuetype.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/pos/virtpatmat_instof_valuetype.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/pos/virtpatmat_instof_valuetype.scala b/test/files/pos/virtpatmat_instof_valuetype.scala index 1dda9bf57cf0..01bc2f138f7c 100644 --- a/test/files/pos/virtpatmat_instof_valuetype.scala +++ b/test/files/pos/virtpatmat_instof_valuetype.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental case class Data(private val t: Option[String] = None, only: Boolean = false) { def add(other: Data) = { other match { @@ -5,4 +6,4 @@ case class Data(private val t: Option[String] = None, only: Boolean = false) { case Data(Some(_), b) => () } } -} \ No newline at end of file +} diff --git a/test/files/pos/virtpatmat_obj_in_case.flags b/test/files/pos/virtpatmat_obj_in_case.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/pos/virtpatmat_obj_in_case.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/pos/virtpatmat_obj_in_case.scala b/test/files/pos/virtpatmat_obj_in_case.scala index 496de4c12efa..67f9ae2015d6 100644 --- a/test/files/pos/virtpatmat_obj_in_case.scala +++ b/test/files/pos/virtpatmat_obj_in_case.scala @@ -1,5 +1,6 @@ +// scalac: -Xexperimental class ObjInCase { 0 match { case _ => object o } -} \ No newline at end of file +} diff --git a/test/files/pos/warn-unused-params-not-implicits.flags b/test/files/pos/warn-unused-params-not-implicits.flags deleted file mode 100644 index 1d55b15f01e8..000000000000 --- a/test/files/pos/warn-unused-params-not-implicits.flags +++ /dev/null @@ -1 +0,0 @@ --Ywarn-unused:params,-implicits -Xfatal-warnings diff --git a/test/files/pos/warn-unused-params-not-implicits.scala b/test/files/pos/warn-unused-params-not-implicits.scala index c07f7699934f..c2e4f39a0a7c 100644 --- a/test/files/pos/warn-unused-params-not-implicits.scala +++ b/test/files/pos/warn-unused-params-not-implicits.scala @@ -1,3 +1,4 @@ +// scalac: -Ywarn-unused:params,-implicits -Xfatal-warnings trait InterFace { /** Call something. */ diff --git a/test/files/pos/xlint1.flags b/test/files/pos/xlint1.flags deleted file mode 100644 index 7949c2afa212..000000000000 --- a/test/files/pos/xlint1.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint -Xfatal-warnings diff --git a/test/files/pos/xlint1.scala b/test/files/pos/xlint1.scala index 27936d8b14c7..ff8c8515f92b 100644 --- a/test/files/pos/xlint1.scala +++ b/test/files/pos/xlint1.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint -Xfatal-warnings package object foo { implicit class Bar[T](val x: T) extends AnyVal { def bippy = 1 diff --git a/test/files/pos/z1730.flags b/test/files/pos/z1730.flags deleted file mode 100644 index 531968159074..000000000000 --- a/test/files/pos/z1730.flags +++ /dev/null @@ -1 +0,0 @@ --Ycheck:all \ No newline at end of file diff --git a/test/files/pos/z1730.scala b/test/files/pos/z1730.scala index 0c5875a8182a..1e74aa48d2f5 100644 --- a/test/files/pos/z1730.scala +++ b/test/files/pos/z1730.scala @@ -1,3 +1,4 @@ +// scalac: -Ycheck:all // /scala/trac/z1730/a.scala // Wed May 23 07:41:25 PDT 2012 diff --git a/test/files/presentation/ide-t1000976.check b/test/files/presentation/ide-t1000976.check index d58f86d6c63f..a70d6a028189 100644 --- a/test/files/presentation/ide-t1000976.check +++ b/test/files/presentation/ide-t1000976.check @@ -1 +1,2 @@ -Test OK \ No newline at end of file +not found: object c +not found: type C diff --git a/test/files/presentation/ide-t1000976.flags b/test/files/presentation/ide-t1000976.flags deleted file mode 100644 index 9a1a05a4f6ad..000000000000 --- a/test/files/presentation/ide-t1000976.flags +++ /dev/null @@ -1 +0,0 @@ --sourcepath src \ No newline at end of file diff --git a/test/files/presentation/ide-t1000976/Test.scala b/test/files/presentation/ide-t1000976/Test.scala index 722259d3a1ff..8a1584cea0c9 100644 --- a/test/files/presentation/ide-t1000976/Test.scala +++ b/test/files/presentation/ide-t1000976/Test.scala @@ -1,3 +1,4 @@ +// scalac: -sourcepath src import scala.tools.nsc.interactive.tests.InteractiveTest import scala.reflect.internal.util.SourceFile import scala.tools.nsc.interactive.Response diff --git a/test/files/presentation/t8085.check b/test/files/presentation/t8085.check index 0e85de45f915..fd1aae4c1afb 100644 --- a/test/files/presentation/t8085.check +++ b/test/files/presentation/t8085.check @@ -1,2 +1,3 @@ reload: NodeScalaSuite.scala -Test OK +value rich is not a member of String +not found: type Foo diff --git a/test/files/presentation/t8085.flags b/test/files/presentation/t8085.flags deleted file mode 100644 index ec35b223d826..000000000000 --- a/test/files/presentation/t8085.flags +++ /dev/null @@ -1 +0,0 @@ --sourcepath src diff --git a/test/files/presentation/t8085/Test.scala b/test/files/presentation/t8085/Test.scala index e46b7ab8c891..6ec7c11b9c39 100644 --- a/test/files/presentation/t8085/Test.scala +++ b/test/files/presentation/t8085/Test.scala @@ -1,3 +1,4 @@ +// scalac: -sourcepath src import scala.tools.nsc.interactive.tests.InteractiveTest import scala.reflect.internal.util.SourceFile import scala.tools.nsc.interactive.Response diff --git a/test/files/presentation/t8085b.check b/test/files/presentation/t8085b.check index 0e85de45f915..fd1aae4c1afb 100644 --- a/test/files/presentation/t8085b.check +++ b/test/files/presentation/t8085b.check @@ -1,2 +1,3 @@ reload: NodeScalaSuite.scala -Test OK +value rich is not a member of String +not found: type Foo diff --git a/test/files/presentation/t8085b.flags b/test/files/presentation/t8085b.flags deleted file mode 100644 index ec35b223d826..000000000000 --- a/test/files/presentation/t8085b.flags +++ /dev/null @@ -1 +0,0 @@ --sourcepath src diff --git a/test/files/presentation/t8085b/Test.scala b/test/files/presentation/t8085b/Test.scala index e46b7ab8c891..6ec7c11b9c39 100644 --- a/test/files/presentation/t8085b/Test.scala +++ b/test/files/presentation/t8085b/Test.scala @@ -1,3 +1,4 @@ +// scalac: -sourcepath src import scala.tools.nsc.interactive.tests.InteractiveTest import scala.reflect.internal.util.SourceFile import scala.tools.nsc.interactive.Response diff --git a/test/files/run/abstype_implicits.flags b/test/files/run/abstype_implicits.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/run/abstype_implicits.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/run/abstype_implicits.scala b/test/files/run/abstype_implicits.scala index 30a8f81607a0..b3bcb20f5f6c 100644 --- a/test/files/run/abstype_implicits.scala +++ b/test/files/run/abstype_implicits.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 import scala.language.higherKinds trait Functor[F[_]] diff --git a/test/files/run/anyval-box-types.flags b/test/files/run/anyval-box-types.flags deleted file mode 100644 index 1a27bf3bc32d..000000000000 --- a/test/files/run/anyval-box-types.flags +++ /dev/null @@ -1 +0,0 @@ --Xmaxwarns 0 -opt:l:method \ No newline at end of file diff --git a/test/files/run/anyval-box-types.scala b/test/files/run/anyval-box-types.scala index e0be56a6f4d0..cd219aed556d 100644 --- a/test/files/run/anyval-box-types.scala +++ b/test/files/run/anyval-box-types.scala @@ -1,3 +1,4 @@ +// scalac: -Xmaxwarns 0 -opt:l:method object Test extends App { val one: java.lang.Integer = 1 @@ -63,4 +64,4 @@ object Test extends App { println(tsu.isInstanceOf[java.lang.Double]) println(tsu.isInstanceOf[java.lang.Boolean]) -} \ No newline at end of file +} diff --git a/test/files/run/applydynamic_sip.flags b/test/files/run/applydynamic_sip.flags deleted file mode 100644 index ba6d37305e99..000000000000 --- a/test/files/run/applydynamic_sip.flags +++ /dev/null @@ -1,2 +0,0 @@ --Yrangepos:false --language:dynamics diff --git a/test/files/run/applydynamic_sip.scala b/test/files/run/applydynamic_sip.scala index 47d0c6a303d7..c33da81b3843 100644 --- a/test/files/run/applydynamic_sip.scala +++ b/test/files/run/applydynamic_sip.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos:false -language:dynamics object Test extends App { object stubUpdate { def update(as: Any*) = println(".update"+as.toList.mkString("(",", ", ")")) diff --git a/test/files/jvm/t10512a.flags b/test/files/run/bcodeInlinerMixed.check similarity index 100% rename from test/files/jvm/t10512a.flags rename to test/files/run/bcodeInlinerMixed.check diff --git a/test/files/run/bcodeInlinerMixed.flags b/test/files/run/bcodeInlinerMixed.flags deleted file mode 100644 index 0f85fc3bd844..000000000000 --- a/test/files/run/bcodeInlinerMixed.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** \ No newline at end of file diff --git a/test/files/run/bcodeInlinerMixed/B_1.scala b/test/files/run/bcodeInlinerMixed/B_1.scala index b26f2f1dd524..1628dc24fe5c 100644 --- a/test/files/run/bcodeInlinerMixed/B_1.scala +++ b/test/files/run/bcodeInlinerMixed/B_1.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** // Since 1.0.18, partest does mixed compilation only in two stages // 1. scalac *.scala *.java // 2. javac *.java diff --git a/test/files/run/bcodeInlinerMixed/Test_2.scala b/test/files/run/bcodeInlinerMixed/Test_2.scala index db1ea14a8ff6..00451fa6c5aa 100644 --- a/test/files/run/bcodeInlinerMixed/Test_2.scala +++ b/test/files/run/bcodeInlinerMixed/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** import scala.tools.partest.{BytecodeTest, ASMConverters} import ASMConverters._ diff --git a/test/files/run/checked.check b/test/files/run/checked.check index 258e93e5b240..a71a51ee4a8a 100644 --- a/test/files/run/checked.check +++ b/test/files/run/checked.check @@ -1,7 +1,7 @@ sum = 12 -[OK] Caught UFE: Uninitialized field: checked.scala: 42 +[OK] Caught UFE: Uninitialized field: checked.scala: 43 2 -[OK] Caught UFE: Uninitialized field: checked.scala: 73 +[OK] Caught UFE: Uninitialized field: checked.scala: 74 x = 10 y = 11 lz1 = 1 diff --git a/test/files/run/checked.flags b/test/files/run/checked.flags deleted file mode 100644 index bcfd4cc1dbd9..000000000000 --- a/test/files/run/checked.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit -nowarn diff --git a/test/files/run/checked.scala b/test/files/run/checked.scala index e4db9c0916f2..62522da34690 100644 --- a/test/files/run/checked.scala +++ b/test/files/run/checked.scala @@ -1,3 +1,4 @@ +// scalac: -Xcheckinit -nowarn /* Test checked initializers. Needs to be run with -Xexperimental and -checkinit */ diff --git a/test/files/run/checkinit.check b/test/files/run/checkinit.check index 9ef3caa5c609..19941473ac0c 100644 --- a/test/files/run/checkinit.check +++ b/test/files/run/checkinit.check @@ -1,2 +1,2 @@ -Uninitialized field: checkinit.scala: 26 -Uninitialized field: checkinit.scala: 30 +Uninitialized field: checkinit.scala: 27 +Uninitialized field: checkinit.scala: 31 diff --git a/test/files/run/checkinit.flags b/test/files/run/checkinit.flags deleted file mode 100644 index 3d1ee4760af6..000000000000 --- a/test/files/run/checkinit.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit diff --git a/test/files/run/checkinit.scala b/test/files/run/checkinit.scala index 0dd013221c8c..e1da600c20ba 100644 --- a/test/files/run/checkinit.scala +++ b/test/files/run/checkinit.scala @@ -1,3 +1,4 @@ +// scalac: -Xcheckinit class C(val x: AnyRef, val y: AnyRef) class D(val x: AnyRef, val y: AnyRef) { val z: AnyRef = "" diff --git a/test/files/run/delambdafy-dependent-on-param-subst.flags b/test/files/run/delambdafy-dependent-on-param-subst.flags deleted file mode 100644 index 2b27e1983084..000000000000 --- a/test/files/run/delambdafy-dependent-on-param-subst.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method \ No newline at end of file diff --git a/test/files/run/delambdafy-dependent-on-param-subst.scala b/test/files/run/delambdafy-dependent-on-param-subst.scala index 7b6fc597e8e8..a934138f2aa6 100644 --- a/test/files/run/delambdafy-dependent-on-param-subst.scala +++ b/test/files/run/delambdafy-dependent-on-param-subst.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method trait M[-X] { def m(x: X): Boolean } diff --git a/test/files/run/deprecate-early-type-defs.check b/test/files/run/deprecate-early-type-defs.check index 1ee01df13e4b..9b1449ffcf5e 100644 --- a/test/files/run/deprecate-early-type-defs.check +++ b/test/files/run/deprecate-early-type-defs.check @@ -1,3 +1,3 @@ -deprecate-early-type-defs.scala:1: warning: early type members are deprecated. Move them to the regular body: the semantics are the same. +deprecate-early-type-defs.scala:2: warning: early type members are deprecated. Move them to the regular body: the semantics are the same. object Test extends { type T = Int } with App ^ diff --git a/test/files/run/deprecate-early-type-defs.flags b/test/files/run/deprecate-early-type-defs.flags deleted file mode 100644 index c36e713ab84b..000000000000 --- a/test/files/run/deprecate-early-type-defs.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation \ No newline at end of file diff --git a/test/files/run/deprecate-early-type-defs.scala b/test/files/run/deprecate-early-type-defs.scala index 99e42166f241..813eaf9415e2 100644 --- a/test/files/run/deprecate-early-type-defs.scala +++ b/test/files/run/deprecate-early-type-defs.scala @@ -1 +1,2 @@ -object Test extends { type T = Int } with App \ No newline at end of file +// scalac: -deprecation +object Test extends { type T = Int } with App diff --git a/test/files/run/disable-assertions.flags b/test/files/run/disable-assertions.flags deleted file mode 100644 index afaa521a12e2..000000000000 --- a/test/files/run/disable-assertions.flags +++ /dev/null @@ -1 +0,0 @@ --Xdisable-assertions diff --git a/test/files/run/disable-assertions.scala b/test/files/run/disable-assertions.scala index 7ec4cfb495c9..d329da9f76b4 100644 --- a/test/files/run/disable-assertions.scala +++ b/test/files/run/disable-assertions.scala @@ -1,3 +1,4 @@ +// scalac: -Xdisable-assertions object Elided { import annotation._, elidable._ diff --git a/test/files/run/elidable-opt.flags b/test/files/run/elidable-opt.flags deleted file mode 100644 index 93fd3d531714..000000000000 --- a/test/files/run/elidable-opt.flags +++ /dev/null @@ -1 +0,0 @@ --Xelide-below 900 diff --git a/test/files/run/elidable-opt.scala b/test/files/run/elidable-opt.scala index 6a603084b706..b5d7626c6e8b 100644 --- a/test/files/run/elidable-opt.scala +++ b/test/files/run/elidable-opt.scala @@ -1,3 +1,4 @@ +// scalac: -Xelide-below 900 import annotation._ import elidable._ diff --git a/test/files/run/elidable.flags b/test/files/run/elidable.flags deleted file mode 100644 index 4bebebdc41eb..000000000000 --- a/test/files/run/elidable.flags +++ /dev/null @@ -1 +0,0 @@ --Xelide-below WARNING diff --git a/test/files/run/elidable.scala b/test/files/run/elidable.scala index fed1c7b39292..f48379900238 100644 --- a/test/files/run/elidable.scala +++ b/test/files/run/elidable.scala @@ -1,3 +1,4 @@ +// scalac: -Xelide-below WARNING import annotation._ import elidable._ diff --git a/test/files/run/finalvar.flags b/test/files/run/finalvar.flags deleted file mode 100644 index df702ffe7738..000000000000 --- a/test/files/run/finalvar.flags +++ /dev/null @@ -1 +0,0 @@ --Yoverride-vars -opt:l:inline -opt-inline-from:** \ No newline at end of file diff --git a/test/files/run/finalvar.scala b/test/files/run/finalvar.scala index 010813e520a1..d08ae65f23e0 100644 --- a/test/files/run/finalvar.scala +++ b/test/files/run/finalvar.scala @@ -1,3 +1,4 @@ +// scalac: -Yoverride-vars -opt:l:inline -opt-inline-from:** object Final { class X(final var x: Int) { } def f = new X(0).x += 1 @@ -34,4 +35,4 @@ object Test { } class C { var w = 1 ; def ten = this.w = 10 } -class D extends C { override var w = 2 } \ No newline at end of file +class D extends C { override var w = 2 } diff --git a/test/files/run/hk-typevar-unification.flags b/test/files/run/hk-typevar-unification.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/run/hk-typevar-unification.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/run/hk-typevar-unification.scala b/test/files/run/hk-typevar-unification.scala index a8d895f2f948..3d3a5258abe0 100644 --- a/test/files/run/hk-typevar-unification.scala +++ b/test/files/run/hk-typevar-unification.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 import scala.language.higherKinds trait Forall[F[_]] { diff --git a/test/files/run/indy-meth-refs-b.flags b/test/files/run/indy-meth-refs-b.flags deleted file mode 100644 index 4b6111ee1708..000000000000 --- a/test/files/run/indy-meth-refs-b.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-b.scala b/test/files/run/indy-meth-refs-b.scala index 93036e907b63..148d29e1011b 100644 --- a/test/files/run/indy-meth-refs-b.scala +++ b/test/files/run/indy-meth-refs-b.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method-ref object Test { def min0[A](less: (A, A) => Boolean, xs: List[A]): Option[A] = None diff --git a/test/files/run/indy-meth-refs-c.flags b/test/files/run/indy-meth-refs-c.flags deleted file mode 100644 index 4b6111ee1708..000000000000 --- a/test/files/run/indy-meth-refs-c.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-c.scala b/test/files/run/indy-meth-refs-c.scala index d2077b7c2eaf..bce150b77f9b 100644 --- a/test/files/run/indy-meth-refs-c.scala +++ b/test/files/run/indy-meth-refs-c.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method-ref object Test { def main(args: Array[String]): Unit = { val str = "" diff --git a/test/files/run/indy-meth-refs-d.flags b/test/files/run/indy-meth-refs-d.flags deleted file mode 100644 index 4b6111ee1708..000000000000 --- a/test/files/run/indy-meth-refs-d.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-d.scala b/test/files/run/indy-meth-refs-d.scala index 81d7bd779abb..6c99c8c86e71 100644 --- a/test/files/run/indy-meth-refs-d.scala +++ b/test/files/run/indy-meth-refs-d.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method-ref object Test { class Foo { def bar() = () } def main(args: Array[String]): Unit = diff --git a/test/files/run/indy-meth-refs-e.flags b/test/files/run/indy-meth-refs-e.flags deleted file mode 100644 index 4b6111ee1708..000000000000 --- a/test/files/run/indy-meth-refs-e.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-e.scala b/test/files/run/indy-meth-refs-e.scala index 94bd79b12625..64e25457dcd4 100644 --- a/test/files/run/indy-meth-refs-e.scala +++ b/test/files/run/indy-meth-refs-e.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method-ref object Test { def main(args: Array[String]): Unit = { List(Option("a")).map(_.map(_.toUpperCase)) diff --git a/test/files/run/indy-meth-refs-f.flags b/test/files/run/indy-meth-refs-f.flags deleted file mode 100644 index 4b6111ee1708..000000000000 --- a/test/files/run/indy-meth-refs-f.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-f.scala b/test/files/run/indy-meth-refs-f.scala index 1e69936d4d46..90a20b4e445d 100644 --- a/test/files/run/indy-meth-refs-f.scala +++ b/test/files/run/indy-meth-refs-f.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method-ref object Test { def anyA(f: Any => Any) = () def anyB(f: Any => Boolean) = () diff --git a/test/files/run/indy-meth-refs-g.flags b/test/files/run/indy-meth-refs-g.flags deleted file mode 100644 index 4b6111ee1708..000000000000 --- a/test/files/run/indy-meth-refs-g.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-g.scala b/test/files/run/indy-meth-refs-g.scala index b4b82edde559..2d66dad23e0f 100644 --- a/test/files/run/indy-meth-refs-g.scala +++ b/test/files/run/indy-meth-refs-g.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method-ref import java.io.File import scala.collection.mutable diff --git a/test/files/run/indy-meth-refs-h.flags b/test/files/run/indy-meth-refs-h.flags deleted file mode 100644 index 4b6111ee1708..000000000000 --- a/test/files/run/indy-meth-refs-h.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-h.scala b/test/files/run/indy-meth-refs-h.scala index 0e53d4a6b3b6..988eb9da889e 100644 --- a/test/files/run/indy-meth-refs-h.scala +++ b/test/files/run/indy-meth-refs-h.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method-ref trait Entity { def name: String def announce = { diff --git a/test/files/run/indy-meth-refs-i.flags b/test/files/run/indy-meth-refs-i.flags deleted file mode 100644 index 4b6111ee1708..000000000000 --- a/test/files/run/indy-meth-refs-i.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs-i.scala b/test/files/run/indy-meth-refs-i.scala index 21bcb22ff596..25778894d170 100644 --- a/test/files/run/indy-meth-refs-i.scala +++ b/test/files/run/indy-meth-refs-i.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method-ref class C { def foo = 0 } diff --git a/test/files/run/indy-meth-refs.flags b/test/files/run/indy-meth-refs.flags deleted file mode 100644 index 4b6111ee1708..000000000000 --- a/test/files/run/indy-meth-refs.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method-ref diff --git a/test/files/run/indy-meth-refs.scala b/test/files/run/indy-meth-refs.scala index 0cad83bd8cc0..110be78ebc7a 100644 --- a/test/files/run/indy-meth-refs.scala +++ b/test/files/run/indy-meth-refs.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method-ref case object Test { def f0(f: Function0[String]) = () def f1(f: Function1[Any, String]) = () diff --git a/test/files/run/inferred-type-constructors-hou.flags b/test/files/run/inferred-type-constructors-hou.flags deleted file mode 100644 index 41565c7e32bd..000000000000 --- a/test/files/run/inferred-type-constructors-hou.flags +++ /dev/null @@ -1 +0,0 @@ --Ypartial-unification diff --git a/test/files/run/inferred-type-constructors-hou.scala b/test/files/run/inferred-type-constructors-hou.scala index 79a8653f686b..f59df0606490 100644 --- a/test/files/run/inferred-type-constructors-hou.scala +++ b/test/files/run/inferred-type-constructors-hou.scala @@ -1,3 +1,4 @@ +// scalac: -Ypartial-unification package p { trait TCon[+CC[X]] { def fPublic: CC[Int] = ??? diff --git a/test/files/run/interop_typetags_are_manifests.flags b/test/files/run/interop_typetags_are_manifests.flags deleted file mode 100644 index ea7fc37e1af3..000000000000 --- a/test/files/run/interop_typetags_are_manifests.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos:false diff --git a/test/files/run/interop_typetags_are_manifests.scala b/test/files/run/interop_typetags_are_manifests.scala index 6dc543781914..2dc3ff110b42 100644 --- a/test/files/run/interop_typetags_are_manifests.scala +++ b/test/files/run/interop_typetags_are_manifests.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos:false import scala.reflect.runtime.universe._ import scala.reflect.ClassTag import internal._ @@ -10,4 +11,4 @@ object Test extends App { typeTagIsManifest[Int] typeTagIsManifest[String] typeTagIsManifest[Array[Int]] -} \ No newline at end of file +} diff --git a/test/files/run/kmpSliceSearch.flags b/test/files/run/kmpSliceSearch.flags deleted file mode 100644 index ac96850b69b5..000000000000 --- a/test/files/run/kmpSliceSearch.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:inline \ No newline at end of file diff --git a/test/files/run/kmpSliceSearch.scala b/test/files/run/kmpSliceSearch.scala index e72f78bfed0b..7a0bfc67838a 100644 --- a/test/files/run/kmpSliceSearch.scala +++ b/test/files/run/kmpSliceSearch.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:inline object Test { import scala.collection.SeqLike def slowSearch[A](xs: Seq[A], ys: Seq[A], start: Int = 0): Int = { diff --git a/test/files/run/lambda-serialization-meth-ref.flags b/test/files/run/lambda-serialization-meth-ref.flags deleted file mode 100644 index 4b6111ee1708..000000000000 --- a/test/files/run/lambda-serialization-meth-ref.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method-ref diff --git a/test/files/run/lambda-serialization-meth-ref.scala b/test/files/run/lambda-serialization-meth-ref.scala index a81efd465a7e..f5fc228e89ed 100644 --- a/test/files/run/lambda-serialization-meth-ref.scala +++ b/test/files/run/lambda-serialization-meth-ref.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method-ref import java.io.{ByteArrayInputStream, ByteArrayOutputStream} import java.io.{ObjectInputStream, ObjectOutputStream} diff --git a/test/files/run/literals.check b/test/files/run/literals.check index 092340eead8a..dccfec7afc1e 100644 --- a/test/files/run/literals.check +++ b/test/files/run/literals.check @@ -1,12 +1,12 @@ -literals.scala:34: warning: Octal escape literals are deprecated, use \u0061 instead. +literals.scala:35: warning: Octal escape literals are deprecated, use \u0061 instead. check_success("\"\\141\\142\" == \"ab\"", "\141\142", "ab") ^ -literals.scala:34: warning: Octal escape literals are deprecated, use \u0062 instead. +literals.scala:35: warning: Octal escape literals are deprecated, use \u0062 instead. check_success("\"\\141\\142\" == \"ab\"", "\141\142", "ab") ^ -literals.scala:37: warning: Octal escape literals are deprecated, use \u0000 instead. +literals.scala:38: warning: Octal escape literals are deprecated, use \u0000 instead. "\0x61\0x62".getBytes(io.Codec.UTF8.charSet) sameElements Array[Byte](0, 120, 54, 49, 0, 120, 54, 50), ^ -literals.scala:37: warning: Octal escape literals are deprecated, use \u0000 instead. +literals.scala:38: warning: Octal escape literals are deprecated, use \u0000 instead. "\0x61\0x62".getBytes(io.Codec.UTF8.charSet) sameElements Array[Byte](0, 120, 54, 49, 0, 120, 54, 50), ^ diff --git a/test/files/run/literals.flags b/test/files/run/literals.flags deleted file mode 100644 index dcc59ebe32ef..000000000000 --- a/test/files/run/literals.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation diff --git a/test/files/run/literals.scala b/test/files/run/literals.scala index a7962e5cd916..0d9566480b48 100644 --- a/test/files/run/literals.scala +++ b/test/files/run/literals.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation //############################################################################ // Literals //############################################################################ diff --git a/test/files/run/macro-abort-fresh.flags b/test/files/run/macro-abort-fresh.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-abort-fresh.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-abort-fresh/Macros_1.scala b/test/files/run/macro-abort-fresh/Macros_1.scala index 2b03512efb36..91f1dfb9238d 100644 --- a/test/files/run/macro-abort-fresh/Macros_1.scala +++ b/test/files/run/macro-abort-fresh/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -12,4 +13,4 @@ object Impls { object Macros { def foo = macro Impls.impl -} \ No newline at end of file +} diff --git a/test/files/run/macro-abort-fresh/Test_2.scala b/test/files/run/macro-abort-fresh/Test_2.scala index 61f0bdfadcd3..a6b9272e6dc5 100644 --- a/test/files/run/macro-abort-fresh/Test_2.scala +++ b/test/files/run/macro-abort-fresh/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} @@ -5,4 +6,4 @@ object Test extends App { val tree = Select(Ident(TermName("Macros")), TermName("foo")) try cm.mkToolBox().eval(tree) catch { case ex: Throwable => println(ex.getMessage) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-basic-ma-md-mi.flags b/test/files/run/macro-basic-ma-md-mi.flags deleted file mode 100644 index 5e5dd6ce794e..000000000000 --- a/test/files/run/macro-basic-ma-md-mi.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros diff --git a/test/files/run/macro-basic-ma-md-mi/Impls_1.scala b/test/files/run/macro-basic-ma-md-mi/Impls_1.scala index fc75b99ef254..18b78d1deef1 100644 --- a/test/files/run/macro-basic-ma-md-mi/Impls_1.scala +++ b/test/files/run/macro-basic-ma-md-mi/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -18,4 +19,4 @@ object Impls { val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) c.Expr[Int](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-basic-ma-md-mi/Macros_2.scala b/test/files/run/macro-basic-ma-md-mi/Macros_2.scala index 527904374651..9f2fa1e802a8 100644 --- a/test/files/run/macro-basic-ma-md-mi/Macros_2.scala +++ b/test/files/run/macro-basic-ma-md-mi/Macros_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { object Shmacros { def foo(x: Int): Int = macro Impls.foo @@ -7,4 +8,4 @@ object Macros { class Macros { def quux(x: Int): Int = macro Impls.quux -} \ No newline at end of file +} diff --git a/test/files/run/macro-basic-ma-md-mi/Test_3.scala b/test/files/run/macro-basic-ma-md-mi/Test_3.scala index e9a10e20c99b..71bbc55f8e12 100644 --- a/test/files/run/macro-basic-ma-md-mi/Test_3.scala +++ b/test/files/run/macro-basic-ma-md-mi/Test_3.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { import Macros.Shmacros._ println(foo(2) + Macros.bar(2) * new Macros().quux(4)) -} \ No newline at end of file +} diff --git a/test/files/run/macro-basic-ma-mdmi.flags b/test/files/run/macro-basic-ma-mdmi.flags deleted file mode 100644 index 5e5dd6ce794e..000000000000 --- a/test/files/run/macro-basic-ma-mdmi.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros diff --git a/test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala b/test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala index 73a5a971a48b..4f9a195d31d6 100644 --- a/test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala +++ b/test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -29,4 +30,4 @@ object Macros { class Macros { def quux(x: Int): Int = macro Impls.quux -} \ No newline at end of file +} diff --git a/test/files/run/macro-basic-ma-mdmi/Test_2.scala b/test/files/run/macro-basic-ma-mdmi/Test_2.scala index e9a10e20c99b..71bbc55f8e12 100644 --- a/test/files/run/macro-basic-ma-mdmi/Test_2.scala +++ b/test/files/run/macro-basic-ma-mdmi/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { import Macros.Shmacros._ println(foo(2) + Macros.bar(2) * new Macros().quux(4)) -} \ No newline at end of file +} diff --git a/test/files/run/macro-basic-mamd-mi.flags b/test/files/run/macro-basic-mamd-mi.flags deleted file mode 100644 index 5e5dd6ce794e..000000000000 --- a/test/files/run/macro-basic-mamd-mi.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros diff --git a/test/files/run/macro-basic-mamd-mi/Impls_1.scala b/test/files/run/macro-basic-mamd-mi/Impls_1.scala index 0be915c1196e..07ad0479c4d0 100644 --- a/test/files/run/macro-basic-mamd-mi/Impls_1.scala +++ b/test/files/run/macro-basic-mamd-mi/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -16,4 +17,4 @@ object Impls { val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) c.Expr[Int](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-basic-mamd-mi/Macros_Test_2.scala b/test/files/run/macro-basic-mamd-mi/Macros_Test_2.scala index d3746894f0b7..d21a2e0ca772 100644 --- a/test/files/run/macro-basic-mamd-mi/Macros_Test_2.scala +++ b/test/files/run/macro-basic-mamd-mi/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { object Shmacros { def foo(x: Int): Int = macro Impls.foo @@ -12,4 +13,4 @@ class Macros { object Test extends App { import Macros.Shmacros._ println(foo(2) + Macros.bar(2) * new Macros().quux(4)) -} \ No newline at end of file +} diff --git a/test/files/run/macro-bodyexpandstoimpl.flags b/test/files/run/macro-bodyexpandstoimpl.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-bodyexpandstoimpl.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala b/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala index d46af4952dcc..699b183a41ff 100644 --- a/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala +++ b/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.language.experimental.macros import scala.reflect.macros.blackbox.{Context => BlackboxContext} import scala.reflect.macros.whitebox.{Context => WhiteboxContext} @@ -13,4 +14,4 @@ object Impls { global.analyzer.markMacroImplRef(body.asInstanceOf[global.Tree]) c.Expr[Int](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-bodyexpandstoimpl/Macros_Test_2.scala b/test/files/run/macro-bodyexpandstoimpl/Macros_Test_2.scala index 486e1de090db..544550a53790 100644 --- a/test/files/run/macro-bodyexpandstoimpl/Macros_Test_2.scala +++ b/test/files/run/macro-bodyexpandstoimpl/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.language.experimental.macros object Macros { @@ -7,4 +8,4 @@ object Macros { object Test extends App { import Macros._ println(foo(42)) -} \ No newline at end of file +} diff --git a/test/files/run/macro-bundle-toplevel.flags b/test/files/run/macro-bundle-toplevel.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-bundle-toplevel.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-bundle-toplevel/Impls_Macros_1.scala b/test/files/run/macro-bundle-toplevel/Impls_Macros_1.scala index 6fd7be3b2588..33f6b01c2075 100644 --- a/test/files/run/macro-bundle-toplevel/Impls_Macros_1.scala +++ b/test/files/run/macro-bundle-toplevel/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context class Impl(val c: Context) { @@ -22,4 +23,4 @@ package pkg { def mono = macro Impl.mono def poly[T] = macro Impl.poly[T] } -} \ No newline at end of file +} diff --git a/test/files/run/macro-bundle-toplevel/Test_2.scala b/test/files/run/macro-bundle-toplevel/Test_2.scala index 195fb4926212..b3a0c36a50ca 100644 --- a/test/files/run/macro-bundle-toplevel/Test_2.scala +++ b/test/files/run/macro-bundle-toplevel/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { println(Macros.mono) println(Macros.poly[Int]) @@ -5,4 +6,4 @@ object Test extends App { println(pkg.Macros.mono) println(pkg.Macros.poly[Int]) println(new pkg.Impl(???).weird) -} \ No newline at end of file +} diff --git a/test/files/run/macro-def-path-dependent.flags b/test/files/run/macro-def-path-dependent.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-def-path-dependent.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-def-path-dependent/Dummy.scala b/test/files/run/macro-def-path-dependent/Dummy.scala index 7dffc5107d93..8bd441b74e46 100644 --- a/test/files/run/macro-def-path-dependent/Dummy.scala +++ b/test/files/run/macro-def-path-dependent/Dummy.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { println("it works") -} \ No newline at end of file +} diff --git a/test/files/run/macro-def-path-dependent/Test_1.scala b/test/files/run/macro-def-path-dependent/Test_1.scala index ffa41fb9d88e..5b72882bbfe0 100644 --- a/test/files/run/macro-def-path-dependent/Test_1.scala +++ b/test/files/run/macro-def-path-dependent/Test_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros // NOTE: blocked by scala/bug#8049 // package test1 diff --git a/test/files/run/macro-def-path-dependent/Test_2.scala b/test/files/run/macro-def-path-dependent/Test_2.scala index 75a03b54e769..ea4fb917efc5 100644 --- a/test/files/run/macro-def-path-dependent/Test_2.scala +++ b/test/files/run/macro-def-path-dependent/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros package test2 import scala.reflect.macros.blackbox.Context diff --git a/test/files/run/macro-def-path-dependent/Test_3.scala b/test/files/run/macro-def-path-dependent/Test_3.scala index 1a5da8200b2b..cfb3d6c508a1 100644 --- a/test/files/run/macro-def-path-dependent/Test_3.scala +++ b/test/files/run/macro-def-path-dependent/Test_3.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros package test3 import scala.reflect.macros.blackbox.Context diff --git a/test/files/run/macro-def-path-dependent/Test_4.scala b/test/files/run/macro-def-path-dependent/Test_4.scala index 67cb88ee6f7d..349f554b03f2 100644 --- a/test/files/run/macro-def-path-dependent/Test_4.scala +++ b/test/files/run/macro-def-path-dependent/Test_4.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros package test4 import scala.reflect.runtime.universe._ @@ -8,4 +9,4 @@ object Test { def materializeTypeTag[T](u: Universe)(e: T): u.TypeTag[T] = macro materializeTypeTag_impl[T] def materializeTypeTag_impl[T: c.WeakTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ??? -} \ No newline at end of file +} diff --git a/test/files/run/macro-def-path-dependent/Test_5.scala b/test/files/run/macro-def-path-dependent/Test_5.scala index b518ce864c1a..9a2ab153c94a 100644 --- a/test/files/run/macro-def-path-dependent/Test_5.scala +++ b/test/files/run/macro-def-path-dependent/Test_5.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros package test56 import scala.reflect.runtime.universe._ @@ -6,4 +7,4 @@ import scala.reflect.api.Universe object Impls { def materializeTypeTag_impl[T: c.WeakTypeTag](c: Context)(u: c.Expr[Universe])(e: c.Expr[T]): c.Expr[u.value.TypeTag[T]] = ??? -} \ No newline at end of file +} diff --git a/test/files/run/macro-def-path-dependent/Test_6.scala b/test/files/run/macro-def-path-dependent/Test_6.scala index a8b50ce7d2f0..a555b840c796 100644 --- a/test/files/run/macro-def-path-dependent/Test_6.scala +++ b/test/files/run/macro-def-path-dependent/Test_6.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros package test56 import scala.reflect.runtime.universe._ @@ -6,4 +7,4 @@ import scala.reflect.api.Universe object Macros { def materializeTypeTag[T](u: Universe)(e: T): u.TypeTag[T] = macro Impls.materializeTypeTag_impl[T] -} \ No newline at end of file +} diff --git a/test/files/run/macro-duplicate.check b/test/files/run/macro-duplicate.check index 7006b1661162..4d5eb78c0faa 100644 --- a/test/files/run/macro-duplicate.check +++ b/test/files/run/macro-duplicate.check @@ -1,3 +1,3 @@ -Test_2.scala:5: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses +Test_2.scala:6: warning: a pure expression does nothing in statement position; multiline expressions may require enclosing parentheses Macros.foo ^ diff --git a/test/files/run/macro-duplicate.flags b/test/files/run/macro-duplicate.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-duplicate.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-duplicate/Impls_Macros_1.scala b/test/files/run/macro-duplicate/Impls_Macros_1.scala index 84fb2c5b6132..70e73eb03fbb 100644 --- a/test/files/run/macro-duplicate/Impls_Macros_1.scala +++ b/test/files/run/macro-duplicate/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { diff --git a/test/files/run/macro-duplicate/Test_2.scala b/test/files/run/macro-duplicate/Test_2.scala index 6dbd4382d362..6f173f8b03b4 100644 --- a/test/files/run/macro-duplicate/Test_2.scala +++ b/test/files/run/macro-duplicate/Test_2.scala @@ -1,6 +1,7 @@ +// scalac: -language:experimental.macros import scala.concurrent._ import ExecutionContext.Implicits.global object Test extends App { Macros.foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-enclosures.flags b/test/files/run/macro-enclosures.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-enclosures.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-enclosures/Impls_Macros_1.scala b/test/files/run/macro-enclosures/Impls_Macros_1.scala index 564cdfa68f0a..1a6adf90525b 100644 --- a/test/files/run/macro-enclosures/Impls_Macros_1.scala +++ b/test/files/run/macro-enclosures/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { @@ -20,4 +21,4 @@ object Macros { } def foo: Any = macro impl -} \ No newline at end of file +} diff --git a/test/files/run/macro-enclosures/Test_2.scala b/test/files/run/macro-enclosures/Test_2.scala index 779fe5211ea3..b3927e8d3f2d 100644 --- a/test/files/run/macro-enclosures/Test_2.scala +++ b/test/files/run/macro-enclosures/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { test.Test.test } @@ -8,4 +9,4 @@ package test { Macros.foo } } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-implicit-argument.flags b/test/files/run/macro-expand-implicit-argument.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-implicit-argument.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-implicit-argument/Macros_1.scala b/test/files/run/macro-expand-implicit-argument/Macros_1.scala index 465f313ef2cd..0bcf5b503b16 100644 --- a/test/files/run/macro-expand-implicit-argument/Macros_1.scala +++ b/test/files/run/macro-expand-implicit-argument/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import annotation.tailrec import scala.math.{min, max} import scala.{specialized => spec} @@ -56,4 +57,4 @@ object Macros { c.Expr[Array[A]](block) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-implicit-argument/Test_2.scala b/test/files/run/macro-expand-implicit-argument/Test_2.scala index ce8a068fb4b8..e98c4d84a9bf 100644 --- a/test/files/run/macro-expand-implicit-argument/Test_2.scala +++ b/test/files/run/macro-expand-implicit-argument/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { import Macros._ println(array(1, 2, 3).toList) -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-implicit-macro-has-implicit.flags b/test/files/run/macro-expand-implicit-macro-has-implicit.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-implicit-macro-has-implicit.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala b/test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala index 18c97956e4b1..3cbafa9b3537 100644 --- a/test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala +++ b/test/files/run/macro-expand-implicit-macro-has-implicit/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -6,4 +7,4 @@ object Impls { val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(x.tree)) c.Expr[Unit](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala b/test/files/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala index fec914632fe8..faa1175869de 100644 --- a/test/files/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala +++ b/test/files/run/macro-expand-implicit-macro-has-implicit/Macros_Test_2.scala @@ -1,5 +1,6 @@ +// scalac: -language:experimental.macros object Test extends App { implicit val x = 42 def foo(implicit x: Int): Unit = macro Impls.foo foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-implicit-macro-is-implicit.flags b/test/files/run/macro-expand-implicit-macro-is-implicit.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-implicit-macro-is-implicit.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala b/test/files/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala index aeceee5a5b55..01696c2e9359 100644 --- a/test/files/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala +++ b/test/files/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -6,4 +7,4 @@ object Impls { val body = Apply(Ident(definitions.SomeModule), List(Select(x.tree, TermName("toInt")))) c.Expr[Option[Int]](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala b/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala index 22047eeb3670..73b5db248e64 100644 --- a/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala +++ b/test/files/run/macro-expand-implicit-macro-is-implicit/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { import scala.language.implicitConversions implicit def foo(x: String): Option[Int] = macro Impls.foo diff --git a/test/files/run/macro-expand-implicit-macro-is-val.flags b/test/files/run/macro-expand-implicit-macro-is-val.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-implicit-macro-is-val.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-implicit-macro-is-val/Impls_1.scala b/test/files/run/macro-expand-implicit-macro-is-val/Impls_1.scala index fd267d32c44b..e32ece28d2e8 100644 --- a/test/files/run/macro-expand-implicit-macro-is-val/Impls_1.scala +++ b/test/files/run/macro-expand-implicit-macro-is-val/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -6,4 +7,4 @@ object Impls { val body = Literal(Constant(2)) c.Expr[Int](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala b/test/files/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala index 2f21785bae59..45785eac5ac1 100644 --- a/test/files/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala +++ b/test/files/run/macro-expand-implicit-macro-is-val/Macros_Test_2.scala @@ -1,5 +1,6 @@ +// scalac: -language:experimental.macros object Test extends App { implicit def foo: Int = macro Impls.foo def bar(implicit x: Int) = println(x) bar -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-multiple-arglists.flags b/test/files/run/macro-expand-multiple-arglists.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-multiple-arglists.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-multiple-arglists/Impls_1.scala b/test/files/run/macro-expand-multiple-arglists/Impls_1.scala index 9278633c11e3..63221fc044f8 100644 --- a/test/files/run/macro-expand-multiple-arglists/Impls_1.scala +++ b/test/files/run/macro-expand-multiple-arglists/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -7,4 +8,4 @@ object Impls { val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum)) c.Expr[Unit](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-multiple-arglists/Macros_Test_2.scala b/test/files/run/macro-expand-multiple-arglists/Macros_Test_2.scala index 54b959983bf3..13e815799c21 100644 --- a/test/files/run/macro-expand-multiple-arglists/Macros_Test_2.scala +++ b/test/files/run/macro-expand-multiple-arglists/Macros_Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { def foo(x: Int)(y: Int): Unit = macro Impls.foo foo(40)(2) -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-nullary-generic.flags b/test/files/run/macro-expand-nullary-generic.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-nullary-generic.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-nullary-generic/Impls_1.scala b/test/files/run/macro-expand-nullary-generic/Impls_1.scala index 9362d6c17a10..6c203abc4d0e 100644 --- a/test/files/run/macro-expand-nullary-generic/Impls_1.scala +++ b/test/files/run/macro-expand-nullary-generic/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.runtime.universe._ import scala.reflect.macros.blackbox.Context @@ -12,4 +13,4 @@ object Impls { def fooEmpty[T: c.WeakTypeTag](c: Context)() = impl[T](c)("fooEmpty") def barNullary[T: c.WeakTypeTag](c: Context)(x: c.Expr[Int]) = impl[T](c)("barNullary") def barEmpty[T: c.WeakTypeTag](c: Context)(x: c.Expr[Int])() = impl[T](c)("barEmpty") -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-nullary-generic/Macros_Test_2.scala b/test/files/run/macro-expand-nullary-generic/Macros_Test_2.scala index edd90517546d..9d68667cd8fd 100644 --- a/test/files/run/macro-expand-nullary-generic/Macros_Test_2.scala +++ b/test/files/run/macro-expand-nullary-generic/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { def foo1[T]: Unit = macro Impls.fooNullary[T] def foo2[T](): Unit = macro Impls.fooEmpty[T] @@ -12,4 +13,4 @@ object Test extends App { Macros.bar1[Int](42) Macros.bar2[Int](42)() println("kkthxbai") -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-nullary-nongeneric.flags b/test/files/run/macro-expand-nullary-nongeneric.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-nullary-nongeneric.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala b/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala index c8c3d255c416..a2d89f52cad3 100644 --- a/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala +++ b/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.runtime.universe._ import scala.reflect.macros.blackbox.Context @@ -12,4 +13,4 @@ object Impls { def fooEmpty(c: Context)() = impl(c)("fooEmpty") def barNullary(c: Context)(x: c.Expr[Int]) = impl(c)("barNullary") def barEmpty(c: Context)(x: c.Expr[Int])() = impl(c)("barEmpty") -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala b/test/files/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala index 51915dfb27a8..67c430635956 100644 --- a/test/files/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala +++ b/test/files/run/macro-expand-nullary-nongeneric/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { def foo1: Unit = macro Impls.fooNullary def foo2(): Unit = macro Impls.fooEmpty @@ -12,4 +13,4 @@ object Test extends App { Macros.bar1(42) Macros.bar2(42)() println("kkthxbai") -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-overload.flags b/test/files/run/macro-expand-overload.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-overload.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-overload/Impls_1.scala b/test/files/run/macro-expand-overload/Impls_1.scala index ef9d01d4edf6..f478e112b3d0 100644 --- a/test/files/run/macro-expand-overload/Impls_1.scala +++ b/test/files/run/macro-expand-overload/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -12,4 +13,4 @@ object Impls { def fooObjectInt(c: Context)(x: c.Expr[_]) = impl(c)("fooObjectInt", x) def fooClassString(c: Context)(x: c.Expr[_]) = impl(c)("fooClassString", x) def fooClassInt(c: Context)(x: c.Expr[_]) = impl(c)("fooClassInt", x) -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-overload/Macros_Test_2.scala b/test/files/run/macro-expand-overload/Macros_Test_2.scala index 87cff2ecbd37..95871a659100 100644 --- a/test/files/run/macro-expand-overload/Macros_Test_2.scala +++ b/test/files/run/macro-expand-overload/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { def foo(x: String): Unit = macro Impls.fooObjectString def foo(x: Int): Unit = macro Impls.fooObjectInt @@ -17,4 +18,4 @@ object Test extends App { new Macros().foo("42") new Macros().foo(42) new Macros().foo(true) -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-override.flags b/test/files/run/macro-expand-override.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-override.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-override/Impls_1.scala b/test/files/run/macro-expand-override/Impls_1.scala index e6ce18f172e4..3ca09592bc3d 100644 --- a/test/files/run/macro-expand-override/Impls_1.scala +++ b/test/files/run/macro-expand-override/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -12,4 +13,4 @@ object Impls { def fooBInt(c: Context)(x: c.Expr[_]) = impl(c)("fooBInt", x) def fooDInt(c: Context)(x: c.Expr[_]) = impl(c)("fooDInt", x) def fooZString(c: Context)(x: c.Expr[_]) = impl(c)("fooZString", x) -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-override/Macros_Test_2.scala b/test/files/run/macro-expand-override/Macros_Test_2.scala index 160831c54e6b..a1f4109c41e3 100644 --- a/test/files/run/macro-expand-override/Macros_Test_2.scala +++ b/test/files/run/macro-expand-override/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros class B { def foo(x: String): Unit = macro Impls.fooBString def foo(x: Int): Unit = macro Impls.fooBInt @@ -40,4 +41,4 @@ object Test extends App { zb.foo("42") zb.foo(42) zb.foo(true) -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-recursive.flags b/test/files/run/macro-expand-recursive.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-recursive.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-recursive/Impls_1.scala b/test/files/run/macro-expand-recursive/Impls_1.scala index 3def2d2fbe1d..0ddd2116e9e8 100644 --- a/test/files/run/macro-expand-recursive/Impls_1.scala +++ b/test/files/run/macro-expand-recursive/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -12,4 +13,4 @@ object Impls { val body = Select(Ident(TermName("Macros")), TermName("foo")) c.Expr[Unit](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-recursive/Macros_Test_2.scala b/test/files/run/macro-expand-recursive/Macros_Test_2.scala index 5332fdaceefd..e5257383cdea 100644 --- a/test/files/run/macro-expand-recursive/Macros_Test_2.scala +++ b/test/files/run/macro-expand-recursive/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { def foo: Unit = macro Impls.foo def fooFoo: Unit = macro Impls.fooFoo @@ -5,4 +6,4 @@ object Macros { object Test extends App { Macros.fooFoo -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-tparams-bounds.flags b/test/files/run/macro-expand-tparams-bounds.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-tparams-bounds.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-bounds/Impls_1.scala b/test/files/run/macro-expand-tparams-bounds/Impls_1.scala index 95aaa1c3d71b..ca9d935dd9b4 100644 --- a/test/files/run/macro-expand-tparams-bounds/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-bounds/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls1 { diff --git a/test/files/run/macro-expand-tparams-bounds/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-bounds/Macros_Test_2.scala index 6cb2b53465bc..f6779a41eac5 100644 --- a/test/files/run/macro-expand-tparams-bounds/Macros_Test_2.scala +++ b/test/files/run/macro-expand-tparams-bounds/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros1 { def foo[U <: String]: Unit = macro Impls1.foo[U] } diff --git a/test/files/run/macro-expand-tparams-explicit.flags b/test/files/run/macro-expand-tparams-explicit.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-tparams-explicit.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-explicit/Impls_1.scala b/test/files/run/macro-expand-tparams-explicit/Impls_1.scala index c33ac6d1b786..fc16e495fc8b 100644 --- a/test/files/run/macro-expand-tparams-explicit/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-explicit/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.runtime.universe._ import scala.reflect.macros.blackbox.Context @@ -8,4 +9,4 @@ object Impls { val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(U.toString)))) c.Expr[Unit](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-tparams-explicit/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-explicit/Macros_Test_2.scala index 2cf7b19d2a94..4ca1ddf6b117 100644 --- a/test/files/run/macro-expand-tparams-explicit/Macros_Test_2.scala +++ b/test/files/run/macro-expand-tparams-explicit/Macros_Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { def foo[U]: Unit = macro Impls.foo[U] foo[Int] -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-tparams-implicit.flags b/test/files/run/macro-expand-tparams-implicit.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-tparams-implicit.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-implicit/Impls_1.scala b/test/files/run/macro-expand-tparams-implicit/Impls_1.scala index 32cee0d5fbb4..b829208401ba 100644 --- a/test/files/run/macro-expand-tparams-implicit/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-implicit/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.runtime.universe._ import scala.reflect.macros.blackbox.Context @@ -8,4 +9,4 @@ object Impls { val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(U.toString)))) c.Expr[Unit](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-tparams-implicit/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-implicit/Macros_Test_2.scala index 119293193128..74015bd72575 100644 --- a/test/files/run/macro-expand-tparams-implicit/Macros_Test_2.scala +++ b/test/files/run/macro-expand-tparams-implicit/Macros_Test_2.scala @@ -1,5 +1,6 @@ +// scalac: -language:experimental.macros object Test extends App { def foo[U](x: U): Unit = macro Impls.foo[U] foo(42) foo("42") -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-tparams-prefix.flags b/test/files/run/macro-expand-tparams-prefix.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-tparams-prefix.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix/Impls_1.scala index 289f07162b12..9f178dfb32bb 100644 --- a/test/files/run/macro-expand-tparams-prefix/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-prefix/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.runtime.universe._ import scala.reflect.macros.blackbox.Context diff --git a/test/files/run/macro-expand-tparams-prefix/Macros_Test_2.scala b/test/files/run/macro-expand-tparams-prefix/Macros_Test_2.scala index c8f68b4affda..f13513593c83 100644 --- a/test/files/run/macro-expand-tparams-prefix/Macros_Test_2.scala +++ b/test/files/run/macro-expand-tparams-prefix/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros1 { class C[T] { def foo[U](x: U): Unit = macro Impls1.foo[U] @@ -54,4 +55,4 @@ object Test extends App { println("===Macros5===") val outer1 = new Macros5.D[Int] new outer1.C[String] -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-unapply-a.flags b/test/files/run/macro-expand-unapply-a.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-unapply-a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-unapply-a/Impls_Macros_1.scala b/test/files/run/macro-expand-unapply-a/Impls_Macros_1.scala index 64f16c6a8988..34f89ccdc634 100644 --- a/test/files/run/macro-expand-unapply-a/Impls_Macros_1.scala +++ b/test/files/run/macro-expand-unapply-a/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.whitebox.Context object Helper { @@ -12,4 +13,4 @@ object Macros { object UnapplyMacro { def unapplySeq[T](x: List[T]): Option[Seq[T]] = macro impl[T] } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-unapply-a/Test_2.scala b/test/files/run/macro-expand-unapply-a/Test_2.scala index 6169d86b1907..878647900ed4 100644 --- a/test/files/run/macro-expand-unapply-a/Test_2.scala +++ b/test/files/run/macro-expand-unapply-a/Test_2.scala @@ -1,6 +1,7 @@ +// scalac: -language:experimental.macros import Macros._ object Test extends App { List(1, 2) match { case UnapplyMacro(x, y) => println((x, y)) } List(1, 2, 3) match { case UnapplyMacro(x, y, z) => println((x, y, z)) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala index 18af84583a84..7b4520d6673d 100644 --- a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala +++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -6,4 +7,4 @@ object Impls { val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), xs.map(_.tree).toList) c.Expr[Unit](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala index 64aaa07bf287..22baa17ed837 100644 --- a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala +++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { def foo(xs: Int*): Unit = macro Impls.foo } @@ -9,4 +10,4 @@ object Test extends App { val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Typed(Apply(Ident(definitions.ListModule), List(Literal(Constant(1)), Literal(Constant(2)))), Ident(typeNames.WILDCARD_STAR)))) try cm.mkToolBox().eval(tree) catch { case ex: Throwable => println(ex.getMessage) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala index eb067c25a588..d7bca5eb40fb 100644 --- a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala +++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -10,4 +11,4 @@ object Impls { val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), stripped_xs) c.Expr[Unit](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala index 13d7cd5d5dd6..e45b40b14a2f 100644 --- a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala +++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { def foo(xs: Int*): Unit = macro Impls.foo } @@ -5,4 +6,4 @@ object Macros { object Test extends App { val numbers = List(1, 2, 3, 4, 5) Macros.foo(numbers: _*) -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-varargs-explicit-over-varargs.flags b/test/files/run/macro-expand-varargs-explicit-over-varargs.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-varargs-explicit-over-varargs.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala b/test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala index 64ab7de02a32..8178b73a6852 100644 --- a/test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala +++ b/test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -10,4 +11,4 @@ object Impls { val body = Apply(Select(Ident(TermName("Impls")), TermName("myprintln")), xs.map(_.tree).toList) c.Expr[Unit](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala b/test/files/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala index 13d7cd5d5dd6..e45b40b14a2f 100644 --- a/test/files/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala +++ b/test/files/run/macro-expand-varargs-explicit-over-varargs/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { def foo(xs: Int*): Unit = macro Impls.foo } @@ -5,4 +6,4 @@ object Macros { object Test extends App { val numbers = List(1, 2, 3, 4, 5) Macros.foo(numbers: _*) -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-varargs-implicit-over-nonvarargs.flags b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-varargs-implicit-over-nonvarargs.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala index 18af84583a84..7b4520d6673d 100644 --- a/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala +++ b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -6,4 +7,4 @@ object Impls { val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), xs.map(_.tree).toList) c.Expr[Unit](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala index 9ab1be9e2352..18c4802623a6 100644 --- a/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala +++ b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Macros_Test_2.scala @@ -1,7 +1,8 @@ +// scalac: -language:experimental.macros object Macros { def foo(xs: Int*): Unit = macro Impls.foo } object Test extends App { Macros.foo(1, 2, 3, 4, 5) -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-varargs-implicit-over-varargs.flags b/test/files/run/macro-expand-varargs-implicit-over-varargs.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-expand-varargs-implicit-over-varargs.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala b/test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala index 64ab7de02a32..8178b73a6852 100644 --- a/test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala +++ b/test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -10,4 +11,4 @@ object Impls { val body = Apply(Select(Ident(TermName("Impls")), TermName("myprintln")), xs.map(_.tree).toList) c.Expr[Unit](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala b/test/files/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala index 9ab1be9e2352..18c4802623a6 100644 --- a/test/files/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala +++ b/test/files/run/macro-expand-varargs-implicit-over-varargs/Macros_Test_2.scala @@ -1,7 +1,8 @@ +// scalac: -language:experimental.macros object Macros { def foo(xs: Int*): Unit = macro Impls.foo } object Test extends App { Macros.foo(1, 2, 3, 4, 5) -} \ No newline at end of file +} diff --git a/test/files/run/macro-impl-default-params.flags b/test/files/run/macro-impl-default-params.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-impl-default-params.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-impl-default-params/Impls_Macros_1.scala b/test/files/run/macro-impl-default-params/Impls_Macros_1.scala index 9b1d0eed35f1..7d4853871f8c 100644 --- a/test/files/run/macro-impl-default-params/Impls_Macros_1.scala +++ b/test/files/run/macro-impl-default-params/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.runtime.universe._ import scala.reflect.macros.blackbox.Context @@ -17,4 +18,4 @@ object Impls { class Macros[T] { def foo_targs[U](x: Int) = macro Impls.foo_targs[T, U] -} \ No newline at end of file +} diff --git a/test/files/run/macro-impl-default-params/Test_2.scala b/test/files/run/macro-impl-default-params/Test_2.scala index 90e850df2138..e7582c7d5624 100644 --- a/test/files/run/macro-impl-default-params/Test_2.scala +++ b/test/files/run/macro-impl-default-params/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { println("foo_targs:") new Macros[Int]().foo_targs[String](42) -} \ No newline at end of file +} diff --git a/test/files/run/macro-impl-rename-context.flags b/test/files/run/macro-impl-rename-context.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-impl-rename-context.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala b/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala index acc47fcde685..54d6e244693c 100644 --- a/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala +++ b/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { diff --git a/test/files/run/macro-impl-rename-context/Test_2.scala b/test/files/run/macro-impl-rename-context/Test_2.scala index bd9c49354469..b4e65e5003c6 100644 --- a/test/files/run/macro-impl-rename-context/Test_2.scala +++ b/test/files/run/macro-impl-rename-context/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { println("foo") Macros.foo(42) -} \ No newline at end of file +} diff --git a/test/files/run/macro-impl-tparam-only-in-impl.flags b/test/files/run/macro-impl-tparam-only-in-impl.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-impl-tparam-only-in-impl.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-impl-tparam-only-in-impl/Impls_1.scala b/test/files/run/macro-impl-tparam-only-in-impl/Impls_1.scala index 705defb18fe8..4b9f2a9fdfcd 100644 --- a/test/files/run/macro-impl-tparam-only-in-impl/Impls_1.scala +++ b/test/files/run/macro-impl-tparam-only-in-impl/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { diff --git a/test/files/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala b/test/files/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala index 4901e24481f0..819904ae695f 100644 --- a/test/files/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala +++ b/test/files/run/macro-impl-tparam-only-in-impl/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { def foo: Unit = macro Impls.foo[String] } @@ -5,4 +6,4 @@ object Macros { object Test extends App { import Macros._ foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-impl-tparam-typetag-is-optional.flags b/test/files/run/macro-impl-tparam-typetag-is-optional.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-impl-tparam-typetag-is-optional.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala b/test/files/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala index fc72e7a979d0..e44ca638926a 100644 --- a/test/files/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala +++ b/test/files/run/macro-impl-tparam-typetag-is-optional/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -6,4 +7,4 @@ object Impls { val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("don't know U")))) c.Expr[Unit](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala b/test/files/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala index 2cf7b19d2a94..4ca1ddf6b117 100644 --- a/test/files/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala +++ b/test/files/run/macro-impl-tparam-typetag-is-optional/Macros_Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { def foo[U]: Unit = macro Impls.foo[U] foo[Int] -} \ No newline at end of file +} diff --git a/test/files/run/macro-implicit-decorator.flags b/test/files/run/macro-implicit-decorator.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-implicit-decorator.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-implicit-decorator/Macros_1.scala b/test/files/run/macro-implicit-decorator/Macros_1.scala index 659ecae09588..2dad66c3d8ab 100644 --- a/test/files/run/macro-implicit-decorator/Macros_1.scala +++ b/test/files/run/macro-implicit-decorator/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.whitebox trait Derivation[A] diff --git a/test/files/run/macro-implicit-decorator/Test_2.scala b/test/files/run/macro-implicit-decorator/Test_2.scala index bfcb57986997..3066c11d460c 100644 --- a/test/files/run/macro-implicit-decorator/Test_2.scala +++ b/test/files/run/macro-implicit-decorator/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros // https://github.com/scala/bug/issues/10398 class CustomClass diff --git a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype.flags b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala index 603500b597c2..c8b9db5d335d 100644 --- a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala +++ b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -9,4 +10,4 @@ object Impls { object Macros { def foo: Int = macro Impls.foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala index 61f0bdfadcd3..a6b9272e6dc5 100644 --- a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala +++ b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} @@ -5,4 +6,4 @@ object Test extends App { val tree = Select(Ident(TermName("Macros")), TermName("foo")) try cm.mkToolBox().eval(tree) catch { case ex: Throwable => println(ex.getMessage) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-invalidret-nontypeable.flags b/test/files/run/macro-invalidret-nontypeable.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-invalidret-nontypeable.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala b/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala index b6b96117433f..5d0160feb40b 100644 --- a/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala +++ b/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -10,4 +11,4 @@ object Impls { object Macros { def foo = macro Impls.foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-invalidret-nontypeable/Test_2.scala b/test/files/run/macro-invalidret-nontypeable/Test_2.scala index 7cd474ff5264..42a85b303fbb 100644 --- a/test/files/run/macro-invalidret-nontypeable/Test_2.scala +++ b/test/files/run/macro-invalidret-nontypeable/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} @@ -5,4 +6,4 @@ val tree = Select(Ident(TermName("Macros")), TermName("foo")) try cm.mkToolBox().eval(tree) catch { case ex: Throwable => println(ex.getMessage) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-invalidusage-badret.flags b/test/files/run/macro-invalidusage-badret.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-invalidusage-badret.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-invalidusage-badret/Impls_Macros_1.scala b/test/files/run/macro-invalidusage-badret/Impls_Macros_1.scala index 0d4c5755f013..b5b38ff7d34c 100644 --- a/test/files/run/macro-invalidusage-badret/Impls_Macros_1.scala +++ b/test/files/run/macro-invalidusage-badret/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { diff --git a/test/files/run/macro-invalidusage-badret/Test_2.scala b/test/files/run/macro-invalidusage-badret/Test_2.scala index fc71353f5421..c00b33b9c614 100644 --- a/test/files/run/macro-invalidusage-badret/Test_2.scala +++ b/test/files/run/macro-invalidusage-badret/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} diff --git a/test/files/run/macro-invalidusage-partialapplication-with-tparams.flags b/test/files/run/macro-invalidusage-partialapplication-with-tparams.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-invalidusage-partialapplication-with-tparams.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala b/test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala index 8b5c59bde86a..f094a6929fa6 100644 --- a/test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala +++ b/test/files/run/macro-invalidusage-partialapplication-with-tparams/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -10,4 +11,4 @@ object Impls { object Macros { def foo[T](x: T) = macro Impls.foo[T] -} \ No newline at end of file +} diff --git a/test/files/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala b/test/files/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala index 9a34c62e0f13..a6b9272e6dc5 100644 --- a/test/files/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala +++ b/test/files/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} diff --git a/test/files/run/macro-invalidusage-partialapplication.flags b/test/files/run/macro-invalidusage-partialapplication.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-invalidusage-partialapplication.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala b/test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala index 6970b4dd7eef..85ac49e75524 100644 --- a/test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala +++ b/test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -11,4 +12,4 @@ object Impls { object Macros { def foo(x: Int)(y: Int) = macro Impls.foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-invalidusage-partialapplication/Test_2.scala b/test/files/run/macro-invalidusage-partialapplication/Test_2.scala index 75b8c139d41d..d37143b2296c 100644 --- a/test/files/run/macro-invalidusage-partialapplication/Test_2.scala +++ b/test/files/run/macro-invalidusage-partialapplication/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} diff --git a/test/files/run/macro-openmacros.check b/test/files/run/macro-openmacros.check index ba0ae3ff427d..a3d8ead09728 100644 --- a/test/files/run/macro-openmacros.check +++ b/test/files/run/macro-openmacros.check @@ -1,3 +1,3 @@ -List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0)) -List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +1), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0)) -List(MacroContext(foo@source-Test_2.scala,line-2,offset=35 +2), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +1), MacroContext(foo@source-Test_2.scala,line-2,offset=35 +0)) +List(MacroContext(foo@source-Test_2.scala,line-3,offset=93 +0)) +List(MacroContext(foo@source-Test_2.scala,line-3,offset=93 +1), MacroContext(foo@source-Test_2.scala,line-3,offset=93 +0)) +List(MacroContext(foo@source-Test_2.scala,line-3,offset=93 +2), MacroContext(foo@source-Test_2.scala,line-3,offset=93 +1), MacroContext(foo@source-Test_2.scala,line-3,offset=93 +0)) diff --git a/test/files/run/macro-openmacros.flags b/test/files/run/macro-openmacros.flags deleted file mode 100644 index 2433c055a48f..000000000000 --- a/test/files/run/macro-openmacros.flags +++ /dev/null @@ -1,2 +0,0 @@ --Yrangepos:false --language:experimental.macros diff --git a/test/files/run/macro-openmacros/Impls_Macros_1.scala b/test/files/run/macro-openmacros/Impls_Macros_1.scala index b60ca90d9128..9ad4541f818f 100644 --- a/test/files/run/macro-openmacros/Impls_Macros_1.scala +++ b/test/files/run/macro-openmacros/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos:false -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { @@ -22,4 +23,4 @@ object Macros { } def foo = macro impl -} \ No newline at end of file +} diff --git a/test/files/run/macro-openmacros/Test_2.scala b/test/files/run/macro-openmacros/Test_2.scala index 5d19639cddff..090733984c57 100644 --- a/test/files/run/macro-openmacros/Test_2.scala +++ b/test/files/run/macro-openmacros/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos:false -language:experimental.macros object Test extends App { Macros.foo } diff --git a/test/files/run/macro-parse-position.flags b/test/files/run/macro-parse-position.flags deleted file mode 100644 index ea7fc37e1af3..000000000000 --- a/test/files/run/macro-parse-position.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos:false diff --git a/test/files/run/macro-parse-position/Impls_Macros_1.scala b/test/files/run/macro-parse-position/Impls_Macros_1.scala index dd20fd291b57..a17f0cdbfa63 100644 --- a/test/files/run/macro-parse-position/Impls_Macros_1.scala +++ b/test/files/run/macro-parse-position/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos:false import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context @@ -9,4 +10,4 @@ object Macros { c.Expr[String](Literal(Constant(out))) } def foo(): String = macro impl -} \ No newline at end of file +} diff --git a/test/files/run/macro-parse-position/Test_2.scala b/test/files/run/macro-parse-position/Test_2.scala index cff569bd81b1..db0bac2510ff 100644 --- a/test/files/run/macro-parse-position/Test_2.scala +++ b/test/files/run/macro-parse-position/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos:false object Test extends App { println(Macros.foo) } diff --git a/test/files/run/macro-quasiinvalidbody-c.flags b/test/files/run/macro-quasiinvalidbody-c.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-quasiinvalidbody-c.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala b/test/files/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala index df189b70d3ec..f80d2bbfe738 100644 --- a/test/files/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala +++ b/test/files/run/macro-quasiinvalidbody-c/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { @@ -6,4 +7,4 @@ object Macros { } def foo(x: Any) = macro Impls.foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-quasiinvalidbody-c/Test_2.scala b/test/files/run/macro-quasiinvalidbody-c/Test_2.scala index dec29aa8575f..544c0334504c 100644 --- a/test/files/run/macro-quasiinvalidbody-c/Test_2.scala +++ b/test/files/run/macro-quasiinvalidbody-c/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { import Macros._ println(foo(42)) -} \ No newline at end of file +} diff --git a/test/files/run/macro-range.flags b/test/files/run/macro-range.flags deleted file mode 100644 index 5e5dd6ce794e..000000000000 --- a/test/files/run/macro-range.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros diff --git a/test/files/run/macro-range/Common_1.scala b/test/files/run/macro-range/Common_1.scala index 35d2efd76df0..fe58cb54e86e 100644 --- a/test/files/run/macro-range/Common_1.scala +++ b/test/files/run/macro-range/Common_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context abstract class RangeDefault { diff --git a/test/files/run/macro-range/Expansion_Impossible_2.scala b/test/files/run/macro-range/Expansion_Impossible_2.scala index 242e83a61a62..c2d32cedb615 100644 --- a/test/files/run/macro-range/Expansion_Impossible_2.scala +++ b/test/files/run/macro-range/Expansion_Impossible_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -50,4 +51,4 @@ class Range(val from: Int, val to: Int) extends RangeDefault { object Test extends App { new Range(1, 10) foreach println -} \ No newline at end of file +} diff --git a/test/files/run/macro-range/Expansion_Possible_3.scala b/test/files/run/macro-range/Expansion_Possible_3.scala index e7ecbcc3627e..f27e80a7caf2 100644 --- a/test/files/run/macro-range/Expansion_Possible_3.scala +++ b/test/files/run/macro-range/Expansion_Possible_3.scala @@ -1,7 +1,8 @@ +// scalac: -language:experimental.macros class Range(val from: Int, val to: Int) extends RangeDefault { override def foreach(f: Int => Unit): Unit = macro Impls.foreach } object Test extends App { new Range(1, 10) foreach println -} \ No newline at end of file +} diff --git a/test/files/run/macro-rangepos-args.check b/test/files/run/macro-rangepos-args.check index d779505c66c1..98dab80fb76d 100644 --- a/test/files/run/macro-rangepos-args.check +++ b/test/files/run/macro-rangepos-args.check @@ -1 +1 @@ -Line: 3. Width: 5. +Line: 4. Width: 5. diff --git a/test/files/run/macro-rangepos-args.flags b/test/files/run/macro-rangepos-args.flags deleted file mode 100644 index fcf951d90723..000000000000 --- a/test/files/run/macro-rangepos-args.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos \ No newline at end of file diff --git a/test/files/run/macro-rangepos-args/Macros_1.scala b/test/files/run/macro-rangepos-args/Macros_1.scala index 97b938613c5d..41a88375e761 100644 --- a/test/files/run/macro-rangepos-args/Macros_1.scala +++ b/test/files/run/macro-rangepos-args/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context diff --git a/test/files/run/macro-rangepos-args/Test_2.scala b/test/files/run/macro-rangepos-args/Test_2.scala index 8c770e901075..9772030ef755 100644 --- a/test/files/run/macro-rangepos-args/Test_2.scala +++ b/test/files/run/macro-rangepos-args/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -Yrangepos object Test extends App { val x = 2 println(Macros.pos(x + 2)) -} \ No newline at end of file +} diff --git a/test/files/run/macro-rangepos-subpatterns.flags b/test/files/run/macro-rangepos-subpatterns.flags deleted file mode 100644 index fcf951d90723..000000000000 --- a/test/files/run/macro-rangepos-subpatterns.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos \ No newline at end of file diff --git a/test/files/run/macro-rangepos-subpatterns/Macros_1.scala b/test/files/run/macro-rangepos-subpatterns/Macros_1.scala index 0f30862347b6..9f0b7a5dc537 100644 --- a/test/files/run/macro-rangepos-subpatterns/Macros_1.scala +++ b/test/files/run/macro-rangepos-subpatterns/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos import scala.reflect.macros.whitebox.Context import language.experimental.macros diff --git a/test/files/run/macro-rangepos-subpatterns/Test_2.scala b/test/files/run/macro-rangepos-subpatterns/Test_2.scala index 7b076e663239..df152c4d2b41 100644 --- a/test/files/run/macro-rangepos-subpatterns/Test_2.scala +++ b/test/files/run/macro-rangepos-subpatterns/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos object Test extends App { 42 match { case Extractor(a) => println(a) diff --git a/test/files/run/macro-reflective-ma-normal-mdmi.flags b/test/files/run/macro-reflective-ma-normal-mdmi.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-reflective-ma-normal-mdmi.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala b/test/files/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala index e964da21060a..349594c4ed37 100644 --- a/test/files/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala +++ b/test/files/run/macro-reflective-ma-normal-mdmi/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -10,4 +11,4 @@ object Impls { object Macros { def foo(x: Int) = macro Impls.foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala b/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala index 267d1bc7b0ed..e5616c0d7f73 100644 --- a/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala +++ b/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} diff --git a/test/files/run/macro-reify-basic.flags b/test/files/run/macro-reify-basic.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-reify-basic.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-reify-basic/Macros_1.scala b/test/files/run/macro-reify-basic/Macros_1.scala index 1cf2a8a40661..9f91dc1379ef 100644 --- a/test/files/run/macro-reify-basic/Macros_1.scala +++ b/test/files/run/macro-reify-basic/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { @@ -8,4 +9,4 @@ object Macros { println("hello " + s.splice) } } -} \ No newline at end of file +} diff --git a/test/files/run/macro-reify-basic/Test_2.scala b/test/files/run/macro-reify-basic/Test_2.scala index 0a762f7ad7b8..ce2bab33416e 100644 --- a/test/files/run/macro-reify-basic/Test_2.scala +++ b/test/files/run/macro-reify-basic/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { Macros.foo("world") -} \ No newline at end of file +} diff --git a/test/files/run/macro-reify-freevars.check b/test/files/run/macro-reify-freevars.check index f618e307b267..054c919ddc33 100644 --- a/test/files/run/macro-reify-freevars.check +++ b/test/files/run/macro-reify-freevars.check @@ -1,3 +1,3 @@ reflective compilation has failed: -Macro expansion contains free term variable code defined by map in Macros_1.scala:9:9. Have you forgotten to use splice when splicing this variable into a reifee? If you have troubles tracking free term variables, consider using -Xlog-free-terms +Macro expansion contains free term variable code defined by map in Macros_1.scala:10:9. Have you forgotten to use splice when splicing this variable into a reifee? If you have troubles tracking free term variables, consider using -Xlog-free-terms diff --git a/test/files/run/macro-reify-freevars.flags b/test/files/run/macro-reify-freevars.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-reify-freevars.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-reify-freevars/Macros_1.scala b/test/files/run/macro-reify-freevars/Macros_1.scala index 912f602c6c97..789033d74762 100644 --- a/test/files/run/macro-reify-freevars/Macros_1.scala +++ b/test/files/run/macro-reify-freevars/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros package scala.collection.slick object QueryableMacros{ @@ -17,4 +18,4 @@ class Queryable[T]{ } object Queryable{ def factory[S]( projection:reflect.runtime.universe.Tree ) : Queryable[S] = null -} \ No newline at end of file +} diff --git a/test/files/run/macro-reify-freevars/Test_2.scala b/test/files/run/macro-reify-freevars/Test_2.scala index c2d0118e1735..9201d9d3a6c0 100644 --- a/test/files/run/macro-reify-freevars/Test_2.scala +++ b/test/files/run/macro-reify-freevars/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} @@ -8,4 +9,4 @@ object Test extends App { val tree = Apply(Select(q, TermName("map")), List(fn)) try cm.mkToolBox().eval(tree) catch { case ex: Throwable => println(ex.getMessage) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-reify-ref-to-packageless.flags b/test/files/run/macro-reify-ref-to-packageless.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-reify-ref-to-packageless.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-reify-ref-to-packageless/Impls_1.scala b/test/files/run/macro-reify-ref-to-packageless/Impls_1.scala index 38ec6f022e1d..cab3efc75538 100644 --- a/test/files/run/macro-reify-ref-to-packageless/Impls_1.scala +++ b/test/files/run/macro-reify-ref-to-packageless/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { diff --git a/test/files/run/macro-reify-ref-to-packageless/Test_2.scala b/test/files/run/macro-reify-ref-to-packageless/Test_2.scala index c167b160be55..ab4f7702eaf2 100644 --- a/test/files/run/macro-reify-ref-to-packageless/Test_2.scala +++ b/test/files/run/macro-reify-ref-to-packageless/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { def foo: Int = macro Impls.foo println(foo) -} \ No newline at end of file +} diff --git a/test/files/run/macro-reify-splice-outside-reify.flags b/test/files/run/macro-reify-splice-outside-reify.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-reify-splice-outside-reify.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala b/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala index f038d8714f1e..82b29a3817c0 100644 --- a/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala +++ b/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { diff --git a/test/files/run/macro-reify-splice-outside-reify/Test_2.scala b/test/files/run/macro-reify-splice-outside-reify/Test_2.scala index dbc17e7c158a..7cf7a5de37e6 100644 --- a/test/files/run/macro-reify-splice-outside-reify/Test_2.scala +++ b/test/files/run/macro-reify-splice-outside-reify/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} diff --git a/test/files/run/macro-reify-staticXXX.flags b/test/files/run/macro-reify-staticXXX.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-reify-staticXXX.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-reify-staticXXX/Macros_1.scala b/test/files/run/macro-reify-staticXXX/Macros_1.scala index 2993218bb4b5..12a5d8714b14 100644 --- a/test/files/run/macro-reify-staticXXX/Macros_1.scala +++ b/test/files/run/macro-reify-staticXXX/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object B { override def toString = "object" } diff --git a/test/files/run/macro-reify-staticXXX/Test_2.scala b/test/files/run/macro-reify-staticXXX/Test_2.scala index 6e8cc360804c..332f954e5b2e 100644 --- a/test/files/run/macro-reify-staticXXX/Test_2.scala +++ b/test/files/run/macro-reify-staticXXX/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { packageless.test packageful.Test.test diff --git a/test/files/run/macro-reify-tagful-a.flags b/test/files/run/macro-reify-tagful-a.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-reify-tagful-a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-reify-tagful-a/Macros_1.scala b/test/files/run/macro-reify-tagful-a/Macros_1.scala index 6f061fd26a37..8c4c253db438 100644 --- a/test/files/run/macro-reify-tagful-a/Macros_1.scala +++ b/test/files/run/macro-reify-tagful-a/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.runtime.universe._ import scala.reflect.macros.blackbox.Context @@ -9,4 +10,4 @@ object Macros { List(s.splice) } } -} \ No newline at end of file +} diff --git a/test/files/run/macro-reify-tagful-a/Test_2.scala b/test/files/run/macro-reify-tagful-a/Test_2.scala index 4d2716634155..e1b0f8456b19 100644 --- a/test/files/run/macro-reify-tagful-a/Test_2.scala +++ b/test/files/run/macro-reify-tagful-a/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { val list: List[String] = Macros.foo("hello world") println(list) -} \ No newline at end of file +} diff --git a/test/files/run/macro-reify-tagless-a.check b/test/files/run/macro-reify-tagless-a.check index d160e8043ca1..20f3eba7b9a5 100644 --- a/test/files/run/macro-reify-tagless-a.check +++ b/test/files/run/macro-reify-tagless-a.check @@ -1,3 +1,3 @@ reflective compilation has failed: -Macro expansion contains free type variable T defined by foo in Impls_Macros_1.scala:7:13. Have you forgotten to use c.WeakTypeTag annotation for this type parameter? If you have troubles tracking free type variables, consider using -Xlog-free-types +Macro expansion contains free type variable T defined by foo in Impls_Macros_1.scala:8:13. Have you forgotten to use c.WeakTypeTag annotation for this type parameter? If you have troubles tracking free type variables, consider using -Xlog-free-types diff --git a/test/files/run/macro-reify-tagless-a.flags b/test/files/run/macro-reify-tagless-a.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-reify-tagless-a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-reify-tagless-a/Impls_Macros_1.scala b/test/files/run/macro-reify-tagless-a/Impls_Macros_1.scala index faac3e3a3197..d4150250114a 100644 --- a/test/files/run/macro-reify-tagless-a/Impls_Macros_1.scala +++ b/test/files/run/macro-reify-tagless-a/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { @@ -8,4 +9,4 @@ object Macros { List[T](s.splice) } } -} \ No newline at end of file +} diff --git a/test/files/run/macro-reify-tagless-a/Test_2.scala b/test/files/run/macro-reify-tagless-a/Test_2.scala index afb418a7550e..4e6b14553516 100644 --- a/test/files/run/macro-reify-tagless-a/Test_2.scala +++ b/test/files/run/macro-reify-tagless-a/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { //val list: List[String] = Macros.foo("hello world") //println(list) diff --git a/test/files/run/macro-reify-type.flags b/test/files/run/macro-reify-type.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-reify-type.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-reify-type/Macros_1.scala b/test/files/run/macro-reify-type/Macros_1.scala index c38cf8aa524d..2f8dd2346b33 100644 --- a/test/files/run/macro-reify-type/Macros_1.scala +++ b/test/files/run/macro-reify-type/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context import scala.reflect.runtime.{universe => ru} diff --git a/test/files/run/macro-reify-type/Test_2.scala b/test/files/run/macro-reify-type/Test_2.scala index 8ec60e9f6195..04010423bf8f 100644 --- a/test/files/run/macro-reify-type/Test_2.scala +++ b/test/files/run/macro-reify-type/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import StaticReflect._ object Test extends App { @@ -18,4 +19,4 @@ object Test extends App { // PolyType(List(symdef$B2, symdef$That2), MethodType(List(symdef$f2), MethodType(List(symdef$bf2), TypeRef(NoPrefix, symdef$That2, List())))) //} //println(tpe) -} \ No newline at end of file +} diff --git a/test/files/run/macro-reify-unreify.flags b/test/files/run/macro-reify-unreify.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-reify-unreify.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-reify-unreify/Macros_1.scala b/test/files/run/macro-reify-unreify/Macros_1.scala index d92dfa3e24a7..0005bf378549 100644 --- a/test/files/run/macro-reify-unreify/Macros_1.scala +++ b/test/files/run/macro-reify-unreify/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { @@ -17,4 +18,4 @@ object Macros { } } } -} \ No newline at end of file +} diff --git a/test/files/run/macro-reify-unreify/Test_2.scala b/test/files/run/macro-reify-unreify/Test_2.scala index 0a762f7ad7b8..ce2bab33416e 100644 --- a/test/files/run/macro-reify-unreify/Test_2.scala +++ b/test/files/run/macro-reify-unreify/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { Macros.foo("world") -} \ No newline at end of file +} diff --git a/test/files/run/macro-settings.flags b/test/files/run/macro-settings.flags deleted file mode 100644 index 15479e30b8bd..000000000000 --- a/test/files/run/macro-settings.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros -Xmacro-settings:hello=1 \ No newline at end of file diff --git a/test/files/run/macro-settings/Impls_Macros_1.scala b/test/files/run/macro-settings/Impls_Macros_1.scala index 851a987206c0..094d09706d6d 100644 --- a/test/files/run/macro-settings/Impls_Macros_1.scala +++ b/test/files/run/macro-settings/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros -Xmacro-settings:hello=1 import scala.reflect.macros.blackbox.Context object Impls { @@ -11,4 +12,4 @@ object Impls { object Macros { def foo = macro Impls.impl -} \ No newline at end of file +} diff --git a/test/files/run/macro-settings/Test_2.scala b/test/files/run/macro-settings/Test_2.scala index acfddae94215..8fb9520b650b 100644 --- a/test/files/run/macro-settings/Test_2.scala +++ b/test/files/run/macro-settings/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros -Xmacro-settings:hello=1 object Test extends App { Macros.foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-sip19-revised.check b/test/files/run/macro-sip19-revised.check index 86c3d819b038..ade06c8d9c98 100644 --- a/test/files/run/macro-sip19-revised.check +++ b/test/files/run/macro-sip19-revised.check @@ -1,5 +1,5 @@ -hey, i've been called from SourceLocation1(null,Test_2.scala,11,251) -hey, i've been called from SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222) -hey, i've been called from SourceLocation1(SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222),Test_2.scala,8,222) -hey, i've been called from SourceLocation1(SourceLocation1(SourceLocation1(SourceLocation1(null,Test_2.scala,11,251),Test_2.scala,8,222),Test_2.scala,8,222),Test_2.scala,6,180) +hey, i've been called from SourceLocation1(null,Test_2.scala,12,292) +hey, i've been called from SourceLocation1(SourceLocation1(null,Test_2.scala,12,292),Test_2.scala,9,263) +hey, i've been called from SourceLocation1(SourceLocation1(SourceLocation1(null,Test_2.scala,12,292),Test_2.scala,9,263),Test_2.scala,9,263) +hey, i've been called from SourceLocation1(SourceLocation1(SourceLocation1(SourceLocation1(null,Test_2.scala,12,292),Test_2.scala,9,263),Test_2.scala,9,263),Test_2.scala,7,221) 2 diff --git a/test/files/run/macro-sip19-revised.flags b/test/files/run/macro-sip19-revised.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-sip19-revised.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-sip19-revised/Impls_Macros_1.scala b/test/files/run/macro-sip19-revised/Impls_Macros_1.scala index 0d8af43f3a7e..d1435814e1e8 100644 --- a/test/files/run/macro-sip19-revised/Impls_Macros_1.scala +++ b/test/files/run/macro-sip19-revised/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.whitebox.Context object Macros { diff --git a/test/files/run/macro-sip19-revised/Test_2.scala b/test/files/run/macro-sip19-revised/Test_2.scala index d9a4d7d4fc61..f5d73677503e 100644 --- a/test/files/run/macro-sip19-revised/Test_2.scala +++ b/test/files/run/macro-sip19-revised/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import Macros._ object Test extends App { diff --git a/test/files/run/macro-sip19.check b/test/files/run/macro-sip19.check index 07cfd8c1e1e3..075b688c81a6 100644 --- a/test/files/run/macro-sip19.check +++ b/test/files/run/macro-sip19.check @@ -1,5 +1,5 @@ -hey, i've been called from SourceLocation(Test_2.scala,15,366) -hey, i've been called from SourceLocation(Test_2.scala,11,331) -hey, i've been called from SourceLocation(Test_2.scala,11,331) -hey, i've been called from SourceLocation(Test_2.scala,9,285) +hey, i've been called from SourceLocation(Test_2.scala,16,407) +hey, i've been called from SourceLocation(Test_2.scala,12,372) +hey, i've been called from SourceLocation(Test_2.scala,12,372) +hey, i've been called from SourceLocation(Test_2.scala,10,326) 2 diff --git a/test/files/run/macro-sip19.flags b/test/files/run/macro-sip19.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-sip19.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-sip19/Impls_Macros_1.scala b/test/files/run/macro-sip19/Impls_Macros_1.scala index f66ab71479b8..e22ed06d1412 100644 --- a/test/files/run/macro-sip19/Impls_Macros_1.scala +++ b/test/files/run/macro-sip19/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.whitebox.Context object Macros { @@ -23,4 +24,4 @@ case class SourceLocation( /** The character offset */ val charOffset: Int -) \ No newline at end of file +) diff --git a/test/files/run/macro-sip19/Test_2.scala b/test/files/run/macro-sip19/Test_2.scala index 32326e635203..8225bf393516 100644 --- a/test/files/run/macro-sip19/Test_2.scala +++ b/test/files/run/macro-sip19/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import Macros._ object Test extends App { diff --git a/test/files/run/macro-term-declared-in-annotation.flags b/test/files/run/macro-term-declared-in-annotation.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-annotation.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-annotation/Impls_1.scala b/test/files/run/macro-term-declared-in-annotation/Impls_1.scala index c4bcfbc1ba45..6c27be7e13ac 100644 --- a/test/files/run/macro-term-declared-in-annotation/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-annotation/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -8,4 +9,4 @@ object Impls { val body = Block(List(printPrefix), Literal(Constant("this is deprecated"))) c.Expr[String](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-annotation/Macros_2.scala b/test/files/run/macro-term-declared-in-annotation/Macros_2.scala index f1523346ca24..c42cc5bad8f4 100644 --- a/test/files/run/macro-term-declared-in-annotation/Macros_2.scala +++ b/test/files/run/macro-term-declared-in-annotation/Macros_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros class foo(val bar: String) extends annotation.StaticAnnotation object Api { @@ -5,4 +6,4 @@ object Api { // otherwise, we get bitten by https://github.com/scala/bug/issues/5544 @foo({def fooInAnn = macro Impls.foo; fooInAnn}) def foo = println("it works") -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-annotation/Test_3.scala b/test/files/run/macro-term-declared-in-annotation/Test_3.scala index 866487f02872..265d69a79bd3 100644 --- a/test/files/run/macro-term-declared-in-annotation/Test_3.scala +++ b/test/files/run/macro-term-declared-in-annotation/Test_3.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { Api.foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-anonymous.flags b/test/files/run/macro-term-declared-in-anonymous.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-anonymous.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-anonymous/Impls_1.scala b/test/files/run/macro-term-declared-in-anonymous/Impls_1.scala index c43f5f3f535b..8815878212dc 100644 --- a/test/files/run/macro-term-declared-in-anonymous/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-anonymous/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -8,4 +9,4 @@ object Impls { 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/files/run/macro-term-declared-in-anonymous/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-anonymous/Macros_Test_2.scala index 5039dffd5fed..d16b78e7fe76 100644 --- a/test/files/run/macro-term-declared-in-anonymous/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-anonymous/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.language.reflectiveCalls object Test extends App { diff --git a/test/files/run/macro-term-declared-in-block.flags b/test/files/run/macro-term-declared-in-block.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-block.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-block/Impls_1.scala b/test/files/run/macro-term-declared-in-block/Impls_1.scala index c43f5f3f535b..8815878212dc 100644 --- a/test/files/run/macro-term-declared-in-block/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-block/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -8,4 +9,4 @@ object Impls { 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/files/run/macro-term-declared-in-block/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-block/Macros_Test_2.scala index 80bfc44beee3..b2fb5e41838d 100644 --- a/test/files/run/macro-term-declared-in-block/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-block/Macros_Test_2.scala @@ -1,6 +1,7 @@ +// scalac: -language:experimental.macros object Test extends App { { def foo: Unit = macro Impls.foo foo } -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-class-class.flags b/test/files/run/macro-term-declared-in-class-class.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-class-class.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-class-class/Impls_1.scala b/test/files/run/macro-term-declared-in-class-class/Impls_1.scala index c43f5f3f535b..8815878212dc 100644 --- a/test/files/run/macro-term-declared-in-class-class/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-class-class/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -8,4 +9,4 @@ object Impls { 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/files/run/macro-term-declared-in-class-class/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-class-class/Macros_Test_2.scala index d6b1f9fab129..33eae20e8122 100644 --- a/test/files/run/macro-term-declared-in-class-class/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-class-class/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros class Macros { class Macros { def foo: Unit = macro Impls.foo @@ -7,4 +8,4 @@ class Macros { object Test extends App { val outer = new Macros() new outer.Macros().foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-class-object.flags b/test/files/run/macro-term-declared-in-class-object.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-class-object.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-class-object/Impls_1.scala b/test/files/run/macro-term-declared-in-class-object/Impls_1.scala index c43f5f3f535b..8815878212dc 100644 --- a/test/files/run/macro-term-declared-in-class-object/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-class-object/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -8,4 +9,4 @@ object Impls { 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/files/run/macro-term-declared-in-class-object/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-class-object/Macros_Test_2.scala index 957f666bb0ef..b043bfd4f16d 100644 --- a/test/files/run/macro-term-declared-in-class-object/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-class-object/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros class Macros { object Macros { def foo: Unit = macro Impls.foo @@ -7,4 +8,4 @@ class Macros { object Test extends App { val outer = new Macros() outer.Macros.foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-class.flags b/test/files/run/macro-term-declared-in-class.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-class.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-class/Impls_1.scala b/test/files/run/macro-term-declared-in-class/Impls_1.scala index c43f5f3f535b..8815878212dc 100644 --- a/test/files/run/macro-term-declared-in-class/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-class/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -8,4 +9,4 @@ object Impls { 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/files/run/macro-term-declared-in-class/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-class/Macros_Test_2.scala index 5898d94dc1f5..0c8e75763692 100644 --- a/test/files/run/macro-term-declared-in-class/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-class/Macros_Test_2.scala @@ -1,7 +1,8 @@ +// scalac: -language:experimental.macros class Macros { def foo: Unit = macro Impls.foo } object Test extends App { new Macros().foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-default-param.flags b/test/files/run/macro-term-declared-in-default-param.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-default-param.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-default-param/Impls_1.scala b/test/files/run/macro-term-declared-in-default-param/Impls_1.scala index ef0f1361395e..f51d57630cbd 100644 --- a/test/files/run/macro-term-declared-in-default-param/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-default-param/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -8,4 +9,4 @@ object Impls { val body = Block(List(printPrefix), Literal(Constant("it works"))) c.Expr[String](body) } -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-default-param/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-default-param/Macros_Test_2.scala index 16bd95b1e612..8cd831e8e548 100644 --- a/test/files/run/macro-term-declared-in-default-param/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-default-param/Macros_Test_2.scala @@ -1,7 +1,8 @@ +// scalac: -language:experimental.macros object Test extends App { def foo(bar: String = { def foo: String = macro Impls.foo; foo }) = println(bar) foo() foo("it works") foo() -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-implicit-class.flags b/test/files/run/macro-term-declared-in-implicit-class.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-implicit-class.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala b/test/files/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala index ef00f6ff322d..cd874131f540 100644 --- a/test/files/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala +++ b/test/files/run/macro-term-declared-in-implicit-class/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -16,4 +17,4 @@ object Macros { class Foo(val x: String) { def toOptionOfInt = macro Impls.toOptionOfInt } -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-implicit-class/Test_2.scala b/test/files/run/macro-term-declared-in-implicit-class/Test_2.scala index d0bc9cc38c22..1fe1c1ff431d 100644 --- a/test/files/run/macro-term-declared-in-implicit-class/Test_2.scala +++ b/test/files/run/macro-term-declared-in-implicit-class/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { import Macros._ println("2".toOptionOfInt) -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-method.flags b/test/files/run/macro-term-declared-in-method.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-method.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-method/Impls_1.scala b/test/files/run/macro-term-declared-in-method/Impls_1.scala index c43f5f3f535b..8815878212dc 100644 --- a/test/files/run/macro-term-declared-in-method/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-method/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -8,4 +9,4 @@ object Impls { 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/files/run/macro-term-declared-in-method/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-method/Macros_Test_2.scala index 523989df131d..59a8d237c28f 100644 --- a/test/files/run/macro-term-declared-in-method/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-method/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Test extends App { def bar() = { def foo: Unit = macro Impls.foo @@ -5,4 +6,4 @@ object Test extends App { } bar() -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-object-class.flags b/test/files/run/macro-term-declared-in-object-class.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-object-class.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-object-class/Impls_1.scala b/test/files/run/macro-term-declared-in-object-class/Impls_1.scala index c43f5f3f535b..8815878212dc 100644 --- a/test/files/run/macro-term-declared-in-object-class/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-object-class/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -8,4 +9,4 @@ object Impls { 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/files/run/macro-term-declared-in-object-class/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-object-class/Macros_Test_2.scala index fe9dbef25547..2d10ed62b84e 100644 --- a/test/files/run/macro-term-declared-in-object-class/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-object-class/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { class Macros { def foo: Unit = macro Impls.foo @@ -7,4 +8,4 @@ object Macros { object Test extends App { val outer = Macros new outer.Macros().foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-object-object.flags b/test/files/run/macro-term-declared-in-object-object.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-object-object.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-object-object/Impls_1.scala b/test/files/run/macro-term-declared-in-object-object/Impls_1.scala index c43f5f3f535b..8815878212dc 100644 --- a/test/files/run/macro-term-declared-in-object-object/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-object-object/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -8,4 +9,4 @@ object Impls { 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/files/run/macro-term-declared-in-object-object/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-object-object/Macros_Test_2.scala index 4ba755181882..66d3ba6a66f9 100644 --- a/test/files/run/macro-term-declared-in-object-object/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-object-object/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros object Macros { object Macros { def foo: Unit = macro Impls.foo @@ -7,4 +8,4 @@ object Macros { object Test extends App { val outer = Macros outer.Macros.foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-object.flags b/test/files/run/macro-term-declared-in-object.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-object.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-object/Impls_1.scala b/test/files/run/macro-term-declared-in-object/Impls_1.scala index c43f5f3f535b..8815878212dc 100644 --- a/test/files/run/macro-term-declared-in-object/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-object/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -8,4 +9,4 @@ object Impls { 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/files/run/macro-term-declared-in-object/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-object/Macros_Test_2.scala index 9ebf5d7dba26..13b966031524 100644 --- a/test/files/run/macro-term-declared-in-object/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-object/Macros_Test_2.scala @@ -1,7 +1,8 @@ +// scalac: -language:experimental.macros object Macros { def foo: Unit = macro Impls.foo } object Test extends App { Macros.foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-package-object.flags b/test/files/run/macro-term-declared-in-package-object.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-package-object.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-package-object/Impls_1.scala b/test/files/run/macro-term-declared-in-package-object/Impls_1.scala index c43f5f3f535b..8815878212dc 100644 --- a/test/files/run/macro-term-declared-in-package-object/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-package-object/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -8,4 +9,4 @@ object Impls { 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/files/run/macro-term-declared-in-package-object/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-package-object/Macros_Test_2.scala index 1f378b8bfd8d..1ea509867ca6 100644 --- a/test/files/run/macro-term-declared-in-package-object/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-package-object/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros package object Macros { def foo: Unit = macro Impls.foo } @@ -5,4 +6,4 @@ package object Macros { object Test extends App { import Macros._ foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-term-declared-in-refinement.flags b/test/files/run/macro-term-declared-in-refinement.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-refinement.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-refinement/Impls_1.scala b/test/files/run/macro-term-declared-in-refinement/Impls_1.scala index c43f5f3f535b..8815878212dc 100644 --- a/test/files/run/macro-term-declared-in-refinement/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-refinement/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -8,4 +9,4 @@ object Impls { 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/files/run/macro-term-declared-in-refinement/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-refinement/Macros_Test_2.scala index b38616b71a53..d9c444679a68 100644 --- a/test/files/run/macro-term-declared-in-refinement/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-refinement/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.language.reflectiveCalls class Base diff --git a/test/files/run/macro-term-declared-in-trait.flags b/test/files/run/macro-term-declared-in-trait.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-term-declared-in-trait.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-term-declared-in-trait/Impls_1.scala b/test/files/run/macro-term-declared-in-trait/Impls_1.scala index c43f5f3f535b..8815878212dc 100644 --- a/test/files/run/macro-term-declared-in-trait/Impls_1.scala +++ b/test/files/run/macro-term-declared-in-trait/Impls_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Impls { @@ -8,4 +9,4 @@ object Impls { 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/files/run/macro-term-declared-in-trait/Macros_Test_2.scala b/test/files/run/macro-term-declared-in-trait/Macros_Test_2.scala index 09c60df3517a..197428d75fa8 100644 --- a/test/files/run/macro-term-declared-in-trait/Macros_Test_2.scala +++ b/test/files/run/macro-term-declared-in-trait/Macros_Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros trait Base { def foo: Unit = macro Impls.foo } @@ -10,4 +11,4 @@ object Test extends App { (new Base {}).foo Macros.foo new Macros().foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-typecheck-implicitsdisabled.flags b/test/files/run/macro-typecheck-implicitsdisabled.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-typecheck-implicitsdisabled.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala b/test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala index 956331cfae7e..b7b0aba0fdf3 100644 --- a/test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala +++ b/test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { @@ -25,4 +26,4 @@ object Macros { } def foo_with_implicits_disabled = macro impl_with_implicits_disabled -} \ No newline at end of file +} diff --git a/test/files/run/macro-typecheck-implicitsdisabled/Test_2.scala b/test/files/run/macro-typecheck-implicitsdisabled/Test_2.scala index 127e955f0ef5..3d01c1001bd9 100644 --- a/test/files/run/macro-typecheck-implicitsdisabled/Test_2.scala +++ b/test/files/run/macro-typecheck-implicitsdisabled/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { println(Macros.foo_with_implicits_enabled) println(Macros.foo_with_implicits_disabled) -} \ No newline at end of file +} diff --git a/test/files/run/macro-typecheck-macrosdisabled.flags b/test/files/run/macro-typecheck-macrosdisabled.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-typecheck-macrosdisabled.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala b/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala index 0e549f4ab836..b6849e5416b2 100644 --- a/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala +++ b/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { @@ -28,4 +29,4 @@ object Macros { } def foo_with_macros_disabled = macro impl_with_macros_disabled -} \ No newline at end of file +} diff --git a/test/files/run/macro-typecheck-macrosdisabled/Test_2.scala b/test/files/run/macro-typecheck-macrosdisabled/Test_2.scala index bdba39195b0a..447240b92f5e 100644 --- a/test/files/run/macro-typecheck-macrosdisabled/Test_2.scala +++ b/test/files/run/macro-typecheck-macrosdisabled/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { println(Macros.foo_with_macros_enabled) println(Macros.foo_with_macros_disabled) -} \ No newline at end of file +} diff --git a/test/files/run/macro-typecheck-macrosdisabled2.flags b/test/files/run/macro-typecheck-macrosdisabled2.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-typecheck-macrosdisabled2.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala b/test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala index f99f5d2f8039..0ce78f4de639 100644 --- a/test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala +++ b/test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { diff --git a/test/files/run/macro-typecheck-macrosdisabled2/Test_2.scala b/test/files/run/macro-typecheck-macrosdisabled2/Test_2.scala index bdba39195b0a..447240b92f5e 100644 --- a/test/files/run/macro-typecheck-macrosdisabled2/Test_2.scala +++ b/test/files/run/macro-typecheck-macrosdisabled2/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { println(Macros.foo_with_macros_enabled) println(Macros.foo_with_macros_disabled) -} \ No newline at end of file +} diff --git a/test/files/run/macro-undetparams-consfromsls.flags b/test/files/run/macro-undetparams-consfromsls.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-undetparams-consfromsls.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala b/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala index 5df5f96aa8d1..9dd2dbaee67f 100644 --- a/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala +++ b/test/files/run/macro-undetparams-consfromsls/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.runtime.universe._ import scala.reflect.macros.blackbox.Context @@ -21,4 +22,4 @@ object Macros { def cons[A](x: A, xs: List[A]): List[A] = macro cons_impl[A] def nil[B]: List[B] = macro nil_impl[B] -} \ No newline at end of file +} diff --git a/test/files/run/macro-undetparams-consfromsls/Test_2.scala b/test/files/run/macro-undetparams-consfromsls/Test_2.scala index f2c2ce0051af..9c83f3951805 100644 --- a/test/files/run/macro-undetparams-consfromsls/Test_2.scala +++ b/test/files/run/macro-undetparams-consfromsls/Test_2.scala @@ -1,7 +1,8 @@ +// scalac: -language:experimental.macros object Test extends App { import Macros._ val xs = cons(1, nil) println(xs) val ys = cons("abc", xs) println(ys) -} \ No newline at end of file +} diff --git a/test/files/run/macro-undetparams-implicitval.flags b/test/files/run/macro-undetparams-implicitval.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-undetparams-implicitval.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-undetparams-implicitval/Test.scala b/test/files/run/macro-undetparams-implicitval/Test.scala index 72fd2f3d72e2..109ffd947a66 100644 --- a/test/files/run/macro-undetparams-implicitval/Test.scala +++ b/test/files/run/macro-undetparams-implicitval/Test.scala @@ -1,6 +1,7 @@ +// scalac: -language:experimental.macros import scala.reflect.runtime.universe._ object Test extends App { def foo[T: TypeTag] = println(implicitly[TypeTag[T]]) foo -} \ No newline at end of file +} diff --git a/test/files/run/macro-undetparams-macroitself.flags b/test/files/run/macro-undetparams-macroitself.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/macro-undetparams-macroitself.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala b/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala index 1eb257e1d9b5..3b7b6cb95d77 100644 --- a/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala +++ b/test/files/run/macro-undetparams-macroitself/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.runtime.universe._ import scala.reflect.macros.blackbox.Context @@ -8,4 +9,4 @@ object Macros { } def foo[T](foo: T) = macro impl[T] -} \ No newline at end of file +} diff --git a/test/files/run/macro-undetparams-macroitself/Test_2.scala b/test/files/run/macro-undetparams-macroitself/Test_2.scala index 1a93ff13040d..bd9a9ccbc46f 100644 --- a/test/files/run/macro-undetparams-macroitself/Test_2.scala +++ b/test/files/run/macro-undetparams-macroitself/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { Macros.foo(42) Macros.foo("42") -} \ No newline at end of file +} diff --git a/test/files/run/macro-vampire-false-warning.flags b/test/files/run/macro-vampire-false-warning.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/run/macro-vampire-false-warning.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/run/macro-vampire-false-warning/Macros_1.scala b/test/files/run/macro-vampire-false-warning/Macros_1.scala index 63c34b3ab666..43b10597e048 100644 --- a/test/files/run/macro-vampire-false-warning/Macros_1.scala +++ b/test/files/run/macro-vampire-false-warning/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings // As per http://meta.plasm.us/posts/2013/08/31/feeding-our-vampires/ import scala.annotation.StaticAnnotation diff --git a/test/files/run/macro-vampire-false-warning/Test_2.scala b/test/files/run/macro-vampire-false-warning/Test_2.scala index 6e44b6863545..9eda3062ffcd 100644 --- a/test/files/run/macro-vampire-false-warning/Test_2.scala +++ b/test/files/run/macro-vampire-false-warning/Test_2.scala @@ -1,6 +1,7 @@ +// scalac: -Xfatal-warnings object Test extends App { val foo = mkObject("x" -> "2", "y" -> 3) println(foo.x) println(foo.y) // println(foo.z) => will result in a compilation error -} \ No newline at end of file +} diff --git a/test/files/run/macroPlugins-isBlackbox/Test_3.flags b/test/files/run/macroPlugins-isBlackbox/Test_3.flags deleted file mode 100644 index 966df731d030..000000000000 --- a/test/files/run/macroPlugins-isBlackbox/Test_3.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. \ No newline at end of file diff --git a/test/files/run/macroPlugins-isBlackbox/Test_3.scala b/test/files/run/macroPlugins-isBlackbox/Test_3.scala index 552e888143c7..68eb05dc8eb5 100644 --- a/test/files/run/macroPlugins-isBlackbox/Test_3.scala +++ b/test/files/run/macroPlugins-isBlackbox/Test_3.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. object Test extends App { val x: Int = Macros.foo -} \ No newline at end of file +} diff --git a/test/files/run/macroPlugins-macroArgs.check b/test/files/run/macroPlugins-macroArgs.check index a68f8069b63d..1191247b6d9a 100644 --- a/test/files/run/macroPlugins-macroArgs.check +++ b/test/files/run/macroPlugins-macroArgs.check @@ -1,2 +1,2 @@ -hijacked 1 -hijacked 2 +1 +2 diff --git a/test/files/run/macroPlugins-macroArgs/Macros_2.scala b/test/files/run/macroPlugins-macroArgs/Macros_2.scala index b19b8f18dc2f..6007e5363413 100644 --- a/test/files/run/macroPlugins-macroArgs/Macros_2.scala +++ b/test/files/run/macroPlugins-macroArgs/Macros_2.scala @@ -8,4 +8,4 @@ object Macros { } def foo(arg: String): Unit = macro impl -} \ No newline at end of file +} diff --git a/test/files/run/macroPlugins-macroArgs/Plugin_1.scala b/test/files/run/macroPlugins-macroArgs/Plugin_1.scala index 23e80ced3bdd..d67ac4420484 100644 --- a/test/files/run/macroPlugins-macroArgs/Plugin_1.scala +++ b/test/files/run/macroPlugins-macroArgs/Plugin_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. package macroArgs import scala.tools.nsc.Global @@ -18,4 +19,4 @@ class Plugin(val global: Global) extends NscPlugin { Some(MacroArgs(c, List(Literal(Constant("hijacked " + s))))) } } -} \ No newline at end of file +} diff --git a/test/files/run/macroPlugins-macroArgs/Test_3.flags b/test/files/run/macroPlugins-macroArgs/Test_3.flags deleted file mode 100644 index 966df731d030..000000000000 --- a/test/files/run/macroPlugins-macroArgs/Test_3.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. \ No newline at end of file diff --git a/test/files/run/macroPlugins-macroArgs/Test_3.scala b/test/files/run/macroPlugins-macroArgs/Test_3.scala index a54d60817898..84c3fbf9b5d3 100644 --- a/test/files/run/macroPlugins-macroArgs/Test_3.scala +++ b/test/files/run/macroPlugins-macroArgs/Test_3.scala @@ -1,4 +1,4 @@ object Test extends App { Macros.foo("1") Macros.foo("2") -} \ No newline at end of file +} diff --git a/test/files/run/macroPlugins-macroExpand.check b/test/files/run/macroPlugins-macroExpand.check index 6f685c2af4aa..b6f843618909 100644 --- a/test/files/run/macroPlugins-macroExpand.check +++ b/test/files/run/macroPlugins-macroExpand.check @@ -1,2 +1,2 @@ -expanded into println("impl1") -expanded into println("impl2") +impl1 +impl2 diff --git a/test/files/run/macroPlugins-macroExpand.flags b/test/files/run/macroPlugins-macroExpand.flags deleted file mode 100644 index ea7fc37e1af3..000000000000 --- a/test/files/run/macroPlugins-macroExpand.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos:false diff --git a/test/files/run/macroPlugins-macroExpand/Macros_2.scala b/test/files/run/macroPlugins-macroExpand/Macros_2.scala index c9c88ad2fdfd..5c3a5a80a31a 100644 --- a/test/files/run/macroPlugins-macroExpand/Macros_2.scala +++ b/test/files/run/macroPlugins-macroExpand/Macros_2.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos:false import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context @@ -15,4 +16,4 @@ object Macros { def foo1: Unit = macro impl1 def foo2: Unit = macro impl2 -} \ No newline at end of file +} diff --git a/test/files/run/macroPlugins-macroExpand/Plugin_1.scala b/test/files/run/macroPlugins-macroExpand/Plugin_1.scala index 13df85cb23a9..b22c5d527605 100644 --- a/test/files/run/macroPlugins-macroExpand/Plugin_1.scala +++ b/test/files/run/macroPlugins-macroExpand/Plugin_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Yrangepos:false package macroExpand import scala.tools.nsc.Global @@ -24,4 +25,4 @@ class Plugin(val global: Global) extends NscPlugin { Some(expander(expandee)) } } -} \ No newline at end of file +} diff --git a/test/files/run/macroPlugins-macroExpand/Test_3.flags b/test/files/run/macroPlugins-macroExpand/Test_3.flags deleted file mode 100644 index 966df731d030..000000000000 --- a/test/files/run/macroPlugins-macroExpand/Test_3.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. \ No newline at end of file diff --git a/test/files/run/macroPlugins-macroExpand/Test_3.scala b/test/files/run/macroPlugins-macroExpand/Test_3.scala index def9b5608a3a..360d9bbaa0f6 100644 --- a/test/files/run/macroPlugins-macroExpand/Test_3.scala +++ b/test/files/run/macroPlugins-macroExpand/Test_3.scala @@ -1,4 +1,5 @@ +// scalac: -Yrangepos:false object Test extends App { Macros.foo1 Macros.foo2 -} \ No newline at end of file +} diff --git a/test/files/run/macroPlugins-macroRuntime.check b/test/files/run/macroPlugins-macroRuntime.check index af16d1ac36e2..1191247b6d9a 100644 --- a/test/files/run/macroPlugins-macroRuntime.check +++ b/test/files/run/macroPlugins-macroRuntime.check @@ -1,2 +1,2 @@ -hijacked -hijacked +1 +2 diff --git a/test/files/run/macroPlugins-macroRuntime/Macros_2.scala b/test/files/run/macroPlugins-macroRuntime/Macros_2.scala index b19b8f18dc2f..6007e5363413 100644 --- a/test/files/run/macroPlugins-macroRuntime/Macros_2.scala +++ b/test/files/run/macroPlugins-macroRuntime/Macros_2.scala @@ -8,4 +8,4 @@ object Macros { } def foo(arg: String): Unit = macro impl -} \ No newline at end of file +} diff --git a/test/files/run/macroPlugins-macroRuntime/Plugin_1.scala b/test/files/run/macroPlugins-macroRuntime/Plugin_1.scala index a55adadb4899..f4f472e0def9 100644 --- a/test/files/run/macroPlugins-macroRuntime/Plugin_1.scala +++ b/test/files/run/macroPlugins-macroRuntime/Plugin_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. package macroRuntime import scala.tools.nsc.Global @@ -17,4 +18,4 @@ class Plugin(val global: Global) extends NscPlugin { case MacroArgs(_, List(msg)) => q"""println("hijacked")""" }) } -} \ No newline at end of file +} diff --git a/test/files/run/macroPlugins-macroRuntime/Test_3.flags b/test/files/run/macroPlugins-macroRuntime/Test_3.flags deleted file mode 100644 index 966df731d030..000000000000 --- a/test/files/run/macroPlugins-macroRuntime/Test_3.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. \ No newline at end of file diff --git a/test/files/run/macroPlugins-macroRuntime/Test_3.scala b/test/files/run/macroPlugins-macroRuntime/Test_3.scala index a54d60817898..84c3fbf9b5d3 100644 --- a/test/files/run/macroPlugins-macroRuntime/Test_3.scala +++ b/test/files/run/macroPlugins-macroRuntime/Test_3.scala @@ -1,4 +1,4 @@ object Test extends App { Macros.foo("1") Macros.foo("2") -} \ No newline at end of file +} diff --git a/test/files/run/macroPlugins-typedMacroBody.flags b/test/files/run/macroPlugins-typedMacroBody.flags deleted file mode 100644 index ea7fc37e1af3..000000000000 --- a/test/files/run/macroPlugins-typedMacroBody.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos:false diff --git a/test/files/run/macroPlugins-typedMacroBody/Macros_2.flags b/test/files/run/macroPlugins-typedMacroBody/Macros_2.flags deleted file mode 100644 index 966df731d030..000000000000 --- a/test/files/run/macroPlugins-typedMacroBody/Macros_2.flags +++ /dev/null @@ -1 +0,0 @@ --Xplugin:. \ No newline at end of file diff --git a/test/files/run/macroPlugins-typedMacroBody/Macros_2.scala b/test/files/run/macroPlugins-typedMacroBody/Macros_2.scala index 80acfec659a1..7dafd5bfac91 100644 --- a/test/files/run/macroPlugins-typedMacroBody/Macros_2.scala +++ b/test/files/run/macroPlugins-typedMacroBody/Macros_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xplugin:. -Yrangepos:false import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context @@ -15,4 +16,4 @@ object Macros { def foo1: Unit = macro 1 def foo2: Unit = macro 2 -} \ No newline at end of file +} diff --git a/test/files/run/macroPlugins-typedMacroBody/Plugin_1.scala b/test/files/run/macroPlugins-typedMacroBody/Plugin_1.scala index e99cf7f75d71..b9445dd9d30a 100644 --- a/test/files/run/macroPlugins-typedMacroBody/Plugin_1.scala +++ b/test/files/run/macroPlugins-typedMacroBody/Plugin_1.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos:false package typedMacroBody import scala.tools.nsc.Global @@ -18,4 +19,4 @@ class Plugin(val global: Global) extends NscPlugin { Some(standardTypedMacroBody(typer, copyDefDef(ddef)(rhs = Ident(TermName("impl" + num))))) } } -} \ No newline at end of file +} diff --git a/test/files/run/macroPlugins-typedMacroBody/Test_3.scala b/test/files/run/macroPlugins-typedMacroBody/Test_3.scala index def9b5608a3a..360d9bbaa0f6 100644 --- a/test/files/run/macroPlugins-typedMacroBody/Test_3.scala +++ b/test/files/run/macroPlugins-typedMacroBody/Test_3.scala @@ -1,4 +1,5 @@ +// scalac: -Yrangepos:false object Test extends App { Macros.foo1 Macros.foo2 -} \ No newline at end of file +} diff --git a/test/files/run/manifests-undeprecated-in-2.10.0.flags b/test/files/run/manifests-undeprecated-in-2.10.0.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/run/manifests-undeprecated-in-2.10.0.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/run/manifests-undeprecated-in-2.10.0.scala b/test/files/run/manifests-undeprecated-in-2.10.0.scala index 82e90b3a8919..38f095c83b50 100644 --- a/test/files/run/manifests-undeprecated-in-2.10.0.scala +++ b/test/files/run/manifests-undeprecated-in-2.10.0.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test extends App { def m1a: scala.reflect.Manifest[Int] = scala.reflect.Manifest.Int def m2a: scala.reflect.OptManifest[Int] = ??? @@ -12,4 +13,4 @@ object Test extends App { val m4b = implicitly[Manifest[Int]] val m5b = implicitly[OptManifest[Int]] -} \ No newline at end of file +} diff --git a/test/files/run/nothingTypeDce.flags b/test/files/run/nothingTypeDce.flags deleted file mode 100644 index 475f6db67c5f..000000000000 --- a/test/files/run/nothingTypeDce.flags +++ /dev/null @@ -1 +0,0 @@ --opt:unreachable-code diff --git a/test/files/run/nothingTypeDce.scala b/test/files/run/nothingTypeDce.scala index cb1e59e45c27..dc7d0493d0ab 100644 --- a/test/files/run/nothingTypeDce.scala +++ b/test/files/run/nothingTypeDce.scala @@ -1,3 +1,4 @@ +// scalac: -opt:unreachable-code // See comment in BCodeBodyBuilder // -opt:unreachable-code diff --git a/test/files/run/nothingTypeNoOpt.flags b/test/files/run/nothingTypeNoOpt.flags deleted file mode 100644 index 213d7425d189..000000000000 --- a/test/files/run/nothingTypeNoOpt.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:none diff --git a/test/files/run/nothingTypeNoOpt.scala b/test/files/run/nothingTypeNoOpt.scala index cc68364bf988..bb8e858e46ed 100644 --- a/test/files/run/nothingTypeNoOpt.scala +++ b/test/files/run/nothingTypeNoOpt.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:none // See comment in BCodeBodyBuilder // -target:jvm-1.6 -opt:l:none diff --git a/test/files/run/primitive-sigs-2-new.flags b/test/files/run/primitive-sigs-2-new.flags deleted file mode 100644 index 2349d8294d80..000000000000 --- a/test/files/run/primitive-sigs-2-new.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:inline diff --git a/test/files/run/primitive-sigs-2-new.scala b/test/files/run/primitive-sigs-2-new.scala index 1f39667b18f1..4da3d23ffe3e 100644 --- a/test/files/run/primitive-sigs-2-new.scala +++ b/test/files/run/primitive-sigs-2-new.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:inline import scala.language.{ postfixOps } import scala.reflect.{ClassTag, classTag} diff --git a/test/files/run/primitive-sigs-2-old.flags b/test/files/run/primitive-sigs-2-old.flags deleted file mode 100644 index ac96850b69b5..000000000000 --- a/test/files/run/primitive-sigs-2-old.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:inline \ No newline at end of file diff --git a/test/files/run/primitive-sigs-2-old.scala b/test/files/run/primitive-sigs-2-old.scala index 16fe5ae55563..5d5963814f2f 100644 --- a/test/files/run/primitive-sigs-2-old.scala +++ b/test/files/run/primitive-sigs-2-old.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:inline import scala.language.{ postfixOps } import java.{ lang => jl } diff --git a/test/files/run/pure-warning-post-macro.flags b/test/files/run/pure-warning-post-macro.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/run/pure-warning-post-macro.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/run/pure-warning-post-macro/Macro_1.scala b/test/files/run/pure-warning-post-macro/Macro_1.scala index 21d8972dee7f..9f9c400fced1 100644 --- a/test/files/run/pure-warning-post-macro/Macro_1.scala +++ b/test/files/run/pure-warning-post-macro/Macro_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings import scala.language.experimental.macros import scala.reflect.macros.blackbox.Context diff --git a/test/files/run/pure-warning-post-macro/test_2.scala b/test/files/run/pure-warning-post-macro/test_2.scala index 05aa3d620d9b..3defb7cfcb85 100644 --- a/test/files/run/pure-warning-post-macro/test_2.scala +++ b/test/files/run/pure-warning-post-macro/test_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { def main(args: Array[String]): Unit = { // We don't want a "pure expression discarded" warning here as the macro will diff --git a/test/files/run/synchronized.flags b/test/files/run/synchronized.flags deleted file mode 100644 index 0d25de8ef6a9..000000000000 --- a/test/files/run/synchronized.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** diff --git a/test/files/run/synchronized.scala b/test/files/run/synchronized.scala index b1457af32c35..aef905d72b9a 100644 --- a/test/files/run/synchronized.scala +++ b/test/files/run/synchronized.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** /* * filter: inliner warnings; */ diff --git a/test/files/run/t10067.flags b/test/files/run/t10067.flags deleted file mode 100644 index c02e5f2461f4..000000000000 --- a/test/files/run/t10067.flags +++ /dev/null @@ -1 +0,0 @@ --unchecked diff --git a/test/files/run/t10067/Test.scala b/test/files/run/t10067/Test.scala index af1e12592e7c..0508369e28ca 100644 --- a/test/files/run/t10067/Test.scala +++ b/test/files/run/t10067/Test.scala @@ -1,3 +1,4 @@ +// scalac: -unchecked object Test { def main(args: Array[String]): Unit = { //get inner class as some instance of super type diff --git a/test/files/run/t10097.check b/test/files/run/t10097.check index 0e8b96061cb7..d1938a94e3e1 100644 --- a/test/files/run/t10097.check +++ b/test/files/run/t10097.check @@ -1,3 +1,3 @@ -t10097.scala:2: warning: case classes should have a non-implicit parameter list; adapting to 'case class C()(...)' +t10097.scala:3: warning: case classes should have a non-implicit parameter list; adapting to 'case class C()(...)' case class C(implicit c: Int) ^ diff --git a/test/files/run/t10097.flags b/test/files/run/t10097.flags deleted file mode 100644 index dcc59ebe32ef..000000000000 --- a/test/files/run/t10097.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation diff --git a/test/files/run/t10097.scala b/test/files/run/t10097.scala index a16be897cc20..ad900dee4924 100644 --- a/test/files/run/t10097.scala +++ b/test/files/run/t10097.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation case class C(implicit c: Int) diff --git a/test/files/run/t10283.flags b/test/files/run/t10283.flags deleted file mode 100644 index 714bbf5125f3..000000000000 --- a/test/files/run/t10283.flags +++ /dev/null @@ -1 +0,0 @@ --Xsource:2.13 diff --git a/test/files/run/t10283.scala b/test/files/run/t10283.scala index 47f98f525005..8af86621d4d5 100644 --- a/test/files/run/t10283.scala +++ b/test/files/run/t10283.scala @@ -1,3 +1,4 @@ +// scalac: -Xsource:2.13 trait OpacityTypes { type T def orderingT: Ordering[T] diff --git a/test/files/run/t10439.flags b/test/files/run/t10439.flags deleted file mode 100644 index ae084460552a..000000000000 --- a/test/files/run/t10439.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit \ No newline at end of file diff --git a/test/files/run/t10439.scala b/test/files/run/t10439.scala index 4de14cc0ded7..998d367ca0e8 100644 --- a/test/files/run/t10439.scala +++ b/test/files/run/t10439.scala @@ -1,3 +1,4 @@ +// scalac: -Xcheckinit object Test { private var s: String = _ diff --git a/test/files/run/t10692.flags b/test/files/run/t10692.flags deleted file mode 100644 index 3d1ee4760af6..000000000000 --- a/test/files/run/t10692.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit diff --git a/test/files/run/t10692.scala b/test/files/run/t10692.scala index a52d078ba3a8..ae91a14adf0b 100644 --- a/test/files/run/t10692.scala +++ b/test/files/run/t10692.scala @@ -1,3 +1,4 @@ +// scalac: -Xcheckinit trait T { private var s: String = _ def getS: String = { diff --git a/test/files/run/t11255.flags b/test/files/run/t11255.flags deleted file mode 100644 index 0d25de8ef6a9..000000000000 --- a/test/files/run/t11255.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** diff --git a/test/files/run/t11255/A_1.scala b/test/files/run/t11255/A_1.scala index f18a5c632468..3e33c3971aa8 100644 --- a/test/files/run/t11255/A_1.scala +++ b/test/files/run/t11255/A_1.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** class K(val f: Int => Int) extends Serializable class A { @inline final def f = new K(x => x + 1) diff --git a/test/files/run/t11255/Test_2.scala b/test/files/run/t11255/Test_2.scala index 4a252e44b57e..ec5dcaa60361 100644 --- a/test/files/run/t11255/Test_2.scala +++ b/test/files/run/t11255/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** object Test { def serializeDeserialize(obj: Object): Object = { import java.io._ diff --git a/test/files/run/t1167.flags b/test/files/run/t1167.flags deleted file mode 100644 index ac96850b69b5..000000000000 --- a/test/files/run/t1167.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:inline \ No newline at end of file diff --git a/test/files/run/t1167.scala b/test/files/run/t1167.scala index 3dd0a30c00ca..daf8112a1d99 100644 --- a/test/files/run/t1167.scala +++ b/test/files/run/t1167.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:inline /** Tests for compatible InnerClasses attribute between trait and * impl classes, as well as anonymous classes. */ diff --git a/test/files/run/t1503_future.flags b/test/files/run/t1503_future.flags deleted file mode 100644 index 112fc720a057..000000000000 --- a/test/files/run/t1503_future.flags +++ /dev/null @@ -1 +0,0 @@ --Xfuture \ No newline at end of file diff --git a/test/files/run/t1503_future.scala b/test/files/run/t1503_future.scala index 1e3daad761b3..5d1c51430f7f 100644 --- a/test/files/run/t1503_future.scala +++ b/test/files/run/t1503_future.scala @@ -1,3 +1,4 @@ +// scalac: -Xfuture object Whatever { override def equals(x: Any) = true } @@ -14,4 +15,4 @@ object Test extends App { assert(matchWhateverCCE(1) == 1) assert(matchWhateverCCE("1") == "1") -} \ No newline at end of file +} diff --git a/test/files/run/t1987.flags b/test/files/run/t1987.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/run/t1987.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/run/t1987.scala b/test/files/run/t1987.scala index de869edea078..9bffdc0baf3a 100644 --- a/test/files/run/t1987.scala +++ b/test/files/run/t1987.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings // a.scala // Fri Jan 13 11:31:47 PST 2012 diff --git a/test/files/run/t2106.check b/test/files/run/t2106.check index c8ebe575f01b..9e74bb6a97fc 100644 --- a/test/files/run/t2106.check +++ b/test/files/run/t2106.check @@ -1,4 +1,4 @@ -t2106.scala:7: warning: A::foo()Ljava/lang/Object; is annotated @inline but could not be inlined: +t2106.scala:8: warning: A::foo()Ljava/lang/Object; is annotated @inline but could not be inlined: The callee A::foo()Ljava/lang/Object; contains the instruction INVOKEVIRTUAL A.clone ()Ljava/lang/Object; that would cause an IllegalAccessError when inlined into class Test$. def main(args: Array[String]): Unit = x.foo diff --git a/test/files/run/t2106.flags b/test/files/run/t2106.flags deleted file mode 100644 index 4e7e840e03f0..000000000000 --- a/test/files/run/t2106.flags +++ /dev/null @@ -1 +0,0 @@ --opt-warnings -opt:l:inline -opt-inline-from:** diff --git a/test/files/run/t2106.scala b/test/files/run/t2106.scala index 55b89da80568..0f294480de05 100644 --- a/test/files/run/t2106.scala +++ b/test/files/run/t2106.scala @@ -1,3 +1,4 @@ +// scalac: -opt-warnings -opt:l:inline -opt-inline-from:** class A extends Cloneable { @inline final def foo = clone() } diff --git a/test/files/run/t2251.flags b/test/files/run/t2251.flags deleted file mode 100644 index 19243266d108..000000000000 --- a/test/files/run/t2251.flags +++ /dev/null @@ -1 +0,0 @@ --Xstrict-inference \ No newline at end of file diff --git a/test/files/run/t2251.scala b/test/files/run/t2251.scala index 00c5619b499a..ef07073125b8 100644 --- a/test/files/run/t2251.scala +++ b/test/files/run/t2251.scala @@ -1,3 +1,4 @@ +// scalac: -Xstrict-inference class A trait B[T <: B[T]] extends A class C extends B[C] { override def toString = "C" } diff --git a/test/files/run/t2251b.flags b/test/files/run/t2251b.flags deleted file mode 100644 index 19243266d108..000000000000 --- a/test/files/run/t2251b.flags +++ /dev/null @@ -1 +0,0 @@ --Xstrict-inference \ No newline at end of file diff --git a/test/files/run/t2251b.scala b/test/files/run/t2251b.scala index b67b3aec1eb3..01cc1d3ec4a1 100644 --- a/test/files/run/t2251b.scala +++ b/test/files/run/t2251b.scala @@ -1,3 +1,4 @@ +// scalac: -Xstrict-inference class A trait B[T <: B[T]] extends A class B1[T <: B1[T]] extends B[T] diff --git a/test/files/run/t3038b.flags b/test/files/run/t3038b.flags deleted file mode 100644 index ae084460552a..000000000000 --- a/test/files/run/t3038b.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit \ No newline at end of file diff --git a/test/files/run/t3038b.scala b/test/files/run/t3038b.scala index 1527d64ebc81..ef461f6e08f3 100644 --- a/test/files/run/t3038b.scala +++ b/test/files/run/t3038b.scala @@ -1,3 +1,4 @@ +// scalac: -Xcheckinit class A { val a1 = 1 val a2 = 2 diff --git a/test/files/run/t3038d.flags b/test/files/run/t3038d.flags deleted file mode 100644 index ae084460552a..000000000000 --- a/test/files/run/t3038d.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit \ No newline at end of file diff --git a/test/files/run/t3038d.scala b/test/files/run/t3038d.scala index 44fb047b0b5a..1fb5979476e2 100644 --- a/test/files/run/t3038d.scala +++ b/test/files/run/t3038d.scala @@ -1,3 +1,4 @@ +// scalac: -Xcheckinit trait Foo { @transient protected var load = 1 @transient protected var a = 12 diff --git a/test/files/run/t3235-minimal.check b/test/files/run/t3235-minimal.check index 374ddc79fe92..977018b899fe 100644 --- a/test/files/run/t3235-minimal.check +++ b/test/files/run/t3235-minimal.check @@ -1,12 +1,12 @@ -t3235-minimal.scala:3: warning: method round in class RichInt is deprecated (since 2.11.0): this is an integer type; there is no reason to round it. Perhaps you meant to call this on a floating-point value? +t3235-minimal.scala:4: warning: method round in class RichInt is deprecated (since 2.11.0): this is an integer type; there is no reason to round it. Perhaps you meant to call this on a floating-point value? assert(123456789.round == 123456789) ^ -t3235-minimal.scala:4: warning: method round in package math is deprecated (since 2.11.0): This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value? +t3235-minimal.scala:5: warning: method round in package math is deprecated (since 2.11.0): This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value? assert(math.round(123456789) == 123456789) ^ -t3235-minimal.scala:5: warning: method round in class RichLong is deprecated (since 2.11.0): this is an integer type; there is no reason to round it. Perhaps you meant to call this on a floating-point value? +t3235-minimal.scala:6: warning: method round in class RichLong is deprecated (since 2.11.0): this is an integer type; there is no reason to round it. Perhaps you meant to call this on a floating-point value? assert(1234567890123456789L.round == 1234567890123456789L) ^ -t3235-minimal.scala:6: warning: method round in package math is deprecated (since 2.11.0): This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value? +t3235-minimal.scala:7: warning: method round in package math is deprecated (since 2.11.0): This is an integer type; there is no reason to round it. Perhaps you meant to call this with a floating-point value? assert(math.round(1234567890123456789L) == 1234567890123456789L) ^ diff --git a/test/files/run/t3235-minimal.flags b/test/files/run/t3235-minimal.flags deleted file mode 100644 index dcc59ebe32ef..000000000000 --- a/test/files/run/t3235-minimal.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation diff --git a/test/files/run/t3235-minimal.scala b/test/files/run/t3235-minimal.scala index dc9907b63b80..66528fffb6a6 100644 --- a/test/files/run/t3235-minimal.scala +++ b/test/files/run/t3235-minimal.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation object Test { def main(args: Array[String]) { assert(123456789.round == 123456789) diff --git a/test/files/run/t3509.flags b/test/files/run/t3509.flags deleted file mode 100644 index 0f85fc3bd844..000000000000 --- a/test/files/run/t3509.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** \ No newline at end of file diff --git a/test/files/run/t3509.scala b/test/files/run/t3509.scala index 76f8d6016e5d..484ec30c5097 100644 --- a/test/files/run/t3509.scala +++ b/test/files/run/t3509.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** object Test { class Foo(final var i:Int) @@ -6,4 +7,4 @@ object Test { val foo = new Foo(0) foo.i += 1 } -} \ No newline at end of file +} diff --git a/test/files/run/t3518.check b/test/files/run/t3518.check index 1500b22b97c3..8e7ffa0ce536 100644 --- a/test/files/run/t3518.check +++ b/test/files/run/t3518.check @@ -1,12 +1,12 @@ -t3518.scala:2: warning: method to in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead +t3518.scala:3: warning: method to in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead val r1 = 1.0 to 10.0 by 0.5 ^ -t3518.scala:3: warning: method to in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead +t3518.scala:4: warning: method to in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead val r2 = 1.0 to 1.0 by 1.0 ^ -t3518.scala:4: warning: method to in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead +t3518.scala:5: warning: method to in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead val r3 = 10.0 to 1.0 by -0.5 ^ -t3518.scala:5: warning: method until in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead +t3518.scala:6: warning: method until in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead val r4 = 1.0 until 1.0 by 1.0 ^ diff --git a/test/files/run/t3518.flags b/test/files/run/t3518.flags deleted file mode 100644 index dcc59ebe32ef..000000000000 --- a/test/files/run/t3518.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation diff --git a/test/files/run/t3518.scala b/test/files/run/t3518.scala index 033cc19548fb..53d60465ee07 100644 --- a/test/files/run/t3518.scala +++ b/test/files/run/t3518.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation object Test { val r1 = 1.0 to 10.0 by 0.5 val r2 = 1.0 to 1.0 by 1.0 diff --git a/test/files/run/t3569.flags b/test/files/run/t3569.flags deleted file mode 100644 index 0f85fc3bd844..000000000000 --- a/test/files/run/t3569.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** \ No newline at end of file diff --git a/test/files/run/t3569.scala b/test/files/run/t3569.scala index 7da4de9e9596..3ba863a9cf8c 100644 --- a/test/files/run/t3569.scala +++ b/test/files/run/t3569.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** object Test { final val bippy1 = 1 final lazy val bippy2 = 2 diff --git a/test/files/run/t3895.flags b/test/files/run/t3895.flags deleted file mode 100644 index ae084460552a..000000000000 --- a/test/files/run/t3895.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit \ No newline at end of file diff --git a/test/files/run/t3895.scala b/test/files/run/t3895.scala index 9028e0a08a4b..2de0064b8f5f 100644 --- a/test/files/run/t3895.scala +++ b/test/files/run/t3895.scala @@ -1,3 +1,4 @@ +// scalac: -Xcheckinit class C extends A{ val a = 10 diff --git a/test/files/run/t3897.flags b/test/files/run/t3897.flags deleted file mode 100644 index ac96850b69b5..000000000000 --- a/test/files/run/t3897.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:inline \ No newline at end of file diff --git a/test/files/run/t3897/a_1.scala b/test/files/run/t3897/a_1.scala index 4da959e2ac76..146a471c1cf6 100644 --- a/test/files/run/t3897/a_1.scala +++ b/test/files/run/t3897/a_1.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:inline class One { private val messages = new collection.mutable.MutableList[String] List("a") foreach { messages += _ } diff --git a/test/files/run/t3897/a_2.scala b/test/files/run/t3897/a_2.scala index 7a161fcbe45d..d9ef2e353dbf 100644 --- a/test/files/run/t3897/a_2.scala +++ b/test/files/run/t3897/a_2.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:inline object Test { def f1(clazz: Class[_]) = ( clazz.getDeclaredFields.toList diff --git a/test/files/run/t4072.flags b/test/files/run/t4072.flags deleted file mode 100644 index ae084460552a..000000000000 --- a/test/files/run/t4072.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit \ No newline at end of file diff --git a/test/files/run/t4072.scala b/test/files/run/t4072.scala index c035fcc22aa7..5a564039be37 100644 --- a/test/files/run/t4072.scala +++ b/test/files/run/t4072.scala @@ -1,3 +1,4 @@ +// scalac: -Xcheckinit import scala.tools.nsc._ import scala.language.{ reflectiveCalls } diff --git a/test/files/run/t4201.check b/test/files/run/t4201.check index d5258453a611..dd01b7ed0a0d 100644 --- a/test/files/run/t4201.check +++ b/test/files/run/t4201.check @@ -1,3 +1,3 @@ -t4201.scala:3: warning: method to in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead +t4201.scala:4: warning: method to in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead val f = 0.0 to 1.0 by 1.0 / 3.0 ^ diff --git a/test/files/run/t4201.flags b/test/files/run/t4201.flags deleted file mode 100644 index dcc59ebe32ef..000000000000 --- a/test/files/run/t4201.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation diff --git a/test/files/run/t4201.scala b/test/files/run/t4201.scala index f6c0acaf945b..813d737d4ce6 100644 --- a/test/files/run/t4201.scala +++ b/test/files/run/t4201.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation object Test { def main(args: Array[String]): Unit = { val f = 0.0 to 1.0 by 1.0 / 3.0 diff --git a/test/files/run/t4285.flags b/test/files/run/t4285.flags deleted file mode 100644 index 0f85fc3bd844..000000000000 --- a/test/files/run/t4285.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** \ No newline at end of file diff --git a/test/files/run/t4285.scala b/test/files/run/t4285.scala index 1d9afcaf3d30..9fdb2a3b889e 100644 --- a/test/files/run/t4285.scala +++ b/test/files/run/t4285.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** import scala.tools.partest.ReplTest object Test extends ReplTest { def code = """ diff --git a/test/files/run/t4317.flags b/test/files/run/t4317.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/run/t4317.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/run/t4317/S_1.scala b/test/files/run/t4317/S_1.scala index 2756c879ebd5..26b90ca929d6 100644 --- a/test/files/run/t4317/S_1.scala +++ b/test/files/run/t4317/S_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings import language.existentials object S_1 { diff --git a/test/files/run/t4317/S_3.scala b/test/files/run/t4317/S_3.scala index ce8e2330e3a6..8f468c94e366 100644 --- a/test/files/run/t4317/S_3.scala +++ b/test/files/run/t4317/S_3.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings object Test { def main(args: Array[String]): Unit = { val j = new J_2() diff --git a/test/files/run/t4536.flags b/test/files/run/t4536.flags deleted file mode 100644 index 1141f975075d..000000000000 --- a/test/files/run/t4536.flags +++ /dev/null @@ -1 +0,0 @@ --language:dynamics diff --git a/test/files/run/t4536.scala b/test/files/run/t4536.scala index 6661eae6a75f..94e979a7e711 100644 --- a/test/files/run/t4536.scala +++ b/test/files/run/t4536.scala @@ -1,3 +1,4 @@ +// scalac: -language:dynamics diff --git a/test/files/run/t4742.flags b/test/files/run/t4742.flags deleted file mode 100644 index ae084460552a..000000000000 --- a/test/files/run/t4742.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit \ No newline at end of file diff --git a/test/files/run/t4742.scala b/test/files/run/t4742.scala index 3b42c0c12093..dad2d7045fbe 100644 --- a/test/files/run/t4742.scala +++ b/test/files/run/t4742.scala @@ -1,3 +1,4 @@ +// scalac: -Xcheckinit trait T { val x: Int = 0 } object O extends T { override final val x = 1 } diff --git a/test/files/run/t4935.flags b/test/files/run/t4935.flags deleted file mode 100644 index 0d25de8ef6a9..000000000000 --- a/test/files/run/t4935.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** diff --git a/test/files/run/t4935.scala b/test/files/run/t4935.scala index 5940355b9b9c..33e13964867b 100644 --- a/test/files/run/t4935.scala +++ b/test/files/run/t4935.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** object Test extends App { for (i <- 0 to 1) { val a = Foo diff --git a/test/files/run/t5040.flags b/test/files/run/t5040.flags deleted file mode 100644 index 1141f975075d..000000000000 --- a/test/files/run/t5040.flags +++ /dev/null @@ -1 +0,0 @@ --language:dynamics diff --git a/test/files/run/t5040.scala b/test/files/run/t5040.scala index 6cd2c2223487..99dc9a016294 100644 --- a/test/files/run/t5040.scala +++ b/test/files/run/t5040.scala @@ -1,3 +1,4 @@ +// scalac: -language:dynamics abstract class Prova2 extends Dynamic { def applyDynamic(m: String)(): Unit private def privateMethod() = println("private method") diff --git a/test/files/run/t5568.flags b/test/files/run/t5568.flags deleted file mode 100644 index ad51758c3932..000000000000 --- a/test/files/run/t5568.flags +++ /dev/null @@ -1 +0,0 @@ --nowarn diff --git a/test/files/run/t5568.scala b/test/files/run/t5568.scala index 14599d9ed245..0b297504b0c9 100644 --- a/test/files/run/t5568.scala +++ b/test/files/run/t5568.scala @@ -1,3 +1,4 @@ +// scalac: -nowarn object Test { def main(args: Array[String]): Unit = { // these should give unboxed results diff --git a/test/files/run/t5648.flags b/test/files/run/t5648.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/run/t5648.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/run/t5648.scala b/test/files/run/t5648.scala index c5cea9e1cbb9..21c05871cb3e 100644 --- a/test/files/run/t5648.scala +++ b/test/files/run/t5648.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings case class C(val s: Int*) object Test { diff --git a/test/files/run/t5676.flags b/test/files/run/t5676.flags deleted file mode 100644 index 73f1330c31df..000000000000 --- a/test/files/run/t5676.flags +++ /dev/null @@ -1 +0,0 @@ --Yoverride-objects diff --git a/test/files/run/t5676.scala b/test/files/run/t5676.scala index 0c920e4a9de3..0576521fb913 100644 --- a/test/files/run/t5676.scala +++ b/test/files/run/t5676.scala @@ -1,3 +1,4 @@ +// scalac: -Yoverride-objects import java.lang.reflect.Modifier class Bar[T] diff --git a/test/files/run/t5704.flags b/test/files/run/t5704.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/t5704.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/t5704.scala b/test/files/run/t5704.scala index 495a82e4f044..a963eabf1260 100644 --- a/test/files/run/t5704.scala +++ b/test/files/run/t5704.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.runtime.universe._ import scala.reflect.runtime.{universe => ru} import scala.reflect.runtime.{currentMirror => cm} @@ -16,4 +17,4 @@ object Test extends App { } val qc = new MyQuerycollection qc.findUserByName("some value") -} \ No newline at end of file +} diff --git a/test/files/run/t5713.flags b/test/files/run/t5713.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/t5713.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/t5713/Impls_Macros_1.scala b/test/files/run/t5713/Impls_Macros_1.scala index 7b04197cfa57..393f265aca91 100644 --- a/test/files/run/t5713/Impls_Macros_1.scala +++ b/test/files/run/t5713/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros package m import language.experimental.macros @@ -25,4 +26,4 @@ private object LoggerMacros { else { c.universe.reify(println(message.splice)) } -} \ No newline at end of file +} diff --git a/test/files/run/t5713/Test_2.scala b/test/files/run/t5713/Test_2.scala index 24f9e79b11f1..16dba2854773 100644 --- a/test/files/run/t5713/Test_2.scala +++ b/test/files/run/t5713/Test_2.scala @@ -1,5 +1,6 @@ +// scalac: -language:experimental.macros import m._ object Test extends App { Logger.error("err") -} \ No newline at end of file +} diff --git a/test/files/run/t5753_1.flags b/test/files/run/t5753_1.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/t5753_1.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/t5753_1/Impls_Macros_1.scala b/test/files/run/t5753_1/Impls_Macros_1.scala index ce0713885204..f0d7f8cc229b 100644 --- a/test/files/run/t5753_1/Impls_Macros_1.scala +++ b/test/files/run/t5753_1/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context import language.experimental.macros @@ -7,4 +8,4 @@ trait Impls { object Macros extends Impls { def foo(x: Any) = macro impl -} \ No newline at end of file +} diff --git a/test/files/run/t5753_1/Test_2.scala b/test/files/run/t5753_1/Test_2.scala index 864d356fdbe9..146bc0c2727c 100644 --- a/test/files/run/t5753_1/Test_2.scala +++ b/test/files/run/t5753_1/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { import Macros._ println(foo(42)) -} \ No newline at end of file +} diff --git a/test/files/run/t5753_2.flags b/test/files/run/t5753_2.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/t5753_2.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/t5753_2/Impls_Macros_1.scala b/test/files/run/t5753_2/Impls_Macros_1.scala index d446d37bdf75..4eb5c742833e 100644 --- a/test/files/run/t5753_2/Impls_Macros_1.scala +++ b/test/files/run/t5753_2/Impls_Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context trait Macro_T { diff --git a/test/files/run/t5753_2/Test_2.scala b/test/files/run/t5753_2/Test_2.scala index 864d356fdbe9..146bc0c2727c 100644 --- a/test/files/run/t5753_2/Test_2.scala +++ b/test/files/run/t5753_2/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { import Macros._ println(foo(42)) -} \ No newline at end of file +} diff --git a/test/files/run/t5830.flags b/test/files/run/t5830.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/run/t5830.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/run/t5830.scala b/test/files/run/t5830.scala index f284bf2f97e4..1dc71656bc21 100644 --- a/test/files/run/t5830.scala +++ b/test/files/run/t5830.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings import scala.annotation.switch object Test extends App { @@ -52,4 +53,4 @@ object Test extends App { // test that it jumps to default case, no match error defaultUnguarded(' ', false) // default -} \ No newline at end of file +} diff --git a/test/files/run/t5857.check b/test/files/run/t5857.check index 2fda7fad3af5..e741a12279e9 100644 --- a/test/files/run/t5857.check +++ b/test/files/run/t5857.check @@ -1,6 +1,6 @@ -t5857.scala:25: warning: method to in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead +t5857.scala:26: warning: method to in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead val numeric = 1.0 to sz.toDouble by 1 ^ -t5857.scala:29: warning: method to in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead +t5857.scala:30: warning: method to in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead val numdesc = sz.toDouble to 1.0 by -1 ^ diff --git a/test/files/run/t5857.flags b/test/files/run/t5857.flags deleted file mode 100644 index dcc59ebe32ef..000000000000 --- a/test/files/run/t5857.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation diff --git a/test/files/run/t5857.scala b/test/files/run/t5857.scala index c82fd88c082a..9cd366bfd609 100644 --- a/test/files/run/t5857.scala +++ b/test/files/run/t5857.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation diff --git a/test/files/run/t5903a.flags b/test/files/run/t5903a.flags deleted file mode 100644 index 02ecab49e720..000000000000 --- a/test/files/run/t5903a.flags +++ /dev/null @@ -1 +0,0 @@ --Xlog-reflective-calls \ No newline at end of file diff --git a/test/files/run/t5903a/Macros_1.scala b/test/files/run/t5903a/Macros_1.scala index 5d084ceed5e6..051533281e35 100644 --- a/test/files/run/t5903a/Macros_1.scala +++ b/test/files/run/t5903a/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xlog-reflective-calls import scala.reflect.macros.whitebox.Context import language.experimental.macros diff --git a/test/files/run/t5903a/Test_2.scala b/test/files/run/t5903a/Test_2.scala index 3a0b68b56851..26ea686527eb 100644 --- a/test/files/run/t5903a/Test_2.scala +++ b/test/files/run/t5903a/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xlog-reflective-calls object Test extends App { import NewQuasiquotes._ SomeTree match { diff --git a/test/files/run/t5903b.flags b/test/files/run/t5903b.flags deleted file mode 100644 index 02ecab49e720..000000000000 --- a/test/files/run/t5903b.flags +++ /dev/null @@ -1 +0,0 @@ --Xlog-reflective-calls \ No newline at end of file diff --git a/test/files/run/t5903b/Macros_1.scala b/test/files/run/t5903b/Macros_1.scala index 29a05f7feca7..8ff00c10a8a7 100644 --- a/test/files/run/t5903b/Macros_1.scala +++ b/test/files/run/t5903b/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xlog-reflective-calls import scala.reflect.macros.whitebox.Context import language.experimental.macros diff --git a/test/files/run/t5903b/Test_2.scala b/test/files/run/t5903b/Test_2.scala index 0f6f80d327db..245e9c77ef9e 100644 --- a/test/files/run/t5903b/Test_2.scala +++ b/test/files/run/t5903b/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xlog-reflective-calls object Test extends App { import Interpolation._ 2 match { diff --git a/test/files/run/t5903c.flags b/test/files/run/t5903c.flags deleted file mode 100644 index 02ecab49e720..000000000000 --- a/test/files/run/t5903c.flags +++ /dev/null @@ -1 +0,0 @@ --Xlog-reflective-calls \ No newline at end of file diff --git a/test/files/run/t5903c/Macros_1.scala b/test/files/run/t5903c/Macros_1.scala index 34fe1d8808ca..1244c3695e7b 100644 --- a/test/files/run/t5903c/Macros_1.scala +++ b/test/files/run/t5903c/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xlog-reflective-calls import scala.reflect.macros.whitebox.Context import language.experimental.macros diff --git a/test/files/run/t5903c/Test_2.scala b/test/files/run/t5903c/Test_2.scala index 0f6f80d327db..245e9c77ef9e 100644 --- a/test/files/run/t5903c/Test_2.scala +++ b/test/files/run/t5903c/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xlog-reflective-calls object Test extends App { import Interpolation._ 2 match { diff --git a/test/files/run/t5903d.flags b/test/files/run/t5903d.flags deleted file mode 100644 index 02ecab49e720..000000000000 --- a/test/files/run/t5903d.flags +++ /dev/null @@ -1 +0,0 @@ --Xlog-reflective-calls \ No newline at end of file diff --git a/test/files/run/t5903d/Macros_1.scala b/test/files/run/t5903d/Macros_1.scala index f1f8dc1fde60..fa75ee95e087 100644 --- a/test/files/run/t5903d/Macros_1.scala +++ b/test/files/run/t5903d/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -Xlog-reflective-calls import scala.reflect.macros.whitebox.Context import language.experimental.macros diff --git a/test/files/run/t5903d/Test_2.scala b/test/files/run/t5903d/Test_2.scala index 95c717a9d83a..4c18b1435421 100644 --- a/test/files/run/t5903d/Test_2.scala +++ b/test/files/run/t5903d/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -Xlog-reflective-calls object Test extends App { import Interpolation._ 42 match { diff --git a/test/files/run/t5905-features.flags b/test/files/run/t5905-features.flags deleted file mode 100644 index ad51758c3932..000000000000 --- a/test/files/run/t5905-features.flags +++ /dev/null @@ -1 +0,0 @@ --nowarn diff --git a/test/files/run/t5905-features.scala b/test/files/run/t5905-features.scala index b518d611455f..c28e2bc7d4a6 100644 --- a/test/files/run/t5905-features.scala +++ b/test/files/run/t5905-features.scala @@ -1,3 +1,4 @@ +// scalac: -nowarn import tools.partest.DirectTest diff --git a/test/files/run/t6102.flags b/test/files/run/t6102.flags deleted file mode 100644 index 992aaec1be56..000000000000 --- a/test/files/run/t6102.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** -Xfatal-warnings diff --git a/test/files/run/t6102.scala b/test/files/run/t6102.scala index aeb27b0bd3dc..53e572dee19b 100644 --- a/test/files/run/t6102.scala +++ b/test/files/run/t6102.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** -Xfatal-warnings // scala/bug#6102 Wrong bytecode in lazyval + no-op finally clause object Test { diff --git a/test/files/run/t6188.flags b/test/files/run/t6188.flags deleted file mode 100644 index 0f85fc3bd844..000000000000 --- a/test/files/run/t6188.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** \ No newline at end of file diff --git a/test/files/run/t6188.scala b/test/files/run/t6188.scala index ea92202cd3c2..edeab40d2985 100644 --- a/test/files/run/t6188.scala +++ b/test/files/run/t6188.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** // scala/bug#6188 Optimizer incorrectly removes method invocations containing throw expressions import scala.util.Success diff --git a/test/files/run/t6327.flags b/test/files/run/t6327.flags deleted file mode 100644 index ea7fc37e1af3..000000000000 --- a/test/files/run/t6327.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos:false diff --git a/test/files/run/t6327.scala b/test/files/run/t6327.scala index 7683101f1424..e3f399a698a5 100644 --- a/test/files/run/t6327.scala +++ b/test/files/run/t6327.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos:false import language._ object Test extends App { diff --git a/test/files/run/t6394a.flags b/test/files/run/t6394a.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/t6394a.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/t6394a/Macros_1.scala b/test/files/run/t6394a/Macros_1.scala index 376d85ba6732..9da64fe54005 100644 --- a/test/files/run/t6394a/Macros_1.scala +++ b/test/files/run/t6394a/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { @@ -9,4 +10,4 @@ object Macros { } def foo: Any = macro impl -} \ No newline at end of file +} diff --git a/test/files/run/t6394a/Test_2.scala b/test/files/run/t6394a/Test_2.scala index 75e84f0e3869..4de787427078 100644 --- a/test/files/run/t6394a/Test_2.scala +++ b/test/files/run/t6394a/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { println(Macros.foo) override def toString = "TEST" -} \ No newline at end of file +} diff --git a/test/files/run/t6394b.flags b/test/files/run/t6394b.flags deleted file mode 100644 index cd66464f2f63..000000000000 --- a/test/files/run/t6394b.flags +++ /dev/null @@ -1 +0,0 @@ --language:experimental.macros \ No newline at end of file diff --git a/test/files/run/t6394b/Macros_1.scala b/test/files/run/t6394b/Macros_1.scala index 1a747816e30a..ae7c77178a51 100644 --- a/test/files/run/t6394b/Macros_1.scala +++ b/test/files/run/t6394b/Macros_1.scala @@ -1,3 +1,4 @@ +// scalac: -language:experimental.macros import scala.reflect.macros.blackbox.Context object Macros { @@ -9,4 +10,4 @@ object Macros { } def foo: Any = macro impl -} \ No newline at end of file +} diff --git a/test/files/run/t6394b/Test_2.scala b/test/files/run/t6394b/Test_2.scala index 75e84f0e3869..4de787427078 100644 --- a/test/files/run/t6394b/Test_2.scala +++ b/test/files/run/t6394b/Test_2.scala @@ -1,4 +1,5 @@ +// scalac: -language:experimental.macros object Test extends App { println(Macros.foo) override def toString = "TEST" -} \ No newline at end of file +} diff --git a/test/files/run/t6541.flags b/test/files/run/t6541.flags deleted file mode 100644 index 68d0ddfec205..000000000000 --- a/test/files/run/t6541.flags +++ /dev/null @@ -1 +0,0 @@ --feature -Xfatal-warnings -Xsource:2.12 \ No newline at end of file diff --git a/test/files/run/t6541.scala b/test/files/run/t6541.scala index f1271436917d..05375b0c3de2 100644 --- a/test/files/run/t6541.scala +++ b/test/files/run/t6541.scala @@ -1,3 +1,4 @@ +// scalac: -feature -Xfatal-warnings -Xsource:2.12 class A class B[T](x: T) case class C(a: A, b: B[_]) diff --git a/test/files/run/t6663.flags b/test/files/run/t6663.flags deleted file mode 100644 index ea7fc37e1af3..000000000000 --- a/test/files/run/t6663.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos:false diff --git a/test/files/run/t6663.scala b/test/files/run/t6663.scala index d41d76ffe921..0825e3925fc2 100644 --- a/test/files/run/t6663.scala +++ b/test/files/run/t6663.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos:false import language.dynamics class C(v: Any) extends Dynamic { diff --git a/test/files/run/t6731.flags b/test/files/run/t6731.flags deleted file mode 100644 index ea7fc37e1af3..000000000000 --- a/test/files/run/t6731.flags +++ /dev/null @@ -1 +0,0 @@ --Yrangepos:false diff --git a/test/files/run/t6731.scala b/test/files/run/t6731.scala index 12357b935e1a..1514bab34523 100644 --- a/test/files/run/t6731.scala +++ b/test/files/run/t6731.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos:false import scala.language.dynamics import scala.reflect.{ ClassTag, classTag } diff --git a/test/files/run/t7171.check b/test/files/run/t7171.check index 5454142882bb..5067cee3d395 100644 --- a/test/files/run/t7171.check +++ b/test/files/run/t7171.check @@ -1,6 +1,6 @@ -t7171.scala:2: warning: The outer reference in this type test cannot be checked at run time. +t7171.scala:3: warning: The outer reference in this type test cannot be checked at run time. final case class A() ^ -t7171.scala:9: warning: The outer reference in this type test cannot be checked at run time. +t7171.scala:10: warning: The outer reference in this type test cannot be checked at run time. case _: A => true; case _ => false ^ diff --git a/test/files/run/t7171.flags b/test/files/run/t7171.flags deleted file mode 100644 index c02e5f2461f4..000000000000 --- a/test/files/run/t7171.flags +++ /dev/null @@ -1 +0,0 @@ --unchecked diff --git a/test/files/run/t7171.scala b/test/files/run/t7171.scala index e0a1192228c4..fe552259cf92 100644 --- a/test/files/run/t7171.scala +++ b/test/files/run/t7171.scala @@ -1,3 +1,4 @@ +// scalac: -unchecked trait T { final case class A() diff --git a/test/files/run/t7341.flags b/test/files/run/t7341.flags deleted file mode 100644 index ae084460552a..000000000000 --- a/test/files/run/t7341.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit \ No newline at end of file diff --git a/test/files/run/t7341.scala b/test/files/run/t7341.scala index ffea7f918b0e..aefffdd296d5 100644 --- a/test/files/run/t7341.scala +++ b/test/files/run/t7341.scala @@ -1,3 +1,4 @@ +// scalac: -Xcheckinit object Obj { private var cache: Any = () def returning(f: () => Unit) = () diff --git a/test/files/run/t7407.flags b/test/files/run/t7407.flags deleted file mode 100644 index 213d7425d189..000000000000 --- a/test/files/run/t7407.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:none diff --git a/test/files/run/t7407.scala b/test/files/run/t7407.scala index c95d684435b5..31886111fbba 100644 --- a/test/files/run/t7407.scala +++ b/test/files/run/t7407.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:none // scala/bug#7407 object Test { diff --git a/test/files/run/t7459b-optimize.flags b/test/files/run/t7459b-optimize.flags deleted file mode 100644 index 0d25de8ef6a9..000000000000 --- a/test/files/run/t7459b-optimize.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** diff --git a/test/files/run/t7459b-optimize.scala b/test/files/run/t7459b-optimize.scala index 605890962cfc..0d7b2f2a714c 100644 --- a/test/files/run/t7459b-optimize.scala +++ b/test/files/run/t7459b-optimize.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** class LM { class Node[B1] diff --git a/test/files/run/t7582.check b/test/files/run/t7582.check index d0a0975d4cf2..135a16022ae7 100644 --- a/test/files/run/t7582.check +++ b/test/files/run/t7582.check @@ -1,4 +1,4 @@ -InlineHolder_2.scala:9: warning: p1/InlineHolder$::inlinable()I is annotated @inline but could not be inlined: +InlineHolder_2.scala:10: warning: p1/InlineHolder$::inlinable()I is annotated @inline but could not be inlined: The callee p1/InlineHolder$::inlinable()I contains the instruction INVOKESTATIC p1/PackageProtectedJava_1.protectedMethod ()I that would cause an IllegalAccessError when inlined into class O$. def x = p1.InlineHolder.inlinable diff --git a/test/files/run/t7582.flags b/test/files/run/t7582.flags deleted file mode 100644 index 6e6b9eb9ee53..000000000000 --- a/test/files/run/t7582.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** -opt-warnings \ No newline at end of file diff --git a/test/files/run/t7582/InlineHolder_2.scala b/test/files/run/t7582/InlineHolder_2.scala index 44c68d49b92a..29c97710f102 100644 --- a/test/files/run/t7582/InlineHolder_2.scala +++ b/test/files/run/t7582/InlineHolder_2.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** -opt-warnings package p1 { object InlineHolder { @inline def inlinable = p1.PackageProtectedJava_1.protectedMethod() + 1 diff --git a/test/files/run/t7582b.check b/test/files/run/t7582b.check index d0a0975d4cf2..135a16022ae7 100644 --- a/test/files/run/t7582b.check +++ b/test/files/run/t7582b.check @@ -1,4 +1,4 @@ -InlineHolder_2.scala:9: warning: p1/InlineHolder$::inlinable()I is annotated @inline but could not be inlined: +InlineHolder_2.scala:10: warning: p1/InlineHolder$::inlinable()I is annotated @inline but could not be inlined: The callee p1/InlineHolder$::inlinable()I contains the instruction INVOKESTATIC p1/PackageProtectedJava_1.protectedMethod ()I that would cause an IllegalAccessError when inlined into class O$. def x = p1.InlineHolder.inlinable diff --git a/test/files/run/t7582b.flags b/test/files/run/t7582b.flags deleted file mode 100644 index 6e6b9eb9ee53..000000000000 --- a/test/files/run/t7582b.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** -opt-warnings \ No newline at end of file diff --git a/test/files/run/t7582b/InlineHolder_2.scala b/test/files/run/t7582b/InlineHolder_2.scala index 44c68d49b92a..29c97710f102 100644 --- a/test/files/run/t7582b/InlineHolder_2.scala +++ b/test/files/run/t7582b/InlineHolder_2.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** -opt-warnings package p1 { object InlineHolder { @inline def inlinable = p1.PackageProtectedJava_1.protectedMethod() + 1 diff --git a/test/files/run/t7584.flags b/test/files/run/t7584.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/run/t7584.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/run/t7584.scala b/test/files/run/t7584.scala index 6d7f4f7ebbab..5e3efb9cfb17 100644 --- a/test/files/run/t7584.scala +++ b/test/files/run/t7584.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings // Test case added to show the behaviour of functions with // by-name parameters. The evaluation behaviour was already correct. // diff --git a/test/files/run/t7852.flags b/test/files/run/t7852.flags deleted file mode 100644 index 213d7425d189..000000000000 --- a/test/files/run/t7852.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:none diff --git a/test/files/run/t7852.scala b/test/files/run/t7852.scala index 167906751042..700e07183f83 100644 --- a/test/files/run/t7852.scala +++ b/test/files/run/t7852.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:none import scala.tools.partest.BytecodeTest import scala.tools.asm import scala.tools.asm.util._ diff --git a/test/files/run/t7974.flags b/test/files/run/t7974.flags deleted file mode 100644 index 5fc2a0389474..000000000000 --- a/test/files/run/t7974.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit:false diff --git a/test/files/run/t7974/Symbols.scala b/test/files/run/t7974/Symbols.scala index 2363b724eb5a..fb5b9c390dd6 100644 --- a/test/files/run/t7974/Symbols.scala +++ b/test/files/run/t7974/Symbols.scala @@ -1,3 +1,4 @@ +// scalac: -Xcheckinit:false class Symbols { def someSymbol1 = 'Symbolic1 def someSymbol2 = 'Symbolic2 diff --git a/test/files/run/t7974/Test.scala b/test/files/run/t7974/Test.scala index 53ec71bc2bc6..f4fd2cfdde3e 100644 --- a/test/files/run/t7974/Test.scala +++ b/test/files/run/t7974/Test.scala @@ -1,3 +1,4 @@ +// scalac: -Xcheckinit:false import java.io.PrintWriter import scala.tools.partest.BytecodeTest diff --git a/test/files/run/t8017.flags b/test/files/run/t8017.flags deleted file mode 100644 index 48b438ddf86a..000000000000 --- a/test/files/run/t8017.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method diff --git a/test/files/run/t8017/value-class-lambda.scala b/test/files/run/t8017/value-class-lambda.scala index 370023b194e7..8ef35a260ee9 100644 --- a/test/files/run/t8017/value-class-lambda.scala +++ b/test/files/run/t8017/value-class-lambda.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method object Test { def testC { val f1 = (c: C) => c.value diff --git a/test/files/run/t8017/value-class.scala b/test/files/run/t8017/value-class.scala index 821239305f4c..002652ae68f8 100644 --- a/test/files/run/t8017/value-class.scala +++ b/test/files/run/t8017/value-class.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method class C(val value: Int) extends AnyVal class D(val value: String) extends AnyVal class E[A](val value: A) extends AnyVal diff --git a/test/files/run/t8266-octal-interp.check b/test/files/run/t8266-octal-interp.check index 66ecafddc2ac..84361813b0fc 100644 --- a/test/files/run/t8266-octal-interp.check +++ b/test/files/run/t8266-octal-interp.check @@ -1,22 +1,22 @@ -t8266-octal-interp.scala:4: warning: Octal escape literals are deprecated, use \b instead. +t8266-octal-interp.scala:5: warning: Octal escape literals are deprecated, use \b instead. f"a\10c", ^ -t8266-octal-interp.scala:5: warning: Octal escape literals are deprecated, use \t instead. +t8266-octal-interp.scala:6: warning: Octal escape literals are deprecated, use \t instead. f"a\11c", ^ -t8266-octal-interp.scala:6: warning: Octal escape literals are deprecated, use \n instead. +t8266-octal-interp.scala:7: warning: Octal escape literals are deprecated, use \n instead. f"a\12c", ^ -t8266-octal-interp.scala:7: warning: Octal escape literals are deprecated, use \r instead. +t8266-octal-interp.scala:8: warning: Octal escape literals are deprecated, use \r instead. f"a\15c", ^ -t8266-octal-interp.scala:8: warning: Octal escape literals are deprecated, use ${'"'} or a triple-quoted literal """with embedded " or \u0022""" instead. +t8266-octal-interp.scala:9: warning: Octal escape literals are deprecated, use ${'"'} or a triple-quoted literal """with embedded " or \u0022""" instead. f"a\42c", ^ -t8266-octal-interp.scala:9: warning: Octal escape literals are deprecated, use \\ instead. +t8266-octal-interp.scala:10: warning: Octal escape literals are deprecated, use \\ instead. f"a\134c", ^ -t8266-octal-interp.scala:10: warning: Octal escape literals are deprecated, use \u0069 instead. +t8266-octal-interp.scala:11: warning: Octal escape literals are deprecated, use \u0069 instead. f"a\15151515c" ^ ac diff --git a/test/files/run/t8266-octal-interp.flags b/test/files/run/t8266-octal-interp.flags deleted file mode 100644 index dcc59ebe32ef..000000000000 --- a/test/files/run/t8266-octal-interp.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation diff --git a/test/files/run/t8266-octal-interp.scala b/test/files/run/t8266-octal-interp.scala index f85ae0367dbc..f51873383eb6 100644 --- a/test/files/run/t8266-octal-interp.scala +++ b/test/files/run/t8266-octal-interp.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation trait X { def f = Seq( diff --git a/test/files/run/t8570.flags b/test/files/run/t8570.flags deleted file mode 100644 index 3d1ee4760af6..000000000000 --- a/test/files/run/t8570.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit diff --git a/test/files/run/t8570.scala b/test/files/run/t8570.scala index bbe83e908044..c9e047dc17c5 100644 --- a/test/files/run/t8570.scala +++ b/test/files/run/t8570.scala @@ -1,3 +1,4 @@ +// scalac: -Xcheckinit trait Trait40_1 { val value37_2 = () def run = { value37_2 } diff --git a/test/files/run/t8570a.flags b/test/files/run/t8570a.flags deleted file mode 100644 index 3d1ee4760af6..000000000000 --- a/test/files/run/t8570a.flags +++ /dev/null @@ -1 +0,0 @@ --Xcheckinit diff --git a/test/files/run/t8570a.scala b/test/files/run/t8570a.scala index ef116e2a8a93..8804a5f3e6b3 100644 --- a/test/files/run/t8570a.scala +++ b/test/files/run/t8570a.scala @@ -1,3 +1,4 @@ +// scalac: -Xcheckinit trait Trait40_1 { val value37_2 = () def run = { value37_2 } diff --git a/test/files/run/t8601-closure-elim.flags b/test/files/run/t8601-closure-elim.flags deleted file mode 100644 index 8f4d278c6d4d..000000000000 --- a/test/files/run/t8601-closure-elim.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method -opt:l:inline -opt-inline-from:** diff --git a/test/files/run/t8601-closure-elim.scala b/test/files/run/t8601-closure-elim.scala index 40fbf1fe0e18..ffb8330a57f7 100644 --- a/test/files/run/t8601-closure-elim.scala +++ b/test/files/run/t8601-closure-elim.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method -opt:l:inline -opt-inline-from:** import scala.tools.partest.BytecodeTest import scala.tools.partest.ASMConverters.instructionsFromMethod import scala.tools.asm diff --git a/test/files/run/t8601.flags b/test/files/run/t8601.flags deleted file mode 100644 index 0d25de8ef6a9..000000000000 --- a/test/files/run/t8601.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** diff --git a/test/files/run/t8601.scala b/test/files/run/t8601.scala index e1afc23cc415..5d8a2ed22041 100644 --- a/test/files/run/t8601.scala +++ b/test/files/run/t8601.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** object Test { def idiv(x: Int): Unit = x / 0 def ldiv(x: Long): Unit = x / 0 diff --git a/test/files/run/t8601b.flags b/test/files/run/t8601b.flags deleted file mode 100644 index 0d25de8ef6a9..000000000000 --- a/test/files/run/t8601b.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** diff --git a/test/files/run/t8601b.scala b/test/files/run/t8601b.scala index 9c37ce33d697..04bc6f2c186f 100644 --- a/test/files/run/t8601b.scala +++ b/test/files/run/t8601b.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** object Test { def len(x: Array[String]): Unit = x.length def load(x: Array[String]): Unit = x(0) diff --git a/test/files/run/t8601c.flags b/test/files/run/t8601c.flags deleted file mode 100644 index 0d25de8ef6a9..000000000000 --- a/test/files/run/t8601c.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** diff --git a/test/files/run/t8601c.scala b/test/files/run/t8601c.scala index c487d6825ef5..e0346a543ec2 100644 --- a/test/files/run/t8601c.scala +++ b/test/files/run/t8601c.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** object Test { def loadField(x: scala.runtime.IntRef): Unit = x.elem def storeField(x: scala.runtime.IntRef): Unit = x.elem = 42 diff --git a/test/files/run/t8601d.flags b/test/files/run/t8601d.flags deleted file mode 100644 index 0d25de8ef6a9..000000000000 --- a/test/files/run/t8601d.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** diff --git a/test/files/run/t8601d.scala b/test/files/run/t8601d.scala index ac89963d6771..e061bf5869d0 100644 --- a/test/files/run/t8601d.scala +++ b/test/files/run/t8601d.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** object Test { def monitor(x: AnyRef): Unit = {x.synchronized(()); ()} def check(x: => Any) = try { x; sys.error("failed to throw NPE") } catch { case _: NullPointerException => } diff --git a/test/files/run/t8601e.flags b/test/files/run/t8601e.flags deleted file mode 100644 index 0d25de8ef6a9..000000000000 --- a/test/files/run/t8601e.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** diff --git a/test/files/run/t8601e/Test.scala b/test/files/run/t8601e/Test.scala index 838114f6a7eb..ed8e49c37fd0 100644 --- a/test/files/run/t8601e/Test.scala +++ b/test/files/run/t8601e/Test.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** class C { def foo: Unit = {StaticInit.fld} } diff --git a/test/files/run/t8610.check b/test/files/run/t8610.check index b3ab7a9cefcf..3c334cbbd4e3 100644 --- a/test/files/run/t8610.check +++ b/test/files/run/t8610.check @@ -1,4 +1,4 @@ -t8610.scala:6: warning: Adapting argument list by creating a 2-tuple: this may not be what you want. +t8610.scala:7: warning: Adapting argument list by creating a 2-tuple: this may not be what you want. signature: X.f(p: (Int, Int)): Int given arguments: 3, 4 after adaptation: X.f((3, 4): (Int, Int)) diff --git a/test/files/run/t8610.flags b/test/files/run/t8610.flags deleted file mode 100644 index 4195dec3835a..000000000000 --- a/test/files/run/t8610.flags +++ /dev/null @@ -1 +0,0 @@ --Xlint:adapted-args diff --git a/test/files/run/t8610.scala b/test/files/run/t8610.scala index dd9e8e861e71..81bc1d302c14 100644 --- a/test/files/run/t8610.scala +++ b/test/files/run/t8610.scala @@ -1,3 +1,4 @@ +// scalac: -Xlint:adapted-args // flags don't warn on u case class X(name: String) { diff --git a/test/files/run/t8611a.flags b/test/files/run/t8611a.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/run/t8611a.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/run/t8611a.scala b/test/files/run/t8611a.scala index 99304df762f9..d31117e1eb4c 100644 --- a/test/files/run/t8611a.scala +++ b/test/files/run/t8611a.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings trait K trait L diff --git a/test/files/run/t8611b.flags b/test/files/run/t8611b.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/run/t8611b.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/run/t8611b.scala b/test/files/run/t8611b.scala index 2df17c9ca001..0cab04c760a3 100644 --- a/test/files/run/t8611b.scala +++ b/test/files/run/t8611b.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings sealed trait KrafsDescription abstract class NotWorkingEnum extends Enumeration { diff --git a/test/files/run/t8611c.flags b/test/files/run/t8611c.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/run/t8611c.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/run/t8611c.scala b/test/files/run/t8611c.scala index 2bd17f29a559..187163ac6664 100644 --- a/test/files/run/t8611c.scala +++ b/test/files/run/t8611c.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings trait K trait L diff --git a/test/files/run/t8888.flags b/test/files/run/t8888.flags deleted file mode 100644 index 48b438ddf86a..000000000000 --- a/test/files/run/t8888.flags +++ /dev/null @@ -1 +0,0 @@ --Ydelambdafy:method diff --git a/test/files/run/t8888.scala b/test/files/run/t8888.scala index 36cc1ddf3ef9..a5983fcbd6be 100644 --- a/test/files/run/t8888.scala +++ b/test/files/run/t8888.scala @@ -1,3 +1,4 @@ +// scalac: -Ydelambdafy:method class C { final def resume: Unit = (this: Any) match { case x : C => (x: Any) match { diff --git a/test/files/run/t8925.flags b/test/files/run/t8925.flags deleted file mode 100644 index 213d7425d189..000000000000 --- a/test/files/run/t8925.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:none diff --git a/test/files/run/t8925.scala b/test/files/run/t8925.scala index 33f4505f0368..183b6453a1b8 100644 --- a/test/files/run/t8925.scala +++ b/test/files/run/t8925.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:none object Ex { def unapply(t: Throwable): Option[Throwable] = Some(t) } diff --git a/test/files/run/t9003.flags b/test/files/run/t9003.flags deleted file mode 100644 index 0d25de8ef6a9..000000000000 --- a/test/files/run/t9003.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** diff --git a/test/files/run/t9003.scala b/test/files/run/t9003.scala index 4f2471220196..ad2e046a5549 100644 --- a/test/files/run/t9003.scala +++ b/test/files/run/t9003.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** object Single { var i = 0 def isEmpty = false diff --git a/test/files/run/t9029.flags b/test/files/run/t9029.flags deleted file mode 100644 index dcc59ebe32ef..000000000000 --- a/test/files/run/t9029.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation diff --git a/test/files/run/t9029.scala b/test/files/run/t9029.scala index c01033b76e8d..9fef0e052793 100644 --- a/test/files/run/t9029.scala +++ b/test/files/run/t9029.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation class Y(val _2: Int, val _1: String) object X { def unapply(u: Unit): Option[Y] = Some(new Y(42, "!")) } diff --git a/test/files/run/t9178a.flags b/test/files/run/t9178a.flags deleted file mode 100644 index 48fd867160ba..000000000000 --- a/test/files/run/t9178a.flags +++ /dev/null @@ -1 +0,0 @@ --Xexperimental diff --git a/test/files/run/t9178a.scala b/test/files/run/t9178a.scala index 4788841f8d6f..8e987bd0eca3 100644 --- a/test/files/run/t9178a.scala +++ b/test/files/run/t9178a.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental trait Sam { def apply(): Unit } abstract class Test { def foo(): Sam diff --git a/test/files/run/t9403.check b/test/files/run/t9403.check new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/test/files/run/t9403.flags b/test/files/run/t9403.flags deleted file mode 100644 index 0d25de8ef6a9..000000000000 --- a/test/files/run/t9403.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:inline -opt-inline-from:** diff --git a/test/files/run/t9403/C_1.scala b/test/files/run/t9403/C_1.scala index 439af1a3869c..391e4b51f02e 100644 --- a/test/files/run/t9403/C_1.scala +++ b/test/files/run/t9403/C_1.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** package p class C { @inline final def f(x: Int): Long = 10L / (if (x < 0) -2 else 2) diff --git a/test/files/run/t9403/Test_2.scala b/test/files/run/t9403/Test_2.scala index fb2777b9a8ec..d6ff984b003c 100644 --- a/test/files/run/t9403/Test_2.scala +++ b/test/files/run/t9403/Test_2.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:inline -opt-inline-from:** import p.C import scala.tools.asm.Opcodes import scala.tools.partest.BytecodeTest diff --git a/test/files/run/t9489.flags b/test/files/run/t9489.flags deleted file mode 100644 index 48fd867160ba..000000000000 --- a/test/files/run/t9489.flags +++ /dev/null @@ -1 +0,0 @@ --Xexperimental diff --git a/test/files/run/t9489/test.scala b/test/files/run/t9489/test.scala index 1b745af86515..c0bcdd28e608 100644 --- a/test/files/run/t9489/test.scala +++ b/test/files/run/t9489/test.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental class T { def f(a: A) = g(a.b) // was: "found Int, required B" def g(b: => B) = null diff --git a/test/files/run/t9656.check b/test/files/run/t9656.check index 8cbae611650b..4af309ab6168 100644 --- a/test/files/run/t9656.check +++ b/test/files/run/t9656.check @@ -1,7 +1,7 @@ -t9656.scala:17: warning: method until in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead +t9656.scala:18: warning: method until in trait FractionalProxy is deprecated (since 2.12.6): use BigDecimal range instead println(0.1 until 1.0 by 0.1) ^ -t9656.scala:19: warning: method apply in object Double is deprecated (since 2.12.6): use Range.BigDecimal instead +t9656.scala:20: warning: method apply in object Double is deprecated (since 2.12.6): use Range.BigDecimal instead println(Range.Double(0.1, 1.0, 0.1)) ^ Range 1 to 10 diff --git a/test/files/run/t9656.flags b/test/files/run/t9656.flags deleted file mode 100644 index dcc59ebe32ef..000000000000 --- a/test/files/run/t9656.flags +++ /dev/null @@ -1 +0,0 @@ --deprecation diff --git a/test/files/run/t9656.scala b/test/files/run/t9656.scala index 373271955340..8aea4c1c283f 100644 --- a/test/files/run/t9656.scala +++ b/test/files/run/t9656.scala @@ -1,3 +1,4 @@ +// scalac: -deprecation import scala.math.BigDecimal diff --git a/test/files/run/virtpatmat_apply.flags b/test/files/run/virtpatmat_apply.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/run/virtpatmat_apply.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/run/virtpatmat_apply.scala b/test/files/run/virtpatmat_apply.scala index b8776f4afb6f..579a54c867e1 100644 --- a/test/files/run/virtpatmat_apply.scala +++ b/test/files/run/virtpatmat_apply.scala @@ -1,7 +1,8 @@ +// scalac: -Xexperimental object Test extends App { List(1, 2, 3) match { case Nil => println("FAIL") case x :: y :: xs if xs.length == 2 => println("FAIL") case x :: y :: xs if xs.length == 1 => println("OK "+ y) } -} \ No newline at end of file +} diff --git a/test/files/run/virtpatmat_casting.flags b/test/files/run/virtpatmat_casting.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/run/virtpatmat_casting.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/run/virtpatmat_casting.scala b/test/files/run/virtpatmat_casting.scala index a36daec6fb97..e2cf6bc20986 100644 --- a/test/files/run/virtpatmat_casting.scala +++ b/test/files/run/virtpatmat_casting.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental object Test extends App { println(List(1,2,3) match { case Nil => List(0) diff --git a/test/files/run/virtpatmat_extends_product.flags b/test/files/run/virtpatmat_extends_product.flags deleted file mode 100644 index 8b137891791f..000000000000 --- a/test/files/run/virtpatmat_extends_product.flags +++ /dev/null @@ -1 +0,0 @@ - diff --git a/test/files/run/virtpatmat_literal.flags b/test/files/run/virtpatmat_literal.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/run/virtpatmat_literal.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/run/virtpatmat_literal.scala b/test/files/run/virtpatmat_literal.scala index 9a68d296b5bf..f352c01fe24a 100644 --- a/test/files/run/virtpatmat_literal.scala +++ b/test/files/run/virtpatmat_literal.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental object Test extends App { val a = 1 1 match { @@ -19,4 +20,4 @@ object Test extends App { case 1 => println("FAILED") } -} \ No newline at end of file +} diff --git a/test/files/run/virtpatmat_nested_lists.check b/test/files/run/virtpatmat_nested_lists.check index ddf68eeedd4d..01268ec19f34 100644 --- a/test/files/run/virtpatmat_nested_lists.check +++ b/test/files/run/virtpatmat_nested_lists.check @@ -1,4 +1,4 @@ -virtpatmat_nested_lists.scala:5: warning: match may not be exhaustive. +virtpatmat_nested_lists.scala:6: warning: match may not be exhaustive. List(List(1), List(2)) match { case x :: (y :: Nil) :: Nil => println(y) } ^ 2 diff --git a/test/files/run/virtpatmat_nested_lists.flags b/test/files/run/virtpatmat_nested_lists.flags deleted file mode 100644 index ca9a4c06970b..000000000000 --- a/test/files/run/virtpatmat_nested_lists.flags +++ /dev/null @@ -1 +0,0 @@ --Ypatmat-exhaust-depth off \ No newline at end of file diff --git a/test/files/run/virtpatmat_nested_lists.scala b/test/files/run/virtpatmat_nested_lists.scala index d1aa68ea935b..f07d0fcdb8c4 100644 --- a/test/files/run/virtpatmat_nested_lists.scala +++ b/test/files/run/virtpatmat_nested_lists.scala @@ -1,3 +1,4 @@ +// scalac: -Ypatmat-exhaust-depth off /* * filter: It would fail on the following input */ diff --git a/test/files/run/virtpatmat_npe.flags b/test/files/run/virtpatmat_npe.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/run/virtpatmat_npe.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/run/virtpatmat_npe.scala b/test/files/run/virtpatmat_npe.scala index 84a9276454d3..a28b53217aa5 100644 --- a/test/files/run/virtpatmat_npe.scala +++ b/test/files/run/virtpatmat_npe.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental class C { class D val values = new Array[AnyRef](10) @@ -7,4 +8,4 @@ class C { } } -object Test extends C with App \ No newline at end of file +object Test extends C with App diff --git a/test/files/run/virtpatmat_opt_sharing.check b/test/files/run/virtpatmat_opt_sharing.check index 78ec61f19da3..ea55b6d9ab3d 100644 --- a/test/files/run/virtpatmat_opt_sharing.check +++ b/test/files/run/virtpatmat_opt_sharing.check @@ -1,4 +1,4 @@ -virtpatmat_opt_sharing.scala:7: warning: match may not be exhaustive. +virtpatmat_opt_sharing.scala:8: warning: match may not be exhaustive. List(1, 3, 4, 7) match { ^ 1 diff --git a/test/files/run/virtpatmat_opt_sharing.flags b/test/files/run/virtpatmat_opt_sharing.flags deleted file mode 100644 index ca9a4c06970b..000000000000 --- a/test/files/run/virtpatmat_opt_sharing.flags +++ /dev/null @@ -1 +0,0 @@ --Ypatmat-exhaust-depth off \ No newline at end of file diff --git a/test/files/run/virtpatmat_opt_sharing.scala b/test/files/run/virtpatmat_opt_sharing.scala index d2c42cab4804..f0b0267cceee 100644 --- a/test/files/run/virtpatmat_opt_sharing.scala +++ b/test/files/run/virtpatmat_opt_sharing.scala @@ -1,3 +1,4 @@ +// scalac: -Ypatmat-exhaust-depth off /* * filter: It would fail on the following input */ diff --git a/test/files/run/virtpatmat_partial.flags b/test/files/run/virtpatmat_partial.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/run/virtpatmat_partial.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/run/virtpatmat_partial.scala b/test/files/run/virtpatmat_partial.scala index a2353146100d..a4d6a745f0f6 100644 --- a/test/files/run/virtpatmat_partial.scala +++ b/test/files/run/virtpatmat_partial.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental object Test extends App { val a = Map("a" -> Some(1), "b" -> None) println(a) diff --git a/test/files/run/virtpatmat_staging.flags b/test/files/run/virtpatmat_staging.flags deleted file mode 100644 index bec3aa96e9a2..000000000000 --- a/test/files/run/virtpatmat_staging.flags +++ /dev/null @@ -1,2 +0,0 @@ --Yrangepos:false --Yvirtpatmat diff --git a/test/files/run/virtpatmat_staging.scala b/test/files/run/virtpatmat_staging.scala index d444829b02a9..673591888931 100644 --- a/test/files/run/virtpatmat_staging.scala +++ b/test/files/run/virtpatmat_staging.scala @@ -1,3 +1,4 @@ +// scalac: -Yrangepos:false -Yvirtpatmat import scala.language.{ higherKinds, implicitConversions } diff --git a/test/files/run/virtpatmat_stringinterp.flags b/test/files/run/virtpatmat_stringinterp.flags deleted file mode 100644 index e1b37447c953..000000000000 --- a/test/files/run/virtpatmat_stringinterp.flags +++ /dev/null @@ -1 +0,0 @@ --Xexperimental \ No newline at end of file diff --git a/test/files/run/virtpatmat_stringinterp.scala b/test/files/run/virtpatmat_stringinterp.scala index c6c951e6e5f0..69330644d0e5 100644 --- a/test/files/run/virtpatmat_stringinterp.scala +++ b/test/files/run/virtpatmat_stringinterp.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental import scala.language.{ implicitConversions } diff --git a/test/files/run/virtpatmat_switch.flags b/test/files/run/virtpatmat_switch.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/run/virtpatmat_switch.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/run/virtpatmat_switch.scala b/test/files/run/virtpatmat_switch.scala index 2f2e210d9e32..c82fd7605e0f 100644 --- a/test/files/run/virtpatmat_switch.scala +++ b/test/files/run/virtpatmat_switch.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental object Test extends App { def intSwitch(x: Int) = x match { case 0 => "zero" diff --git a/test/files/run/virtpatmat_tailcalls_verifyerror.flags b/test/files/run/virtpatmat_tailcalls_verifyerror.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/run/virtpatmat_tailcalls_verifyerror.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/run/virtpatmat_tailcalls_verifyerror.scala b/test/files/run/virtpatmat_tailcalls_verifyerror.scala index 5ce91e8dce7e..2d86a9a08c4b 100644 --- a/test/files/run/virtpatmat_tailcalls_verifyerror.scala +++ b/test/files/run/virtpatmat_tailcalls_verifyerror.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental // shouldn't result in a verify error when run... object Test extends App { @annotation.tailrec @@ -11,4 +12,4 @@ object Test extends App { } } println(test(true)) -} \ No newline at end of file +} diff --git a/test/files/run/virtpatmat_try.flags b/test/files/run/virtpatmat_try.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/run/virtpatmat_try.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/run/virtpatmat_try.scala b/test/files/run/virtpatmat_try.scala index dab2c89227c7..d7218c67837a 100644 --- a/test/files/run/virtpatmat_try.scala +++ b/test/files/run/virtpatmat_try.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental object Test extends App { case class A(val x: String) extends Throwable class B extends Exception { override def toString = "B" } diff --git a/test/files/run/virtpatmat_typed.check b/test/files/run/virtpatmat_typed.check index b304fa5ffc93..62569a847709 100644 --- a/test/files/run/virtpatmat_typed.check +++ b/test/files/run/virtpatmat_typed.check @@ -1,4 +1,4 @@ -virtpatmat_typed.scala:5: warning: unreachable code +virtpatmat_typed.scala:6: warning: unreachable code case x: String => println("FAILED") ^ OK foo diff --git a/test/files/run/virtpatmat_typed.flags b/test/files/run/virtpatmat_typed.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/run/virtpatmat_typed.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/run/virtpatmat_typed.scala b/test/files/run/virtpatmat_typed.scala index cdd6d3c7498f..2ac008ee2421 100644 --- a/test/files/run/virtpatmat_typed.scala +++ b/test/files/run/virtpatmat_typed.scala @@ -1,7 +1,8 @@ +// scalac: -Xexperimental object Test extends App { ("foo": Any) match { case x: Int => println("FAILED") case x: String => println("OK "+ x) case x: String => println("FAILED") } -} \ No newline at end of file +} diff --git a/test/files/run/virtpatmat_typetag.flags b/test/files/run/virtpatmat_typetag.flags deleted file mode 100644 index e8fb65d50c20..000000000000 --- a/test/files/run/virtpatmat_typetag.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings \ No newline at end of file diff --git a/test/files/run/virtpatmat_typetag.scala b/test/files/run/virtpatmat_typetag.scala index c1b1fd813a0b..87577f265831 100644 --- a/test/files/run/virtpatmat_typetag.scala +++ b/test/files/run/virtpatmat_typetag.scala @@ -1,3 +1,4 @@ +// scalac: -Xfatal-warnings import reflect.{ClassTag, classTag} trait Extractors { @@ -33,4 +34,4 @@ object Test extends App { extractorMatch[String](1) extractorMatch[Any](true) extractorMatch[String]("woele") -} \ No newline at end of file +} diff --git a/test/files/run/virtpatmat_unapply.flags b/test/files/run/virtpatmat_unapply.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/run/virtpatmat_unapply.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/run/virtpatmat_unapply.scala b/test/files/run/virtpatmat_unapply.scala index a6e71f3963d3..2d2c8be2c2e0 100644 --- a/test/files/run/virtpatmat_unapply.scala +++ b/test/files/run/virtpatmat_unapply.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental class IntList(val hd: Int, val tl: IntList) object NilIL extends IntList(0, null) object IntList { @@ -29,4 +30,4 @@ object Test extends App { Predef.this.implicitly[scala.Predef.MatchingStrategy[Option]](scala.this.Predef.OptionMatching).success[Int](x7._1)))).orElse[Int]( Predef.this.implicitly[scala.Predef.MatchingStrategy[Option]](scala.this.Predef.OptionMatching).fail) ).apply(IntList.apply(1, null)) -*/ \ No newline at end of file +*/ diff --git a/test/files/run/virtpatmat_unapplyprod.flags b/test/files/run/virtpatmat_unapplyprod.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/run/virtpatmat_unapplyprod.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/run/virtpatmat_unapplyprod.scala b/test/files/run/virtpatmat_unapplyprod.scala index 441e5e3968ff..79730e0bbde3 100644 --- a/test/files/run/virtpatmat_unapplyprod.scala +++ b/test/files/run/virtpatmat_unapplyprod.scala @@ -1,3 +1,4 @@ +// scalac: -Xexperimental object Test extends App { case class Foo(x: Int, y: String) @@ -20,4 +21,4 @@ object Test extends App { case FooSeq(1, "a") => println("nope") case FooSeq(1, "a", x@_* ) => println(x.toList) } -} \ No newline at end of file +} diff --git a/test/files/run/virtpatmat_unapplyseq.flags b/test/files/run/virtpatmat_unapplyseq.flags deleted file mode 100644 index 3f5a3100e469..000000000000 --- a/test/files/run/virtpatmat_unapplyseq.flags +++ /dev/null @@ -1 +0,0 @@ - -Xexperimental diff --git a/test/files/run/virtpatmat_unapplyseq.scala b/test/files/run/virtpatmat_unapplyseq.scala index 270fa9045ae2..4d8f92de1e7a 100644 --- a/test/files/run/virtpatmat_unapplyseq.scala +++ b/test/files/run/virtpatmat_unapplyseq.scala @@ -1,5 +1,6 @@ +// scalac: -Xexperimental object Test extends App { List(1,2,3) match { case Seq(x, y, z) => println(x * y * z) } -} \ No newline at end of file +} diff --git a/test/files/run/wacky-value-classes.flags b/test/files/run/wacky-value-classes.flags deleted file mode 100644 index 81203789bfdc..000000000000 --- a/test/files/run/wacky-value-classes.flags +++ /dev/null @@ -1 +0,0 @@ --Xverify \ No newline at end of file diff --git a/test/files/run/wacky-value-classes.scala b/test/files/run/wacky-value-classes.scala index fd230e4fbab0..66a7b953cdcb 100644 --- a/test/files/run/wacky-value-classes.scala +++ b/test/files/run/wacky-value-classes.scala @@ -1,3 +1,4 @@ +// scalac: -Xverify // scala/bug#10361 final class AnyValNothing(val self: Nothing) extends AnyVal final class AnyValNull (val self: Null ) extends AnyVal @@ -17,4 +18,4 @@ object Test extends App { /* can't really test AnyValNothing, but summon it so it gets verified */ AnyValNothing.toString -} \ No newline at end of file +} diff --git a/test/files/specialized/spec-patmatch.flags b/test/files/specialized/spec-patmatch.flags deleted file mode 100644 index a767699afd4e..000000000000 --- a/test/files/specialized/spec-patmatch.flags +++ /dev/null @@ -1 +0,0 @@ --opt:l:none \ No newline at end of file diff --git a/test/files/specialized/spec-patmatch.scala b/test/files/specialized/spec-patmatch.scala index 909629455d78..e8a4709c6ba4 100644 --- a/test/files/specialized/spec-patmatch.scala +++ b/test/files/specialized/spec-patmatch.scala @@ -1,3 +1,4 @@ +// scalac: -opt:l:none class Foo[@specialized A] { def test(x: A) = println(x match { case _: Boolean => "bool" From 1b0e8a09c391dffa2185d2029dc1aa1b571c3d2e Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Tue, 25 Aug 2020 21:21:20 +0100 Subject: [PATCH 30/46] Fix -Ydelambdafy:method-ref on a Java annotation --- .../scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala | 2 +- test/files/run/indy-meth-refs-j/I.java | 5 +++++ test/files/run/indy-meth-refs-j/test.scala | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test/files/run/indy-meth-refs-j/I.java create mode 100644 test/files/run/indy-meth-refs-j/test.scala diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala b/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala index f97a804e1ee7..1f74fa888b68 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BCodeBodyBuilder.scala @@ -1366,7 +1366,7 @@ abstract class BCodeBodyBuilder extends BCodeSkelBuilder { val lambdaTarget = originalTarget.attachments.get[JustMethodReference].map(_.lambdaTarget).getOrElse(originalTarget) def asmType(sym: Symbol) = classBTypeFromSymbol(sym).toASMType - val isInterface = lambdaTarget.owner.isTrait + val isInterface = lambdaTarget.owner.isTrait || lambdaTarget.owner.hasJavaAnnotationFlag val tag = if (lambdaTarget.isStaticMember) Opcodes.H_INVOKESTATIC else if (lambdaTarget.isPrivate) Opcodes.H_INVOKESPECIAL diff --git a/test/files/run/indy-meth-refs-j/I.java b/test/files/run/indy-meth-refs-j/I.java new file mode 100644 index 000000000000..5aa5e84b85bc --- /dev/null +++ b/test/files/run/indy-meth-refs-j/I.java @@ -0,0 +1,5 @@ +package demo; + +public @interface I { + String value(); +} diff --git a/test/files/run/indy-meth-refs-j/test.scala b/test/files/run/indy-meth-refs-j/test.scala new file mode 100644 index 000000000000..962046991744 --- /dev/null +++ b/test/files/run/indy-meth-refs-j/test.scala @@ -0,0 +1,6 @@ +// scalac: -Ydelambdafy:method-ref +object Test { + def main(args: Array[String]): Unit = { + val I_value: demo.I => String = x => x.value() + } +} From 8d913c3dd4777c23605163c7ce64840a3b7a0069 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 26 Aug 2020 16:13:24 +1000 Subject: [PATCH 31/46] Make async compiler output deterministic --- .../nsc/transform/async/LiveVariables.scala | 6 +- .../scala/tools/nsc/DeterminismTest.scala | 98 +++++++++++++++++++ 2 files changed, 101 insertions(+), 3 deletions(-) diff --git a/src/compiler/scala/tools/nsc/transform/async/LiveVariables.scala b/src/compiler/scala/tools/nsc/transform/async/LiveVariables.scala index 2623eb5e893d..b4d8de489fc8 100644 --- a/src/compiler/scala/tools/nsc/transform/async/LiveVariables.scala +++ b/src/compiler/scala/tools/nsc/transform/async/LiveVariables.scala @@ -30,7 +30,7 @@ trait LiveVariables extends ExprBuilder { def fieldsToNullOut(asyncStates: List[AsyncState], finalState: AsyncState, liftables: List[Tree]): mutable.LinkedHashMap[Int, (mutable.LinkedHashSet[Symbol], mutable.LinkedHashSet[Symbol])] = { - val liftedSyms = mutable.HashSet[Symbol]() + val liftedSyms = mutable.LinkedHashSet[Symbol]() // include only vars liftedSyms ++= liftables.iterator.collect { @@ -54,8 +54,8 @@ trait LiveVariables extends ExprBuilder { */ def fieldsUsedIn(as: AsyncState): (collection.Set[Symbol], collection.Set[Symbol]) = { class FindUseTraverser extends AsyncTraverser { - val usedBeforeAssignment = new mutable.HashSet[Symbol]() - val assignedFields = new mutable.HashSet[Symbol]() + val usedBeforeAssignment = new mutable.LinkedHashSet[Symbol]() + val assignedFields = new mutable.LinkedHashSet[Symbol]() private def capturing[A](body: => A): A = { val saved = capturing try { diff --git a/test/junit/scala/tools/nsc/DeterminismTest.scala b/test/junit/scala/tools/nsc/DeterminismTest.scala index 2fda91ccfbeb..d6880538175a 100644 --- a/test/junit/scala/tools/nsc/DeterminismTest.scala +++ b/test/junit/scala/tools/nsc/DeterminismTest.scala @@ -300,6 +300,27 @@ class DeterminismTest { test(List(code)) } + @Test def testAsync(): Unit = { + def code = List[SourceFile]( + source("a.scala", + """ + | object A { + | import scala.tools.nsc.OptionAwait.{optionally, value} + | def test = optionally { + | if (value(Some(true))) { + | var x = "" + | if (value(Some(false))) { + | value(Some(x)) + value(Some(2)) + | } + | } + | } + | } + | + """.stripMargin) + ) + test(List(code)) + } + def source(name: String, code: String): SourceFile = new BatchSourceFile(name, code) private def test(groups: List[List[SourceFile]]): Unit = { val referenceOutput = Files.createTempDirectory("reference") @@ -309,6 +330,7 @@ class DeterminismTest { g.settings.usejavacp.value = true g.settings.classpath.value = output.toAbsolutePath.toString g.settings.outputDirs.setSingleOutput(output.toString) + g.settings.async.value = true val storeReporter = new StoreReporter g.reporter = storeReporter import g._ @@ -362,3 +384,79 @@ class DeterminismTest { def permutationsWithSubsets[A](as: List[A]): List[List[A]] = as.permutations.toList.flatMap(_.inits.filter(_.nonEmpty)).distinct } + + + +import scala.annotation.compileTimeOnly +import scala.language.experimental.macros +import scala.reflect.macros.blackbox + +object OptionAwait { + def optionally[T](body: T): Option[T] = macro impl + @compileTimeOnly("[async] `value` must be enclosed in `optionally`") + def value[T](option: Option[T]): T = ??? + def impl(c: blackbox.Context)(body: c.Tree): c.Tree = { + import c.universe._ + val awaitSym = typeOf[OptionAwait.type].decl(TermName("value")) + def mark(t: DefDef): Tree = c.internal.markForAsyncTransform(c.internal.enclosingOwner, t, awaitSym, Map.empty) + val name = TypeName("stateMachine$async") + q""" + final class $name extends _root_.scala.tools.nsc.OptionStateMachine { + ${mark(q"""override def apply(tr$$async: _root_.scala.Option[_root_.scala.AnyRef]) = ${body}""")} + } + new $name().start().asInstanceOf[${c.macroApplication.tpe}] + """ + } +} + +trait AsyncStateMachine[F, R] { + /** Assign `i` to the state variable */ + protected def state_=(i: Int): Unit + /** Retrieve the current value of the state variable */ + protected def state: Int + /** Complete the state machine with the given failure. */ + protected def completeFailure(t: Throwable): Unit + /** Complete the state machine with the given value. */ + protected def completeSuccess(value: AnyRef): Unit + /** Register the state machine as a completion callback of the given future. */ + protected def onComplete(f: F): Unit + /** Extract the result of the given future if it is complete, or `null` if it is incomplete. */ + protected def getCompleted(f: F): R + /** + * Extract the success value of the given future. If the state machine detects a failure it may + * complete the async block and return `this` as a sentinel value to indicate that the caller + * (the state machine dispatch loop) should immediately exit. + */ + protected def tryGet(tr: R): AnyRef +} + + +abstract class OptionStateMachine extends AsyncStateMachine[Option[AnyRef], Option[AnyRef]] { + var result$async: Option[AnyRef] = _ + + // FSM translated method + def apply(tr$async: Option[AnyRef]): Unit + + // Required methods + private[this] var state$async: Int = 0 + protected def state: Int = state$async + protected def state_=(s: Int): Unit = state$async = s + protected def completeFailure(t: Throwable): Unit = throw t + protected def completeSuccess(value: AnyRef): Unit = result$async = Some(value) + protected def onComplete(f: Option[AnyRef]): Unit = ??? + protected def getCompleted(f: Option[AnyRef]): Option[AnyRef] = { + f + } + protected def tryGet(tr: Option[AnyRef]): AnyRef = tr match { + case Some(value) => + value.asInstanceOf[AnyRef] + case None => + result$async = None + this // sentinel value to indicate the dispatch loop should exit. + } + def start(): Option[AnyRef] = { + apply(None) + result$async + } +} + From 95f0ba07d4f866125b1ce3f562cbf5affed17984 Mon Sep 17 00:00:00 2001 From: mkeskells Date: Fri, 3 Jul 2020 17:12:44 +0100 Subject: [PATCH 32/46] don't box primitive values to call static methods on java.lang.Double/Float/Integer etc don't box primitives to call hashCode/toString copy with trees with side effect add tests to verify no boxing --- .../scala/tools/nsc/transform/CleanUp.scala | 80 ++++ .../scala/reflect/internal/Definitions.scala | 14 + .../scala/reflect/internal/StdNames.scala | 17 + test/files/run/t12062.check | 368 ++++++++++++++++++ test/files/run/t12062.scala | 124 ++++++ test/files/run/t7569.check | 9 +- .../scala/runtime/BooleanBoxingTest.scala | 49 +++ test/junit/scala/runtime/ByteBoxingTest.scala | 116 ++++++ test/junit/scala/runtime/CharBoxingTest.scala | 50 +++ .../scala/runtime/DoubleBoxingTest.scala | 223 +++++++++++ .../junit/scala/runtime/FloatBoxingTest.scala | 226 +++++++++++ test/junit/scala/runtime/IntBoxingTest.scala | 116 ++++++ test/junit/scala/runtime/LongBoxingTest.scala | 116 ++++++ .../junit/scala/runtime/ShortBoxingTest.scala | 116 ++++++ test/junit/scala/runtime/SideEffectTest.scala | 18 + .../scala/tools/testing/AllocationTest.scala | 8 +- 16 files changed, 1641 insertions(+), 9 deletions(-) create mode 100644 test/files/run/t12062.check create mode 100644 test/files/run/t12062.scala create mode 100644 test/junit/scala/runtime/BooleanBoxingTest.scala create mode 100644 test/junit/scala/runtime/ByteBoxingTest.scala create mode 100644 test/junit/scala/runtime/CharBoxingTest.scala create mode 100644 test/junit/scala/runtime/DoubleBoxingTest.scala create mode 100644 test/junit/scala/runtime/FloatBoxingTest.scala create mode 100644 test/junit/scala/runtime/IntBoxingTest.scala create mode 100644 test/junit/scala/runtime/LongBoxingTest.scala create mode 100644 test/junit/scala/runtime/ShortBoxingTest.scala create mode 100644 test/junit/scala/runtime/SideEffectTest.scala diff --git a/src/compiler/scala/tools/nsc/transform/CleanUp.scala b/src/compiler/scala/tools/nsc/transform/CleanUp.scala index fac60536d5eb..d2b6cae0968e 100644 --- a/src/compiler/scala/tools/nsc/transform/CleanUp.scala +++ b/src/compiler/scala/tools/nsc/transform/CleanUp.scala @@ -501,6 +501,67 @@ abstract class CleanUp extends Statics with Transform with ast.TreeDSL { reducingTransformListApply(rest.elems.length) { super.transform(localTyper.typedPos(tree.pos)(consed)) } + //methods on Double + //new Predef.doubleToDouble(x).isNaN() -> java.lang.Double.isNaN(x) + //new Predef.doubleToDouble(x).isInfinite() -> java.lang.Double.isInfinity(x) + //methods on Float + //new Predef.float2Float(x).isNaN() -> java.lang.Double.isNaN(x) + //new Predef.float2Float(x).isInfinite() -> java.lang.Double.isInfinity(x) + + //methods on Number + //new Predef.(x).byteValue() -> x.toByte() + //new Predef.(x).shortValue() -> x.toShort() + //new Predef.(x).intValue() -> x.toInt() + //new Predef.(x).longValue() -> x.toLong() + //new Predef.(x).floatValue() -> x.toFloat() + //new Predef.(x).doubleValue() -> x.toDouble() + // + // for each of the conversions + // double2Double + // float2Float + // byte2Byte + // short2Short + // char2Character + // int2Integer + // long2Long + // boolean2Boolean + // + case Apply(Select(Apply(boxing @ Select(qual, _), params), methodName), Nil) + if currentRun.runDefinitions.PreDef_primitives2Primitives.contains(boxing.symbol) && + params.size == 1 && + allPrimitiveMethodsToRewrite.contains(methodName) && + treeInfo.isExprSafeToInline(qual) => + val newTree = + if (doubleAndFloatRedirectMethods.contains(methodName)) { + val cls = + if (boxing.symbol == currentRun.runDefinitions.Predef_double2Double) + definitions.BoxedDoubleClass + else definitions.BoxedFloatClass + + val targetMethod = cls.companionModule.info.decl(doubleAndFloatRedirectMethods(methodName)) + gen.mkMethodCall(targetMethod, params) + } else { + gen.mkMethodCall(Select(params.head, javaNumberConversions(methodName)), Nil) + } + super.transform(localTyper.typedPos(tree.pos)(newTree)) + + //(x:Int).hashCode is transformed to scala.Int.box(x).hashCode() + //(x:Int).toString is transformed to scala.Int.box(x).toString() + // + //rewrite + // scala.Int.box(x).hashCode() -> java.lang.Integer.hashCode(x) + // scala.Int.box(x).toString() -> java.lang.Integer.toString(x) + // similarly for all primitive types + case Apply(Select(Apply(box @ Select(boxer, _), params), methodName), Nil) + if objectMethods.contains(methodName) && + params.size == 1 && + currentRun.runDefinitions.isBox(box.symbol) && + treeInfo.isExprSafeToInline(boxer) + => + val target = boxedClass(boxer.symbol.companion) + val targetMethod = target.companionModule.info.decl(methodName) + val newTree = gen.mkMethodCall(targetMethod, params) + super.transform(localTyper.typedPos(tree.pos)(newTree)) // Seq() ~> Nil (note: List() ~> Nil is rewritten in the Typer) case Apply(Select(appQual, nme.apply), List(nil)) @@ -524,4 +585,23 @@ abstract class CleanUp extends Statics with Transform with ast.TreeDSL { } // CleanUpTransformer + + private val objectMethods = Map[Name, TermName]( + nme.hashCode_ -> nme.hashCode_, + nme.toString_ -> nme.toString_ + ) + private val doubleAndFloatRedirectMethods = Map[Name, TermName]( + nme.isNaN -> nme.isNaN, + nme.isInfinite -> nme.isInfinite + ) + private val javaNumberConversions = Map[Name, TermName]( + nme.byteValue -> nme.toByte, + nme.shortValue -> nme.toShort, + nme.intValue -> nme.toInt, + nme.longValue -> nme.toLong, + nme.floatValue -> nme.toFloat, + nme.doubleValue -> nme.toDouble + ) + private val allPrimitiveMethodsToRewrite = doubleAndFloatRedirectMethods.keySet ++ javaNumberConversions.keySet + } diff --git a/src/reflect/scala/reflect/internal/Definitions.scala b/src/reflect/scala/reflect/internal/Definitions.scala index 9045e0534ca8..a5582deb1a8e 100644 --- a/src/reflect/scala/reflect/internal/Definitions.scala +++ b/src/reflect/scala/reflect/internal/Definitions.scala @@ -1584,6 +1584,20 @@ trait Definitions extends api.StandardDefinitions { lazy val Predef_conforms = (getMemberIfDefined(PredefModule, nme.conforms) orElse getMemberMethod(PredefModule, TermName("conforms"))) // TODO: predicate on -Xsource:2.10 (for now, needed for transition from M8 -> RC1) lazy val Predef_classOf = getMemberMethod(PredefModule, nme.classOf) + + lazy val Predef_double2Double = getMemberMethod(PredefModule, nme.double2Double) + lazy val Predef_float2Float = getMemberMethod(PredefModule, nme.float2Float) + lazy val Predef_byte2Byte = getMemberMethod(PredefModule, nme.byte2Byte) + lazy val Predef_short2Short = getMemberMethod(PredefModule, nme.short2Short) + lazy val Predef_char2Character = getMemberMethod(PredefModule, nme.char2Character) + lazy val Predef_int2Integer = getMemberMethod(PredefModule, nme.int2Integer) + lazy val Predef_long2Long = getMemberMethod(PredefModule, nme.long2Long) + lazy val Predef_boolean2Boolean = getMemberMethod(PredefModule, nme.boolean2Boolean) + + lazy val PreDef_primitives2Primitives = + Set[Symbol](Predef_double2Double, Predef_float2Float, Predef_byte2Byte, Predef_short2Short, + Predef_char2Character, Predef_int2Integer, Predef_long2Long, Predef_boolean2Boolean) + lazy val Predef_implicitly = getMemberMethod(PredefModule, nme.implicitly) lazy val Predef_wrapRefArray = getMemberMethod(PredefModule, nme.wrapRefArray) lazy val Predef_??? = DefinitionsClass.this.Predef_??? diff --git a/src/reflect/scala/reflect/internal/StdNames.scala b/src/reflect/scala/reflect/internal/StdNames.scala index ea7f4428f13b..52c6d6aaedad 100644 --- a/src/reflect/scala/reflect/internal/StdNames.scala +++ b/src/reflect/scala/reflect/internal/StdNames.scala @@ -618,6 +618,15 @@ trait StdNames { val wrapUnitArray: NameType = "wrapUnitArray" val genericWrapArray: NameType = "genericWrapArray" + val double2Double: NameType = "double2Double" + val float2Float: NameType = "float2Float" + val byte2Byte: NameType = "byte2Byte" + val short2Short: NameType = "short2Short" + val char2Character: NameType = "char2Character" + val int2Integer: NameType = "int2Integer" + val long2Long: NameType = "long2Long" + val boolean2Boolean: NameType = "boolean2Boolean" + // Compiler utilized names val AnnotatedType: NameType = "AnnotatedType" @@ -688,6 +697,7 @@ trait StdNames { val async : NameType = "async" val await : NameType = "await" val box: NameType = "box" + val byteValue: NameType = "byteValue" val bytes: NameType = "bytes" val c: NameType = "c" val canEqual_ : NameType = "canEqual" @@ -702,6 +712,7 @@ trait StdNames { val delayedInitArg: NameType = "delayedInit$body" val dollarScope: NameType = "$scope" val doubleHash: NameType = "doubleHash" + val doubleValue: NameType = "doubleValue" val drop: NameType = "drop" val elem: NameType = "elem" val noSelfType: NameType = "noSelfType" @@ -722,6 +733,7 @@ trait StdNames { val find_ : NameType = "find" val flatMap: NameType = "flatMap" val floatHash: NameType = "floatHash" + val floatValue: NameType = "floatValue" val foreach: NameType = "foreach" val freshTermName: NameType = "freshTermName" val freshTypeName: NameType = "freshTypeName" @@ -735,12 +747,15 @@ trait StdNames { val initialize : NameType = "initialize" val initialized : NameType = "initialized" val internal: NameType = "internal" + val intValue: NameType = "intValue" val inlinedEquals: NameType = "inlinedEquals" val isArray: NameType = "isArray" val isDefinedAt: NameType = "isDefinedAt" val isEmpty: NameType = "isEmpty" + val isInfinite: NameType = "isInfinite" val isInstanceOf_ : NameType = "isInstanceOf" val isInstanceOf_Ob : NameType = "$isInstanceOf" + val isNaN: NameType = "isNaN" val java: NameType = "java" val key: NameType = "key" val lang: NameType = "lang" @@ -748,6 +763,7 @@ trait StdNames { val lengthCompare: NameType = "lengthCompare" val locally: NameType = "locally" val longHash: NameType = "longHash" + val longValue: NameType = "longValue" val macroContext : NameType = "c" val main: NameType = "main" val manifestToTypeTag: NameType = "manifestToTypeTag" @@ -799,6 +815,7 @@ trait StdNames { val setInfo: NameType = "setInfo" val setSymbol: NameType = "setSymbol" val setType: NameType = "setType" + val shortValue: NameType = "shortValue" val splice: NameType = "splice" val staticClass : NameType = "staticClass" val staticModule : NameType = "staticModule" diff --git a/test/files/run/t12062.check b/test/files/run/t12062.check new file mode 100644 index 000000000000..aa2553416c7b --- /dev/null +++ b/test/files/run/t12062.check @@ -0,0 +1,368 @@ + +class TestByte +source-newSource1.scala,line-29 TestByte.super.() +source-newSource1.scala,line-3 1.toByte() +source-newSource1.scala,line-6 java.lang.Byte.toString(TestByte.this.value()) +source-newSource1.scala,line-6 TestByte.this.value() +source-newSource1.scala,line-7 java.lang.Byte.hashCode(TestByte.this.value()) +source-newSource1.scala,line-7 TestByte.this.value() +source-newSource1.scala,line-8 TestByte.this.value().$asInstanceOf[Int]() +source-newSource1.scala,line-8 TestByte.this.value() +source-newSource1.scala,line-10 TestByte.this.value().toFloat() +source-newSource1.scala,line-10 TestByte.this.value() +source-newSource1.scala,line-11 TestByte.this.value().toDouble() +source-newSource1.scala,line-11 TestByte.this.value() +source-newSource1.scala,line-12 TestByte.this.value().toLong() +source-newSource1.scala,line-12 TestByte.this.value() +source-newSource1.scala,line-13 TestByte.this.value().toInt() +source-newSource1.scala,line-13 TestByte.this.value() +source-newSource1.scala,line-14 TestByte.this.value().toShort() +source-newSource1.scala,line-14 TestByte.this.value() +source-newSource1.scala,line-15 TestByte.this.value().toByte() +source-newSource1.scala,line-15 TestByte.this.value() +source-newSource1.scala,line-17 scala.runtime.RichByte.max$extension(scala.Predef.byteWrapper(TestByte.this.value()), TestByte.this.value()) +source-newSource1.scala,line-17 scala.Predef.byteWrapper(TestByte.this.value()) +source-newSource1.scala,line-17 TestByte.this.value() +source-newSource1.scala,line-17 TestByte.this.value() +source-newSource1.scala,line-18 scala.runtime.RichByte.min$extension(scala.Predef.byteWrapper(TestByte.this.value()), TestByte.this.value()) +source-newSource1.scala,line-18 scala.Predef.byteWrapper(TestByte.this.value()) +source-newSource1.scala,line-18 TestByte.this.value() +source-newSource1.scala,line-18 TestByte.this.value() +source-newSource1.scala,line-19 scala.runtime.RichByte.abs$extension(scala.Predef.byteWrapper(TestByte.this.value())) +source-newSource1.scala,line-19 scala.Predef.byteWrapper(TestByte.this.value()) +source-newSource1.scala,line-19 TestByte.this.value() +source-newSource1.scala,line-20 scala.runtime.RichByte.signum$extension(scala.Predef.byteWrapper(TestByte.this.value())) +source-newSource1.scala,line-20 scala.Predef.byteWrapper(TestByte.this.value()) +source-newSource1.scala,line-20 TestByte.this.value() +source-newSource1.scala,line-22 TestByte.this.value().toByte() +source-newSource1.scala,line-22 TestByte.this.value() +source-newSource1.scala,line-23 TestByte.this.value().toShort() +source-newSource1.scala,line-23 TestByte.this.value() +source-newSource1.scala,line-24 TestByte.this.value().toInt() +source-newSource1.scala,line-24 TestByte.this.value() +source-newSource1.scala,line-25 TestByte.this.value().toLong() +source-newSource1.scala,line-25 TestByte.this.value() +source-newSource1.scala,line-26 TestByte.this.value().toFloat() +source-newSource1.scala,line-26 TestByte.this.value() +source-newSource1.scala,line-27 TestByte.this.value().toDouble() +source-newSource1.scala,line-27 TestByte.this.value() + + +class TestShort +source-newSource2.scala,line-29 TestShort.super.() +source-newSource2.scala,line-3 1.toShort() +source-newSource2.scala,line-6 java.lang.Short.toString(TestShort.this.value()) +source-newSource2.scala,line-6 TestShort.this.value() +source-newSource2.scala,line-7 java.lang.Short.hashCode(TestShort.this.value()) +source-newSource2.scala,line-7 TestShort.this.value() +source-newSource2.scala,line-8 TestShort.this.value().$asInstanceOf[Int]() +source-newSource2.scala,line-8 TestShort.this.value() +source-newSource2.scala,line-10 TestShort.this.value().toFloat() +source-newSource2.scala,line-10 TestShort.this.value() +source-newSource2.scala,line-11 TestShort.this.value().toDouble() +source-newSource2.scala,line-11 TestShort.this.value() +source-newSource2.scala,line-12 TestShort.this.value().toLong() +source-newSource2.scala,line-12 TestShort.this.value() +source-newSource2.scala,line-13 TestShort.this.value().toInt() +source-newSource2.scala,line-13 TestShort.this.value() +source-newSource2.scala,line-14 TestShort.this.value().toShort() +source-newSource2.scala,line-14 TestShort.this.value() +source-newSource2.scala,line-15 TestShort.this.value().toByte() +source-newSource2.scala,line-15 TestShort.this.value() +source-newSource2.scala,line-17 scala.runtime.RichShort.max$extension(scala.Predef.shortWrapper(TestShort.this.value()), TestShort.this.value()) +source-newSource2.scala,line-17 scala.Predef.shortWrapper(TestShort.this.value()) +source-newSource2.scala,line-17 TestShort.this.value() +source-newSource2.scala,line-17 TestShort.this.value() +source-newSource2.scala,line-18 scala.runtime.RichShort.min$extension(scala.Predef.shortWrapper(TestShort.this.value()), TestShort.this.value()) +source-newSource2.scala,line-18 scala.Predef.shortWrapper(TestShort.this.value()) +source-newSource2.scala,line-18 TestShort.this.value() +source-newSource2.scala,line-18 TestShort.this.value() +source-newSource2.scala,line-19 scala.runtime.RichShort.abs$extension(scala.Predef.shortWrapper(TestShort.this.value())) +source-newSource2.scala,line-19 scala.Predef.shortWrapper(TestShort.this.value()) +source-newSource2.scala,line-19 TestShort.this.value() +source-newSource2.scala,line-20 scala.runtime.RichShort.signum$extension(scala.Predef.shortWrapper(TestShort.this.value())) +source-newSource2.scala,line-20 scala.Predef.shortWrapper(TestShort.this.value()) +source-newSource2.scala,line-20 TestShort.this.value() +source-newSource2.scala,line-22 TestShort.this.value().toByte() +source-newSource2.scala,line-22 TestShort.this.value() +source-newSource2.scala,line-23 TestShort.this.value().toShort() +source-newSource2.scala,line-23 TestShort.this.value() +source-newSource2.scala,line-24 TestShort.this.value().toInt() +source-newSource2.scala,line-24 TestShort.this.value() +source-newSource2.scala,line-25 TestShort.this.value().toLong() +source-newSource2.scala,line-25 TestShort.this.value() +source-newSource2.scala,line-26 TestShort.this.value().toFloat() +source-newSource2.scala,line-26 TestShort.this.value() +source-newSource2.scala,line-27 TestShort.this.value().toDouble() +source-newSource2.scala,line-27 TestShort.this.value() + + +class TestInt +source-newSource3.scala,line-29 TestInt.super.() +source-newSource3.scala,line-3 1.toInt() +source-newSource3.scala,line-6 java.lang.Integer.toString(TestInt.this.value()) +source-newSource3.scala,line-6 TestInt.this.value() +source-newSource3.scala,line-7 java.lang.Integer.hashCode(TestInt.this.value()) +source-newSource3.scala,line-7 TestInt.this.value() +source-newSource3.scala,line-8 TestInt.this.value() +source-newSource3.scala,line-10 TestInt.this.value().toFloat() +source-newSource3.scala,line-10 TestInt.this.value() +source-newSource3.scala,line-11 TestInt.this.value().toDouble() +source-newSource3.scala,line-11 TestInt.this.value() +source-newSource3.scala,line-12 TestInt.this.value().toLong() +source-newSource3.scala,line-12 TestInt.this.value() +source-newSource3.scala,line-13 TestInt.this.value().toInt() +source-newSource3.scala,line-13 TestInt.this.value() +source-newSource3.scala,line-14 TestInt.this.value().toShort() +source-newSource3.scala,line-14 TestInt.this.value() +source-newSource3.scala,line-15 TestInt.this.value().toByte() +source-newSource3.scala,line-15 TestInt.this.value() +source-newSource3.scala,line-17 scala.runtime.RichInt.max$extension(scala.Predef.intWrapper(TestInt.this.value()), TestInt.this.value()) +source-newSource3.scala,line-17 scala.Predef.intWrapper(TestInt.this.value()) +source-newSource3.scala,line-17 TestInt.this.value() +source-newSource3.scala,line-17 TestInt.this.value() +source-newSource3.scala,line-18 scala.runtime.RichInt.min$extension(scala.Predef.intWrapper(TestInt.this.value()), TestInt.this.value()) +source-newSource3.scala,line-18 scala.Predef.intWrapper(TestInt.this.value()) +source-newSource3.scala,line-18 TestInt.this.value() +source-newSource3.scala,line-18 TestInt.this.value() +source-newSource3.scala,line-19 scala.runtime.RichInt.abs$extension(scala.Predef.intWrapper(TestInt.this.value())) +source-newSource3.scala,line-19 scala.Predef.intWrapper(TestInt.this.value()) +source-newSource3.scala,line-19 TestInt.this.value() +source-newSource3.scala,line-20 scala.runtime.RichInt.signum$extension(scala.Predef.intWrapper(TestInt.this.value())) +source-newSource3.scala,line-20 scala.Predef.intWrapper(TestInt.this.value()) +source-newSource3.scala,line-20 TestInt.this.value() +source-newSource3.scala,line-22 TestInt.this.value().toByte() +source-newSource3.scala,line-22 TestInt.this.value() +source-newSource3.scala,line-23 TestInt.this.value().toShort() +source-newSource3.scala,line-23 TestInt.this.value() +source-newSource3.scala,line-24 TestInt.this.value().toInt() +source-newSource3.scala,line-24 TestInt.this.value() +source-newSource3.scala,line-25 TestInt.this.value().toLong() +source-newSource3.scala,line-25 TestInt.this.value() +source-newSource3.scala,line-26 TestInt.this.value().toFloat() +source-newSource3.scala,line-26 TestInt.this.value() +source-newSource3.scala,line-27 TestInt.this.value().toDouble() +source-newSource3.scala,line-27 TestInt.this.value() + + +class TestLong +source-newSource4.scala,line-29 TestLong.super.() +source-newSource4.scala,line-3 1.toLong() +source-newSource4.scala,line-6 java.lang.Long.toString(TestLong.this.value()) +source-newSource4.scala,line-6 TestLong.this.value() +source-newSource4.scala,line-7 java.lang.Long.hashCode(TestLong.this.value()) +source-newSource4.scala,line-7 TestLong.this.value() +source-newSource4.scala,line-8 scala.runtime.Statics.longHash(TestLong.this.value()) +source-newSource4.scala,line-8 TestLong.this.value() +source-newSource4.scala,line-10 TestLong.this.value().toFloat() +source-newSource4.scala,line-10 TestLong.this.value() +source-newSource4.scala,line-11 TestLong.this.value().toDouble() +source-newSource4.scala,line-11 TestLong.this.value() +source-newSource4.scala,line-12 TestLong.this.value().toLong() +source-newSource4.scala,line-12 TestLong.this.value() +source-newSource4.scala,line-13 TestLong.this.value().toInt() +source-newSource4.scala,line-13 TestLong.this.value() +source-newSource4.scala,line-14 TestLong.this.value().toShort() +source-newSource4.scala,line-14 TestLong.this.value() +source-newSource4.scala,line-15 TestLong.this.value().toByte() +source-newSource4.scala,line-15 TestLong.this.value() +source-newSource4.scala,line-17 scala.runtime.RichLong.max$extension(scala.Predef.longWrapper(TestLong.this.value()), TestLong.this.value()) +source-newSource4.scala,line-17 scala.Predef.longWrapper(TestLong.this.value()) +source-newSource4.scala,line-17 TestLong.this.value() +source-newSource4.scala,line-17 TestLong.this.value() +source-newSource4.scala,line-18 scala.runtime.RichLong.min$extension(scala.Predef.longWrapper(TestLong.this.value()), TestLong.this.value()) +source-newSource4.scala,line-18 scala.Predef.longWrapper(TestLong.this.value()) +source-newSource4.scala,line-18 TestLong.this.value() +source-newSource4.scala,line-18 TestLong.this.value() +source-newSource4.scala,line-19 scala.runtime.RichLong.abs$extension(scala.Predef.longWrapper(TestLong.this.value())) +source-newSource4.scala,line-19 scala.Predef.longWrapper(TestLong.this.value()) +source-newSource4.scala,line-19 TestLong.this.value() +source-newSource4.scala,line-20 scala.runtime.RichLong.signum$extension(scala.Predef.longWrapper(TestLong.this.value())) +source-newSource4.scala,line-20 scala.Predef.longWrapper(TestLong.this.value()) +source-newSource4.scala,line-20 TestLong.this.value() +source-newSource4.scala,line-22 TestLong.this.value().toByte() +source-newSource4.scala,line-22 TestLong.this.value() +source-newSource4.scala,line-23 TestLong.this.value().toShort() +source-newSource4.scala,line-23 TestLong.this.value() +source-newSource4.scala,line-24 TestLong.this.value().toInt() +source-newSource4.scala,line-24 TestLong.this.value() +source-newSource4.scala,line-25 TestLong.this.value().toLong() +source-newSource4.scala,line-25 TestLong.this.value() +source-newSource4.scala,line-26 TestLong.this.value().toFloat() +source-newSource4.scala,line-26 TestLong.this.value() +source-newSource4.scala,line-27 TestLong.this.value().toDouble() +source-newSource4.scala,line-27 TestLong.this.value() + + +class TestBoolean +source-newSource5.scala,line-9 TestBoolean.super.() +source-newSource5.scala,line-6 java.lang.Boolean.toString(TestBoolean.this.value()) +source-newSource5.scala,line-6 TestBoolean.this.value() +source-newSource5.scala,line-7 java.lang.Boolean.hashCode(TestBoolean.this.value()) +source-newSource5.scala,line-7 TestBoolean.this.value() +source-newSource5.scala,line-8 TestBoolean.this.value() + + +class TestChar +source-newSource6.scala,line-9 TestChar.super.() +source-newSource6.scala,line-6 java.lang.Character.toString(TestChar.this.value()) +source-newSource6.scala,line-6 TestChar.this.value() +source-newSource6.scala,line-7 java.lang.Character.hashCode(TestChar.this.value()) +source-newSource6.scala,line-7 TestChar.this.value() +source-newSource6.scala,line-8 TestChar.this.value().$asInstanceOf[Int]() +source-newSource6.scala,line-8 TestChar.this.value() + + +class TestFloat +source-newSource7.scala,line-40 TestFloat.super.() +source-newSource7.scala,line-3 1.toFloat() +source-newSource7.scala,line-6 java.lang.Float.toString(TestFloat.this.value()) +source-newSource7.scala,line-6 TestFloat.this.value() +source-newSource7.scala,line-7 java.lang.Float.hashCode(TestFloat.this.value()) +source-newSource7.scala,line-7 TestFloat.this.value() +source-newSource7.scala,line-8 scala.runtime.Statics.floatHash(TestFloat.this.value()) +source-newSource7.scala,line-8 TestFloat.this.value() +source-newSource7.scala,line-10 java.lang.Float.isNaN(TestFloat.this.value()) +source-newSource7.scala,line-10 TestFloat.this.value() +source-newSource7.scala,line-11 scala.runtime.RichFloat.isInfinity$extension(scala.Predef.floatWrapper(TestFloat.this.value())) +source-newSource7.scala,line-11 scala.Predef.floatWrapper(TestFloat.this.value()) +source-newSource7.scala,line-11 TestFloat.this.value() +source-newSource7.scala,line-12 java.lang.Float.isInfinite(TestFloat.this.value()) +source-newSource7.scala,line-12 TestFloat.this.value() +source-newSource7.scala,line-13 scala.runtime.RichFloat.isNegInfinity$extension(scala.Predef.floatWrapper(TestFloat.this.value())) +source-newSource7.scala,line-13 scala.Predef.floatWrapper(TestFloat.this.value()) +source-newSource7.scala,line-13 TestFloat.this.value() +source-newSource7.scala,line-14 scala.runtime.RichFloat.isPosInfinity$extension(scala.Predef.floatWrapper(TestFloat.this.value())) +source-newSource7.scala,line-14 scala.Predef.floatWrapper(TestFloat.this.value()) +source-newSource7.scala,line-14 TestFloat.this.value() +source-newSource7.scala,line-16 TestFloat.this.value().toFloat() +source-newSource7.scala,line-16 TestFloat.this.value() +source-newSource7.scala,line-17 TestFloat.this.value().toDouble() +source-newSource7.scala,line-17 TestFloat.this.value() +source-newSource7.scala,line-18 TestFloat.this.value().toLong() +source-newSource7.scala,line-18 TestFloat.this.value() +source-newSource7.scala,line-19 TestFloat.this.value().toInt() +source-newSource7.scala,line-19 TestFloat.this.value() +source-newSource7.scala,line-20 TestFloat.this.value().toShort() +source-newSource7.scala,line-20 TestFloat.this.value() +source-newSource7.scala,line-21 TestFloat.this.value().toByte() +source-newSource7.scala,line-21 TestFloat.this.value() +source-newSource7.scala,line-23 scala.runtime.RichFloat.max$extension(scala.Predef.floatWrapper(TestFloat.this.value()), TestFloat.this.value()) +source-newSource7.scala,line-23 scala.Predef.floatWrapper(TestFloat.this.value()) +source-newSource7.scala,line-23 TestFloat.this.value() +source-newSource7.scala,line-23 TestFloat.this.value() +source-newSource7.scala,line-24 scala.runtime.RichFloat.min$extension(scala.Predef.floatWrapper(TestFloat.this.value()), TestFloat.this.value()) +source-newSource7.scala,line-24 scala.Predef.floatWrapper(TestFloat.this.value()) +source-newSource7.scala,line-24 TestFloat.this.value() +source-newSource7.scala,line-24 TestFloat.this.value() +source-newSource7.scala,line-25 scala.runtime.RichFloat.abs$extension(scala.Predef.floatWrapper(TestFloat.this.value())) +source-newSource7.scala,line-25 scala.Predef.floatWrapper(TestFloat.this.value()) +source-newSource7.scala,line-25 TestFloat.this.value() +source-newSource7.scala,line-26 scala.runtime.RichFloat.signum$extension(scala.Predef.floatWrapper(TestFloat.this.value())) +source-newSource7.scala,line-26 scala.Predef.floatWrapper(TestFloat.this.value()) +source-newSource7.scala,line-26 TestFloat.this.value() +source-newSource7.scala,line-27 scala.runtime.RichFloat.round$extension(scala.Predef.floatWrapper(TestFloat.this.value())) +source-newSource7.scala,line-27 scala.Predef.floatWrapper(TestFloat.this.value()) +source-newSource7.scala,line-27 TestFloat.this.value() +source-newSource7.scala,line-28 scala.runtime.RichFloat.ceil$extension(scala.Predef.floatWrapper(TestFloat.this.value())) +source-newSource7.scala,line-28 scala.Predef.floatWrapper(TestFloat.this.value()) +source-newSource7.scala,line-28 TestFloat.this.value() +source-newSource7.scala,line-29 scala.runtime.RichFloat.floor$extension(scala.Predef.floatWrapper(TestFloat.this.value())) +source-newSource7.scala,line-29 scala.Predef.floatWrapper(TestFloat.this.value()) +source-newSource7.scala,line-29 TestFloat.this.value() +source-newSource7.scala,line-30 scala.runtime.RichFloat.toRadians$extension(scala.Predef.floatWrapper(TestFloat.this.value())) +source-newSource7.scala,line-30 scala.Predef.floatWrapper(TestFloat.this.value()) +source-newSource7.scala,line-30 TestFloat.this.value() +source-newSource7.scala,line-31 scala.runtime.RichFloat.toDegrees$extension(scala.Predef.floatWrapper(TestFloat.this.value())) +source-newSource7.scala,line-31 scala.Predef.floatWrapper(TestFloat.this.value()) +source-newSource7.scala,line-31 TestFloat.this.value() +source-newSource7.scala,line-33 TestFloat.this.value().toByte() +source-newSource7.scala,line-33 TestFloat.this.value() +source-newSource7.scala,line-34 TestFloat.this.value().toShort() +source-newSource7.scala,line-34 TestFloat.this.value() +source-newSource7.scala,line-35 TestFloat.this.value().toInt() +source-newSource7.scala,line-35 TestFloat.this.value() +source-newSource7.scala,line-36 TestFloat.this.value().toLong() +source-newSource7.scala,line-36 TestFloat.this.value() +source-newSource7.scala,line-37 TestFloat.this.value().toFloat() +source-newSource7.scala,line-37 TestFloat.this.value() +source-newSource7.scala,line-38 TestFloat.this.value().toDouble() +source-newSource7.scala,line-38 TestFloat.this.value() + + +class TestDouble +source-newSource8.scala,line-40 TestDouble.super.() +source-newSource8.scala,line-3 1.toDouble() +source-newSource8.scala,line-6 java.lang.Double.toString(TestDouble.this.value()) +source-newSource8.scala,line-6 TestDouble.this.value() +source-newSource8.scala,line-7 java.lang.Double.hashCode(TestDouble.this.value()) +source-newSource8.scala,line-7 TestDouble.this.value() +source-newSource8.scala,line-8 scala.runtime.Statics.doubleHash(TestDouble.this.value()) +source-newSource8.scala,line-8 TestDouble.this.value() +source-newSource8.scala,line-10 java.lang.Double.isNaN(TestDouble.this.value()) +source-newSource8.scala,line-10 TestDouble.this.value() +source-newSource8.scala,line-11 scala.runtime.RichDouble.isInfinity$extension(scala.Predef.doubleWrapper(TestDouble.this.value())) +source-newSource8.scala,line-11 scala.Predef.doubleWrapper(TestDouble.this.value()) +source-newSource8.scala,line-11 TestDouble.this.value() +source-newSource8.scala,line-12 java.lang.Double.isInfinite(TestDouble.this.value()) +source-newSource8.scala,line-12 TestDouble.this.value() +source-newSource8.scala,line-13 scala.runtime.RichDouble.isNegInfinity$extension(scala.Predef.doubleWrapper(TestDouble.this.value())) +source-newSource8.scala,line-13 scala.Predef.doubleWrapper(TestDouble.this.value()) +source-newSource8.scala,line-13 TestDouble.this.value() +source-newSource8.scala,line-14 scala.runtime.RichDouble.isPosInfinity$extension(scala.Predef.doubleWrapper(TestDouble.this.value())) +source-newSource8.scala,line-14 scala.Predef.doubleWrapper(TestDouble.this.value()) +source-newSource8.scala,line-14 TestDouble.this.value() +source-newSource8.scala,line-16 TestDouble.this.value().toFloat() +source-newSource8.scala,line-16 TestDouble.this.value() +source-newSource8.scala,line-17 TestDouble.this.value().toDouble() +source-newSource8.scala,line-17 TestDouble.this.value() +source-newSource8.scala,line-18 TestDouble.this.value().toLong() +source-newSource8.scala,line-18 TestDouble.this.value() +source-newSource8.scala,line-19 TestDouble.this.value().toInt() +source-newSource8.scala,line-19 TestDouble.this.value() +source-newSource8.scala,line-20 TestDouble.this.value().toShort() +source-newSource8.scala,line-20 TestDouble.this.value() +source-newSource8.scala,line-21 TestDouble.this.value().toByte() +source-newSource8.scala,line-21 TestDouble.this.value() +source-newSource8.scala,line-23 scala.runtime.RichDouble.max$extension(scala.Predef.doubleWrapper(TestDouble.this.value()), TestDouble.this.value()) +source-newSource8.scala,line-23 scala.Predef.doubleWrapper(TestDouble.this.value()) +source-newSource8.scala,line-23 TestDouble.this.value() +source-newSource8.scala,line-23 TestDouble.this.value() +source-newSource8.scala,line-24 scala.runtime.RichDouble.min$extension(scala.Predef.doubleWrapper(TestDouble.this.value()), TestDouble.this.value()) +source-newSource8.scala,line-24 scala.Predef.doubleWrapper(TestDouble.this.value()) +source-newSource8.scala,line-24 TestDouble.this.value() +source-newSource8.scala,line-24 TestDouble.this.value() +source-newSource8.scala,line-25 scala.runtime.RichDouble.abs$extension(scala.Predef.doubleWrapper(TestDouble.this.value())) +source-newSource8.scala,line-25 scala.Predef.doubleWrapper(TestDouble.this.value()) +source-newSource8.scala,line-25 TestDouble.this.value() +source-newSource8.scala,line-26 scala.runtime.RichDouble.signum$extension(scala.Predef.doubleWrapper(TestDouble.this.value())) +source-newSource8.scala,line-26 scala.Predef.doubleWrapper(TestDouble.this.value()) +source-newSource8.scala,line-26 TestDouble.this.value() +source-newSource8.scala,line-27 scala.runtime.RichDouble.round$extension(scala.Predef.doubleWrapper(TestDouble.this.value())) +source-newSource8.scala,line-27 scala.Predef.doubleWrapper(TestDouble.this.value()) +source-newSource8.scala,line-27 TestDouble.this.value() +source-newSource8.scala,line-28 scala.runtime.RichDouble.ceil$extension(scala.Predef.doubleWrapper(TestDouble.this.value())) +source-newSource8.scala,line-28 scala.Predef.doubleWrapper(TestDouble.this.value()) +source-newSource8.scala,line-28 TestDouble.this.value() +source-newSource8.scala,line-29 scala.runtime.RichDouble.floor$extension(scala.Predef.doubleWrapper(TestDouble.this.value())) +source-newSource8.scala,line-29 scala.Predef.doubleWrapper(TestDouble.this.value()) +source-newSource8.scala,line-29 TestDouble.this.value() +source-newSource8.scala,line-30 scala.runtime.RichDouble.toRadians$extension(scala.Predef.doubleWrapper(TestDouble.this.value())) +source-newSource8.scala,line-30 scala.Predef.doubleWrapper(TestDouble.this.value()) +source-newSource8.scala,line-30 TestDouble.this.value() +source-newSource8.scala,line-31 scala.runtime.RichDouble.toDegrees$extension(scala.Predef.doubleWrapper(TestDouble.this.value())) +source-newSource8.scala,line-31 scala.Predef.doubleWrapper(TestDouble.this.value()) +source-newSource8.scala,line-31 TestDouble.this.value() +source-newSource8.scala,line-33 TestDouble.this.value().toByte() +source-newSource8.scala,line-33 TestDouble.this.value() +source-newSource8.scala,line-34 TestDouble.this.value().toShort() +source-newSource8.scala,line-34 TestDouble.this.value() +source-newSource8.scala,line-35 TestDouble.this.value().toInt() +source-newSource8.scala,line-35 TestDouble.this.value() +source-newSource8.scala,line-36 TestDouble.this.value().toLong() +source-newSource8.scala,line-36 TestDouble.this.value() +source-newSource8.scala,line-37 TestDouble.this.value().toFloat() +source-newSource8.scala,line-37 TestDouble.this.value() +source-newSource8.scala,line-38 TestDouble.this.value().toDouble() +source-newSource8.scala,line-38 TestDouble.this.value() + diff --git a/test/files/run/t12062.scala b/test/files/run/t12062.scala new file mode 100644 index 000000000000..95867d1ec8b4 --- /dev/null +++ b/test/files/run/t12062.scala @@ -0,0 +1,124 @@ +import scala.tools.partest._ +object Test extends CompilerTest { + import global._ + override def extraSettings = super.extraSettings + " -Yrangepos" + override def sources = List( + number("TestByte", "val value:Byte = 1.toByte"), + number("TestShort", "val value:Short = 1.toShort"), + number("TestInt", "val value:Int = 1.toInt"), + number("TestLong", "val value:Long = 1.toLong"), + primatives("TestBoolean", "val value: Boolean = true"), + primatives("TestChar", "val value:Char = 'x'"), + floating("TestFloat", "val value:Float = 1.toFloat"), + floating("TestDouble", "val value:Double = 1.toDouble") + ) + def primatives(className: String, decl: String) = { + s"""| + |class $className { + | $decl + | + | + | val a1 = value.toString + | val a2 = value.hashCode + | val a3 = value.## + |}""".stripMargin + + } + def number(className: String, decl: String) = { + s"""| + |class $className { + | $decl + | + | + | val a1 = value.toString + | val a2 = value.hashCode + | val a3 = value.## + | + | val c1 = value.floatValue + | val c2 = value.doubleValue + | val c3 = value.longValue + | val c4 = value.intValue + | val c5 = value.shortValue + | val c6 = value.byteValue + | + | val d1 = value max value + | val d2 = value min value + | val d3 = value.abs + | val d4 = value.signum + | + | val e1 = value.toByte + | val e2 = value.toShort + | val e3 = value.toInt + | val e4 = value.toLong + | val e5 = value.toFloat + | val e6 = value.toDouble + | + |}""".stripMargin + + } + def floating(className: String, decl: String) = { + 1.abs + s"""| + |class $className { + | $decl + | + | + | val a1 = value.toString + | val a2 = value.hashCode + | val a3 = value.## + | + | val b1 = value.isNaN + | val b2 = value.isInfinity + | val b3 = value.isInfinite + | val b4 = value.isNegInfinity + | val b5 = value.isPosInfinity + | + | val c1 = value.floatValue + | val c2 = value.doubleValue + | val c3 = value.longValue + | val c4 = value.intValue + | val c5 = value.shortValue + | val c6 = value.byteValue + | + | val d1 = value max value + | val d2 = value min value + | val d3 = value.abs + | val d4 = value.signum + | val d5 = value.round + | val d6 = value.ceil + | val d7 = value.floor + | val d8 = value.toRadians + | val d9 = value.toDegrees + | + | val e1 = value.toByte + | val e2 = value.toShort + | val e3 = value.toInt + | val e4 = value.toLong + | val e5 = value.toFloat + | val e6 = value.toDouble + | + |}""".stripMargin + + } + def check(source: String, unit: CompilationUnit) { + //really we are checking for calls tht box things + //e.g. + // scala.Int.box + // doubletoDouble etc + // easest way to see this is to print all the efs, and that should show any references + println() + for (ClassDef(_, className, _, Template(_, _, stats)) <- unit.body) { + println(s"class $className") + for (stat <- stats; + t <- stat) { + t match { + case _: Apply => + val pos = t.pos + println(s"source-${pos.source.path},line-${pos.line} $t") + case _ => + } + } + } + println() + } +} diff --git a/test/files/run/t7569.check b/test/files/run/t7569.check index 98513c3ab209..5153e9d6a4e9 100644 --- a/test/files/run/t7569.check +++ b/test/files/run/t7569.check @@ -5,8 +5,7 @@ source-newSource1.scala,line-4,offset=67 A.super. source-newSource1.scala,line-4,offset=67 this source-newSource1.scala,line-3,offset=49 A.this.one source-newSource1.scala,line-3,offset=49 A.this -RangePosition(newSource1.scala, 55, 57, 65) scala.Int.box(1).toString() -RangePosition(newSource1.scala, 55, 57, 65) scala.Int.box(1).toString -RangePosition(newSource1.scala, 55, 55, 56) scala.Int.box(1) -NoPosition scala.Int.box -NoPosition scala.Int +RangePosition(newSource1.scala, 55, 57, 65) java.lang.Integer.toString(1) +source-newSource1.scala,line-3,offset=57 java.lang.Integer.toString +source-newSource1.scala,line-3,offset=57 java.lang.Integer +source-newSource1.scala,line-3,offset=57 java.lang diff --git a/test/junit/scala/runtime/BooleanBoxingTest.scala b/test/junit/scala/runtime/BooleanBoxingTest.scala new file mode 100644 index 000000000000..c3682f62b216 --- /dev/null +++ b/test/junit/scala/runtime/BooleanBoxingTest.scala @@ -0,0 +1,49 @@ +package scala.runtime + +import org.junit.Test +import org.junit.Assert._ + +import scala.tools.testing.AllocationTest + +class BooleanBoxingTest extends SideEffectTest with AllocationTest{ + val value = true + + @Test def hash1(): Unit = { + nonAllocating(value.hashCode()) + } + + @Test def hash2(): Unit = { + nonAllocating(value.##) + } + + @Test def str(): Unit = { + val cost = allocationInfo(java.lang.Boolean.toString(value), "", false) + assertEquals("true", exactAllocates(cost.min)(value.toString())) + } + + //check that any rewrites don't skip side effects + @Test def hash1_SideEffect1(): Unit = { + {sideEffect; value}.hashCode() + checkSideEffected + } + @Test def hash1_SideEffect2(): Unit = { + {sideEffect; Predef}.boolean2Boolean(value).hashCode() + checkSideEffected + } + + @Test def hash2_SideEffect(): Unit = { + {sideEffect; value}.## + checkSideEffected + } + + @Test def str_SideEffect1(): Unit = { + {sideEffect; value}.toString + checkSideEffected + } + + @Test def str_SideEffect2(): Unit = { + {sideEffect; Predef}.boolean2Boolean(value).toString + checkSideEffected + } + +} diff --git a/test/junit/scala/runtime/ByteBoxingTest.scala b/test/junit/scala/runtime/ByteBoxingTest.scala new file mode 100644 index 000000000000..51cb9de5aa50 --- /dev/null +++ b/test/junit/scala/runtime/ByteBoxingTest.scala @@ -0,0 +1,116 @@ +package scala.runtime + +import org.junit.Assert._ +import org.junit.Test + +import scala.tools.testing.AllocationTest + +class ByteBoxingTest extends SideEffectTest with AllocationTest { + val value: Byte = 127.toByte + @Test def hash1(): Unit = { + nonAllocating(value.hashCode()) + } + + @Test def hash2(): Unit = { + nonAllocating(value.##) + } + + @Test def float: Unit = { + assertEquals(value, nonAllocating(value.floatValue()), 0D) + } + @Test def double: Unit = { + assertEquals(value, nonAllocating(value.doubleValue()), 0D) + } + @Test def long: Unit = { + assertEquals(value, nonAllocating(value.longValue())) + } + @Test def int: Unit = { + assertEquals(value, nonAllocating(value.intValue())) + } + @Test def short: Unit = { + assertEquals(value, nonAllocating(value.shortValue())) + } + @Test def byte: Unit = { + assertEquals(value, nonAllocating(value.byteValue())) + } + + @Test def str(): Unit = { + val cost = allocationInfo(java.lang.Byte.toString(value), "", false) + assertEquals("127", exactAllocates(cost.min)(value.toString())) + } + //check that any rewrites don't skip side effects + @Test def hash1_SideEffect1(): Unit = { + {sideEffect; value}.hashCode() + checkSideEffected + } + @Test def hash1_SideEffect2(): Unit = { + {sideEffect; Predef}.byte2Byte(value).hashCode() + checkSideEffected + } + + @Test def hash2_SideEffect(): Unit = { + {sideEffect; value}.## + checkSideEffected + } + + @Test def str_SideEffect1(): Unit = { + {sideEffect; value}.toString + checkSideEffected + } + + @Test def str_SideEffect2(): Unit = { + {sideEffect; Predef}.byte2Byte(value).toString + checkSideEffected + } + + @Test def float_SideEffect1(): Unit = { + {sideEffect; value}.floatValue() + checkSideEffected + } + @Test def float_SideEffect2(): Unit = { + {sideEffect; Predef}.byte2Byte(value).floatValue() + checkSideEffected + } + @Test def double_SideEffect1(): Unit = { + {sideEffect; value}.doubleValue() + checkSideEffected + } + @Test def double_SideEffect2(): Unit = { + {sideEffect; Predef}.byte2Byte(value).doubleValue() + checkSideEffected + } + @Test def long_SideEffect1(): Unit = { + {sideEffect; value}.longValue() + checkSideEffected + } + @Test def long_SideEffect2(): Unit = { + {sideEffect; Predef}.byte2Byte(value).longValue() + checkSideEffected + } + @Test def int_SideEffect1(): Unit = { + {sideEffect; value}.intValue() + checkSideEffected + } + @Test def int_SideEffect2(): Unit = { + {sideEffect; Predef}.byte2Byte(value).intValue() + checkSideEffected + } + @Test def short_SideEffect1(): Unit = { + {sideEffect; value}.shortValue() + checkSideEffected + } + @Test def short_SideEffect2(): Unit = { + {sideEffect; Predef}.byte2Byte(value).shortValue() + checkSideEffected + } + @Test def byte_SideEffect1(): Unit = { + {sideEffect; value}.byteValue() + checkSideEffected + } + @Test def byte_SideEffect2(): Unit = { + {sideEffect; Predef}.byte2Byte(value).byteValue() + checkSideEffected + } + + +} diff --git a/test/junit/scala/runtime/CharBoxingTest.scala b/test/junit/scala/runtime/CharBoxingTest.scala new file mode 100644 index 000000000000..cac8ea145949 --- /dev/null +++ b/test/junit/scala/runtime/CharBoxingTest.scala @@ -0,0 +1,50 @@ +package scala.runtime + +import org.junit.Assert._ +import org.junit.Test + +import scala.tools.testing.AllocationTest + +class CharBoxingTest extends SideEffectTest with AllocationTest { + val value = 'x' + + @Test def hash1(): Unit = { + nonAllocating(value.hashCode()) + } + + @Test def hash2(): Unit = { + nonAllocating(value.##) + } + + @Test def str(): Unit = { + val cost = allocationInfo(java.lang.Character.toString(value), "", false) + assertEquals("x", exactAllocates(cost.min)(value.toString())) + } + + //check that any rewrites don't skip side effects + @Test def hash1_SideEffect1(): Unit = { + {sideEffect; value}.hashCode() + checkSideEffected + } + @Test def hash1_SideEffect2(): Unit = { + {sideEffect; Predef}.char2Character(value).hashCode() + checkSideEffected + } + + @Test def hash2_SideEffect(): Unit = { + {sideEffect; value}.## + checkSideEffected + } + + @Test def str_SideEffect1(): Unit = { + {sideEffect; value}.toString + checkSideEffected + } + + @Test def str_SideEffect2(): Unit = { + {sideEffect; Predef}.char2Character(value).toString + checkSideEffected + } + + +} diff --git a/test/junit/scala/runtime/DoubleBoxingTest.scala b/test/junit/scala/runtime/DoubleBoxingTest.scala new file mode 100644 index 000000000000..48120bc9ad08 --- /dev/null +++ b/test/junit/scala/runtime/DoubleBoxingTest.scala @@ -0,0 +1,223 @@ +package scala.runtime + +import org.junit._ +import Assert._ + +import scala.tools.testing.AllocationTest + +class DoubleBoxingTest extends SideEffectTest with AllocationTest { + val nan = Double.NaN + val value = 999D + val valueInt = 999 + @Test def isNaN: Unit = { + assertTrue(nonAllocating(nan.isNaN)) + assertFalse(nonAllocating(value.isNaN)) + } + @Test def isInfinity: Unit = { + assertFalse(nonAllocating(value.isInfinity)) + } + @Test def isInfinite: Unit = { + assertFalse(nonAllocating(value.isInfinite)) + } + @Test def isNegInfinity: Unit = { + assertFalse(nonAllocating(value.isNegInfinity)) + } + @Test def isPosInfinity: Unit = { + assertFalse(nonAllocating(value.isPosInfinity)) + } + @Test def float: Unit = { + assertEquals(value, nonAllocating(value.floatValue()), 0D) + } + @Test def double: Unit = { + assertEquals(value, nonAllocating(value.doubleValue()), 0D) + } + @Test def long: Unit = { + assertEquals(valueInt, nonAllocating(value.longValue())) + } + @Test def int: Unit = { + assertEquals(valueInt, nonAllocating(value.intValue())) + } + @Test def short: Unit = { + assertEquals(valueInt, nonAllocating(value.shortValue())) + } + @Test def byte: Unit = { + assertEquals(-25, nonAllocating(value.byteValue())) + } + @Test def str: Unit = { + val cost = allocationInfo(java.lang.Double.toString(value), "", false) + assertEquals("999.0", exactAllocates(cost.min)(value.toString())) + } + @Test def hash1: Unit = { + nonAllocating(value.##) + } + @Test def hash2: Unit = { + nonAllocating(value.hashCode()) + } + @Test def max: Unit = { + nonAllocating(value max value) + } + @Test def min: Unit = { + nonAllocating(value min value) + } + @Test def abs: Unit = { + nonAllocating(value.abs) + } + @Test def signum: Unit = { + nonAllocating(value.signum) + } + @Test def round: Unit = { + nonAllocating(value.round) + } + @Test def ceil: Unit = { + nonAllocating(value.ceil) + } + @Test def floor: Unit = { + nonAllocating(value.floor) + } + @Test def rad: Unit = { + nonAllocating(value.toRadians) + } + @Test def deg: Unit = { + nonAllocating(value.toDegrees) + } + @Test def to: Unit = { + nonAllocating(value.toByte) + nonAllocating(value.toShort) + nonAllocating(value.toInt) + nonAllocating(value.toLong) + nonAllocating(value.toFloat) + nonAllocating(value.toDouble) + } + + //check that any rewrites don't skip side effects + @Test def isNaN_SideEffect: Unit = { + {sideEffect; value}.isNaN() + checkSideEffected + } + @Test def isInfinity_SideEffect: Unit = { + {sideEffect; value}.isInfinity + checkSideEffected + } + @Test def isInfinite_SideEffect: Unit = { + {sideEffect; value}.isInfinite() + checkSideEffected + } + @Test def isNegInfinity_SideEffect: Unit = { + {sideEffect; value}.isNegInfinity + checkSideEffected + } + @Test def isPosInfinity_SideEffect: Unit = { + {sideEffect; value}.isPosInfinity + checkSideEffected + } + @Test def hash1_SideEffect1(): Unit = { + {sideEffect; value}.hashCode() + checkSideEffected + } + @Test def hash1_SideEffect2(): Unit = { + {sideEffect; Predef}.double2Double(value).hashCode() + checkSideEffected + } + + @Test def hash2_SideEffect(): Unit = { + {sideEffect; value}.## + checkSideEffected + } + + @Test def str_SideEffect1(): Unit = { + {sideEffect; value}.toString + checkSideEffected + } + + @Test def str_SideEffect2(): Unit = { + {sideEffect; Predef}.double2Double(value).toString + checkSideEffected + } + + @Test def float_SideEffect1(): Unit = { + {sideEffect; value}.floatValue() + checkSideEffected + } + @Test def float_SideEffect2(): Unit = { + {sideEffect; Predef}.double2Double(value).floatValue() + checkSideEffected + } + @Test def double_SideEffect1(): Unit = { + {sideEffect; value}.doubleValue() + checkSideEffected + } + @Test def double_SideEffect2(): Unit = { + {sideEffect; Predef}.double2Double(value).doubleValue() + checkSideEffected + } + @Test def long_SideEffect1(): Unit = { + {sideEffect; value}.longValue() + checkSideEffected + } + @Test def long_SideEffect2(): Unit = { + {sideEffect; Predef}.double2Double(value).longValue() + checkSideEffected + } + @Test def int_SideEffect1(): Unit = { + {sideEffect; value}.intValue() + checkSideEffected + } + @Test def int_SideEffect2(): Unit = { + {sideEffect; Predef}.double2Double(value).intValue() + checkSideEffected + } + @Test def short_SideEffect1(): Unit = { + {sideEffect; value}.shortValue() + checkSideEffected + } + @Test def short_SideEffect2(): Unit = { + {sideEffect; Predef}.double2Double(value).shortValue() + checkSideEffected + } + @Test def byte_SideEffect1(): Unit = { + {sideEffect; value}.byteValue() + checkSideEffected + } + @Test def byte_SideEffect2(): Unit = { + {sideEffect; Predef}.double2Double(value).byteValue() + checkSideEffected + } + + @Test def max_SideEffect1: Unit = { + {sideEffect; value} max value + checkSideEffected + } + @Test def min_SideEffect1: Unit = { + {sideEffect; value} min value + checkSideEffected + } + @Test def abs_SideEffect1: Unit = { + {sideEffect; value}.abs + checkSideEffected + } + @Test def signum_SideEffect1: Unit = { + {sideEffect; value}.signum + checkSideEffected + } + @Test def round_SideEffect1: Unit = { + {sideEffect; value}.round + checkSideEffected + } + @Test def ceil_SideEffect1: Unit = { + {sideEffect; value}.ceil + checkSideEffected + } + @Test def floor_SideEffect1: Unit = { + {sideEffect; value}.floor + checkSideEffected + } + @Test def rad_SideEffect1: Unit = { + {sideEffect; value}.toRadians + checkSideEffected + } + @Test def deg_SideEffect1: Unit = { + {sideEffect; value}.toDegrees + checkSideEffected + } + +} diff --git a/test/junit/scala/runtime/FloatBoxingTest.scala b/test/junit/scala/runtime/FloatBoxingTest.scala new file mode 100644 index 000000000000..4298cd7980bd --- /dev/null +++ b/test/junit/scala/runtime/FloatBoxingTest.scala @@ -0,0 +1,226 @@ +package scala.runtime + +import org.junit.Assert.{assertEquals, assertFalse, assertTrue} +import org.junit.Test + +import scala.tools.testing.AllocationTest + +class FloatBoxingTest extends SideEffectTest with AllocationTest { + + val nan = Float.NaN + val value = 12345F + val valueInt = 12345 + + + @Test def isNaN: Unit = { + assertTrue(nonAllocating(nan.isNaN)) + assertFalse(nonAllocating(value.isNaN)) + } + @Test def isInfinity: Unit = { + assertFalse(nonAllocating(value.isInfinity)) + } + @Test def isInfinite: Unit = { + assertFalse(nonAllocating(value.isInfinite)) + } + @Test def isNegInfinity: Unit = { + assertFalse(nonAllocating(value.isNegInfinity)) + } + @Test def isPosInfinity: Unit = { + assertFalse(nonAllocating(value.isPosInfinity)) + } + @Test def float: Unit = { + assertEquals(value, nonAllocating(value.floatValue()), 0D) + } + @Test def double: Unit = { + assertEquals(value, nonAllocating(value.doubleValue()), 0D) + } + @Test def long: Unit = { + assertEquals(valueInt, nonAllocating(value.longValue())) + } + @Test def int: Unit = { + assertEquals(valueInt, nonAllocating(value.intValue())) + } + @Test def short: Unit = { + assertEquals(valueInt, nonAllocating(value.shortValue())) + } + @Test def byte: Unit = { + assertEquals(57, nonAllocating(value.byteValue())) + } + @Test def str: Unit = { + val cost = allocationInfo(java.lang.Double.toString(value), "", false) + assertEquals("12345.0", exactAllocates(cost.min)(value.toString())) + } + @Test def hash1: Unit = { + nonAllocating(value.##) + } + @Test def hash2: Unit = { + nonAllocating(value.hashCode()) + } + @Test def max: Unit = { + nonAllocating(value max value) + } + @Test def min: Unit = { + nonAllocating(value min value) + } + @Test def abs: Unit = { + nonAllocating(value.abs) + } + @Test def signum: Unit = { + nonAllocating(value.signum) + } + @Test def round: Unit = { + nonAllocating(value.round) + } + @Test def ceil: Unit = { + nonAllocating(value.ceil) + } + @Test def floor: Unit = { + nonAllocating(value.floor) + } + @Test def rad: Unit = { + nonAllocating(value.toRadians) + } + @Test def deg: Unit = { + nonAllocating(value.toDegrees) + } + @Test def to: Unit = { + nonAllocating(value.toByte) + nonAllocating(value.toShort) + nonAllocating(value.toInt) + nonAllocating(value.toLong) + nonAllocating(value.toFloat) + nonAllocating(value.toDouble) + } + + //check that any rewrites don't skip side effects + @Test def isNaN_SideEffect: Unit = { + {sideEffect; value}.isNaN() + checkSideEffected + } + @Test def isInfinity_SideEffect: Unit = { + {sideEffect; value}.isInfinity + checkSideEffected + } + @Test def isInfinite_SideEffect: Unit = { + {sideEffect; value}.isInfinite() + checkSideEffected + } + @Test def isNegInfinity_SideEffect: Unit = { + {sideEffect; value}.isNegInfinity + checkSideEffected + } + @Test def isPosInfinity_SideEffect: Unit = { + {sideEffect; value}.isPosInfinity + checkSideEffected + } + @Test def hash1_SideEffect1(): Unit = { + {sideEffect; value}.hashCode() + checkSideEffected + } + @Test def hash1_SideEffect2(): Unit = { + {sideEffect; Predef}.float2Float(value).hashCode() + checkSideEffected + } + + @Test def hash2_SideEffect(): Unit = { + {sideEffect; value}.## + checkSideEffected + } + + @Test def str_SideEffect1(): Unit = { + {sideEffect; value}.toString + checkSideEffected + } + + @Test def str_SideEffect2(): Unit = { + {sideEffect; Predef}.float2Float(value).toString + checkSideEffected + } + + @Test def float_SideEffect1(): Unit = { + {sideEffect; value}.floatValue() + checkSideEffected + } + @Test def float_SideEffect2(): Unit = { + {sideEffect; Predef}.float2Float(value).floatValue() + checkSideEffected + } + @Test def double_SideEffect1(): Unit = { + {sideEffect; value}.doubleValue() + checkSideEffected + } + @Test def double_SideEffect2(): Unit = { + {sideEffect; Predef}.float2Float(value).doubleValue() + checkSideEffected + } + @Test def long_SideEffect1(): Unit = { + {sideEffect; value}.longValue() + checkSideEffected + } + @Test def long_SideEffect2(): Unit = { + {sideEffect; Predef}.float2Float(value).longValue() + checkSideEffected + } + @Test def int_SideEffect1(): Unit = { + {sideEffect; value}.intValue() + checkSideEffected + } + @Test def int_SideEffect2(): Unit = { + {sideEffect; Predef}.float2Float(value).intValue() + checkSideEffected + } + @Test def short_SideEffect1(): Unit = { + {sideEffect; value}.shortValue() + checkSideEffected + } + @Test def short_SideEffect2(): Unit = { + {sideEffect; Predef}.float2Float(value).shortValue() + checkSideEffected + } + @Test def byte_SideEffect1(): Unit = { + {sideEffect; value}.byteValue() + checkSideEffected + } + @Test def byte_SideEffect2(): Unit = { + {sideEffect; Predef}.float2Float(value).byteValue() + checkSideEffected + } + + @Test def max_SideEffect1: Unit = { + {sideEffect; value} max value + checkSideEffected + } + @Test def min_SideEffect1: Unit = { + {sideEffect; value} min value + checkSideEffected + } + @Test def abs_SideEffect1: Unit = { + {sideEffect; value}.abs + checkSideEffected + } + @Test def signum_SideEffect1: Unit = { + {sideEffect; value}.signum + checkSideEffected + } + @Test def round_SideEffect1: Unit = { + {sideEffect; value}.round + checkSideEffected + } + @Test def ceil_SideEffect1: Unit = { + {sideEffect; value}.ceil + checkSideEffected + } + @Test def floor_SideEffect1: Unit = { + {sideEffect; value}.floor + checkSideEffected + } + @Test def rad_SideEffect1: Unit = { + {sideEffect; value}.toRadians + checkSideEffected + } + @Test def deg_SideEffect1: Unit = { + {sideEffect; value}.toDegrees + checkSideEffected + } + +} diff --git a/test/junit/scala/runtime/IntBoxingTest.scala b/test/junit/scala/runtime/IntBoxingTest.scala new file mode 100644 index 000000000000..8ad51e23c7b4 --- /dev/null +++ b/test/junit/scala/runtime/IntBoxingTest.scala @@ -0,0 +1,116 @@ +package scala.runtime + +import org.junit.Assert._ +import org.junit.Test + +import scala.tools.testing.{AllocationTest, BytecodeTesting} + +class IntBoxingTest extends SideEffectTest with AllocationTest { + val value = 999999999 + + @Test def hash1(): Unit = { + nonAllocating(value.hashCode()) + } + + @Test def hash2(): Unit = { + nonAllocating(value.##) + } + + @Test def float: Unit = { + nonAllocating(value.floatValue()) + } + @Test def double: Unit = { + nonAllocating(value.doubleValue()) + } + @Test def long: Unit = { + nonAllocating(value.longValue()) + } + @Test def int: Unit = { + nonAllocating(value.intValue()) + } + @Test def short: Unit = { + nonAllocating(value.shortValue()) + } + @Test def byte: Unit = { + nonAllocating(value.byteValue()) + } + + @Test def str(): Unit = { + val cost = allocationInfo(java.lang.Integer.toString(value), "", false) + assertEquals("999999999", exactAllocates(cost.min)(value.toString())) + } + //check that any rewrites don't skip side effects + @Test def hash1_SideEffect1(): Unit = { + {sideEffect; value}.hashCode() + checkSideEffected + } + @Test def hash1_SideEffect2(): Unit = { + {sideEffect; Predef}.int2Integer(value).hashCode() + checkSideEffected + } + + @Test def hash2_SideEffect(): Unit = { + {sideEffect; value}.## + checkSideEffected + } + + @Test def str_SideEffect1(): Unit = { + {sideEffect; value}.toString + checkSideEffected + } + + @Test def str_SideEffect2(): Unit = { + {sideEffect; Predef}.int2Integer(value).toString + checkSideEffected + } + + @Test def float_SideEffect1(): Unit = { + {sideEffect; value}.floatValue() + checkSideEffected + } + @Test def float_SideEffect2(): Unit = { + {sideEffect; Predef}.int2Integer(value).floatValue() + checkSideEffected + } + @Test def double_SideEffect1(): Unit = { + {sideEffect; value}.doubleValue() + checkSideEffected + } + @Test def double_SideEffect2(): Unit = { + {sideEffect; Predef}.int2Integer(value).doubleValue() + checkSideEffected + } + @Test def long_SideEffect1(): Unit = { + {sideEffect; value}.longValue() + checkSideEffected + } + @Test def long_SideEffect2(): Unit = { + {sideEffect; Predef}.int2Integer(value).longValue() + checkSideEffected + } + @Test def int_SideEffect1(): Unit = { + {sideEffect; value}.intValue() + checkSideEffected + } + @Test def int_SideEffect2(): Unit = { + {sideEffect; Predef}.int2Integer(value).intValue() + checkSideEffected + } + @Test def short_SideEffect1(): Unit = { + {sideEffect; value}.shortValue() + checkSideEffected + } + @Test def short_SideEffect2(): Unit = { + {sideEffect; Predef}.int2Integer(value).shortValue() + checkSideEffected + } + @Test def byte_SideEffect1(): Unit = { + {sideEffect; value}.byteValue() + checkSideEffected + } + @Test def byte_SideEffect2(): Unit = { + {sideEffect; Predef}.int2Integer(value).byteValue() + checkSideEffected + } + +} diff --git a/test/junit/scala/runtime/LongBoxingTest.scala b/test/junit/scala/runtime/LongBoxingTest.scala new file mode 100644 index 000000000000..0b07b31ef981 --- /dev/null +++ b/test/junit/scala/runtime/LongBoxingTest.scala @@ -0,0 +1,116 @@ +package scala.runtime + +import org.junit.Assert._ +import org.junit.Test + +import scala.tools.testing.AllocationTest + +class LongBoxingTest extends SideEffectTest with AllocationTest { + val value = 99999999999999L + + @Test def hash1(): Unit = { + nonAllocating(value.hashCode()) + } + + @Test def hash2(): Unit = { + nonAllocating(value.##) + } + + @Test def float: Unit = { + nonAllocating(value.floatValue()) + } + @Test def double: Unit = { + nonAllocating(value.doubleValue()) + } + @Test def long: Unit = { + nonAllocating(value.longValue()) + } + @Test def int: Unit = { + nonAllocating(value.intValue()) + } + @Test def short: Unit = { + nonAllocating(value.shortValue()) + } + @Test def byte: Unit = { + nonAllocating(value.byteValue()) + } + + @Test def str(): Unit = { + val cost = allocationInfo(java.lang.Long.toString(value), "", false) + assertEquals("99999999999999", exactAllocates(cost.min)(value.toString())) + } + //check that any rewrites don't skip side effects + @Test def hash1_SideEffect1(): Unit = { + {sideEffect; value}.hashCode() + checkSideEffected + } + @Test def hash1_SideEffect2(): Unit = { + {sideEffect; Predef}.long2Long(value).hashCode() + checkSideEffected + } + + @Test def hash2_SideEffect(): Unit = { + {sideEffect; value}.## + checkSideEffected + } + + @Test def str_SideEffect1(): Unit = { + {sideEffect; value}.toString + checkSideEffected + } + + @Test def str_SideEffect2(): Unit = { + {sideEffect; Predef}.long2Long(value).toString + checkSideEffected + } + + @Test def float_SideEffect1(): Unit = { + {sideEffect; value}.floatValue() + checkSideEffected + } + @Test def float_SideEffect2(): Unit = { + {sideEffect; Predef}.long2Long(value).floatValue() + checkSideEffected + } + @Test def double_SideEffect1(): Unit = { + {sideEffect; value}.doubleValue() + checkSideEffected + } + @Test def double_SideEffect2(): Unit = { + {sideEffect; Predef}.long2Long(value).doubleValue() + checkSideEffected + } + @Test def long_SideEffect1(): Unit = { + {sideEffect; value}.longValue() + checkSideEffected + } + @Test def long_SideEffect2(): Unit = { + {sideEffect; Predef}.long2Long(value).longValue() + checkSideEffected + } + @Test def int_SideEffect1(): Unit = { + {sideEffect; value}.intValue() + checkSideEffected + } + @Test def int_SideEffect2(): Unit = { + {sideEffect; Predef}.long2Long(value).intValue() + checkSideEffected + } + @Test def short_SideEffect1(): Unit = { + {sideEffect; value}.shortValue() + checkSideEffected + } + @Test def short_SideEffect2(): Unit = { + {sideEffect; Predef}.long2Long(value).shortValue() + checkSideEffected + } + @Test def byte_SideEffect1(): Unit = { + {sideEffect; value}.byteValue() + checkSideEffected + } + @Test def byte_SideEffect2(): Unit = { + {sideEffect; Predef}.long2Long(value).byteValue() + checkSideEffected + } + +} diff --git a/test/junit/scala/runtime/ShortBoxingTest.scala b/test/junit/scala/runtime/ShortBoxingTest.scala new file mode 100644 index 000000000000..c1ca166cc87b --- /dev/null +++ b/test/junit/scala/runtime/ShortBoxingTest.scala @@ -0,0 +1,116 @@ +package scala.runtime + +import org.junit.Assert._ +import org.junit.Test + +import scala.tools.testing.AllocationTest + +class ShortBoxingTest extends SideEffectTest with AllocationTest { + val value:Short = 999.toShort + + @Test def hash1(): Unit = { + nonAllocating(value.hashCode()) + } + + @Test def hash2(): Unit = { + nonAllocating(value.##) + } + + @Test def float: Unit = { + nonAllocating(value.floatValue()) + } + @Test def double: Unit = { + nonAllocating(value.doubleValue()) + } + @Test def long: Unit = { + nonAllocating(value.longValue()) + } + @Test def int: Unit = { + nonAllocating(value.intValue()) + } + @Test def short: Unit = { + nonAllocating(value.shortValue()) + } + @Test def byte: Unit = { + nonAllocating(value.byteValue()) + } + + @Test def str(): Unit = { + val cost = allocationInfo(java.lang.Short.toString(value), "", false) + assertEquals("999", exactAllocates(cost.min)(value.toString())) + } + //check that any rewrites don't skip side effects + @Test def hash1_SideEffect1(): Unit = { + {sideEffect; value}.hashCode() + checkSideEffected + } + @Test def hash1_SideEffect2(): Unit = { + {sideEffect; Predef}.short2Short(value).hashCode() + checkSideEffected + } + + @Test def hash2_SideEffect(): Unit = { + {sideEffect; value}.## + checkSideEffected + } + + @Test def str_SideEffect1(): Unit = { + {sideEffect; value}.toString + checkSideEffected + } + + @Test def str_SideEffect2(): Unit = { + {sideEffect; Predef}.short2Short(value).toString + checkSideEffected + } + + @Test def float_SideEffect1(): Unit = { + {sideEffect; value}.floatValue() + checkSideEffected + } + @Test def float_SideEffect2(): Unit = { + {sideEffect; Predef}.short2Short(value).floatValue() + checkSideEffected + } + @Test def double_SideEffect1(): Unit = { + {sideEffect; value}.doubleValue() + checkSideEffected + } + @Test def double_SideEffect2(): Unit = { + {sideEffect; Predef}.short2Short(value).doubleValue() + checkSideEffected + } + @Test def long_SideEffect1(): Unit = { + {sideEffect; value}.longValue() + checkSideEffected + } + @Test def long_SideEffect2(): Unit = { + {sideEffect; Predef}.short2Short(value).longValue() + checkSideEffected + } + @Test def int_SideEffect1(): Unit = { + {sideEffect; value}.intValue() + checkSideEffected + } + @Test def int_SideEffect2(): Unit = { + {sideEffect; Predef}.short2Short(value).intValue() + checkSideEffected + } + @Test def short_SideEffect1(): Unit = { + {sideEffect; value}.shortValue() + checkSideEffected + } + @Test def short_SideEffect2(): Unit = { + {sideEffect; Predef}.short2Short(value).shortValue() + checkSideEffected + } + @Test def byte_SideEffect1(): Unit = { + {sideEffect; value}.byteValue() + checkSideEffected + } + @Test def byte_SideEffect2(): Unit = { + {sideEffect; Predef}.short2Short(value).byteValue() + checkSideEffected + } + +} diff --git a/test/junit/scala/runtime/SideEffectTest.scala b/test/junit/scala/runtime/SideEffectTest.scala new file mode 100644 index 000000000000..552cb2ebf29c --- /dev/null +++ b/test/junit/scala/runtime/SideEffectTest.scala @@ -0,0 +1,18 @@ +package scala.runtime + +import org.junit.Assert._ + +trait SideEffectTest { + + private var affected = false + + def sideEffect = { + assertFalse(affected) + affected = true + } + + def checkSideEffected: Unit = { + assertTrue(affected) + } + +} diff --git a/test/junit/scala/tools/testing/AllocationTest.scala b/test/junit/scala/tools/testing/AllocationTest.scala index ddc0a2508195..1dbd8642f215 100644 --- a/test/junit/scala/tools/testing/AllocationTest.scala +++ b/test/junit/scala/tools/testing/AllocationTest.scala @@ -13,9 +13,9 @@ object AllocationTest { allocationCounter.setThreadAllocatedMemoryEnabled(true) private object coster extends AllocationTest { - def byte = 1.toByte + def byte = 99.toByte - def short = 1.toShort + def short = 9999.toShort def int = 100000000 @@ -25,9 +25,9 @@ object AllocationTest { def char = 's' - def float = 1F + def float = 123456F - def double = 1D + def double = 123456D def unit = () From 03999190d49d2b8264224cfa1a3150009eff8118 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Thu, 3 Sep 2020 11:37:43 +0200 Subject: [PATCH 33/46] [nomerge] no longer build external partest module in release scripts --- scripts/bootstrap_fun | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/scripts/bootstrap_fun b/scripts/bootstrap_fun index 510f1fdbf536..d92591514ba1 100644 --- a/scripts/bootstrap_fun +++ b/scripts/bootstrap_fun @@ -111,18 +111,6 @@ buildXML() { fi } -buildPartest() { - if [ "$PARTEST_BUILT" != "yes" ] && [ "$forceBuildModules" != "yes" ] && ( sbtResolve "org.scala-lang.modules" "scala-partest" $PARTEST_VER ) - then echo "Found scala-partest $PARTEST_VER; not building." - else - update scala scala-partest "$PARTEST_REF" && gfxd - doc="$(docTask $1)" - # disable -Xfatal-warnings until https://github.com/scala/scala-partest/pull/101 is released - sbtBuild 'set version :="'$PARTEST_VER'"' 'set VersionKeys.scalaXmlVersion := "'$XML_VER'"' $clean "$doc" 'set scalacOptions := scalacOptions.value.filterNot(_.contains("fatal-warn"))' test "${buildTasks[@]}" - PARTEST_BUILT="yes" - fi -} - # should only be called with publishTasks publishing to artifactory buildScalaCheck(){ if [ "$SCALACHECK_BUILT" != "yes" ] && [ "$forceBuildModules" != "yes" ] && ( sbtResolve "org.scalacheck" "scalacheck" $SCALACHECK_VER ) @@ -162,7 +150,6 @@ buildModules() { buildXML $1 # buildScalaCheck $1 - buildPartest $1 constructUpdatedModuleVersions $1 @@ -232,14 +219,11 @@ determineScalaVersion() { # determineScalaVersion must have been called (versions.properties is parsed to env vars) deriveModuleVersions() { XML_VER=${XML_VER-$scala_xml_version_number} - PARTEST_VER=${PARTEST_VER-$partest_version_number} SCALACHECK_VER=${SCALACHECK_VER-$scalacheck_version_number} XML_REF="v$XML_VER" - PARTEST_REF="v$PARTEST_VER" SCALACHECK_REF="$SCALACHECK_VER" # no `v` in their tags - echo "PARTEST = $PARTEST_VER at $PARTEST_REF" # echo "SCALACHECK = $SCALACHECK_VER at $SCALACHECK_REF" echo "XML = $XML_VER at $XML_REF" @@ -285,7 +269,6 @@ constructUpdatedModuleVersions() { # force the new module versions for building the core. these may be different from the values in versions.properties # if the variables (XML_VER) were provided. in the common case, the values are the same as in versions.properties. updatedModuleVersions=("${updatedModuleVersions[@]}" "-Dscala-xml.version.number=$XML_VER") - updatedModuleVersions=("${updatedModuleVersions[@]}" "-Dpartest.version.number=$PARTEST_VER") # updatedModuleVersions=("${updatedModuleVersions[@]}" "-Dscalacheck.version.number=$SCALACHECK_VER") # allow overriding the jline version using a jenkins build parameter From ce8e3dfbfd657f484d0a607c29406d8e2eac2274 Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Thu, 3 Sep 2020 20:21:26 -0700 Subject: [PATCH 34/46] Restore binary compatibility for doc.Settings 71c91d5cea6410a81001a362b6d74efc64b86877 broke binary compatibility for scala.tools.nsc.doc.Settings.. This api is used by https://github.com/tkawachi/sbt-doctest which was broken by the change to the signature. --- src/scaladoc/scala/tools/nsc/ScalaDoc.scala | 4 +++- src/scaladoc/scala/tools/nsc/doc/Settings.scala | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/scaladoc/scala/tools/nsc/ScalaDoc.scala b/src/scaladoc/scala/tools/nsc/ScalaDoc.scala index 9472d0be9cca..966900c7c1b3 100644 --- a/src/scaladoc/scala/tools/nsc/ScalaDoc.scala +++ b/src/scaladoc/scala/tools/nsc/ScalaDoc.scala @@ -14,6 +14,7 @@ package scala.tools.nsc import scala.tools.nsc.doc.DocFactory import scala.tools.nsc.reporters.ConsoleReporter +import scala.tools.nsc.settings.DefaultPathFactory import scala.reflect.internal.Reporter import scala.reflect.internal.util.{ FakePos, NoPosition, Position } @@ -26,7 +27,8 @@ class ScalaDoc { def process(args: Array[String]): Boolean = { var reporter: ScalaDocReporter = null val docSettings = new doc.Settings(msg => reporter.error(FakePos("scaladoc"), msg + "\n scaladoc -help gives more information"), - msg => reporter.printMessage(msg)) + msg => reporter.printMessage(msg), + DefaultPathFactory) reporter = new ScalaDocReporter(docSettings) val command = new ScalaDoc.Command(args.toList, docSettings) def hasFiles = command.files.nonEmpty || docSettings.uncompilableFiles.nonEmpty diff --git a/src/scaladoc/scala/tools/nsc/doc/Settings.scala b/src/scaladoc/scala/tools/nsc/doc/Settings.scala index f08ca26afa82..d5040e6620e0 100644 --- a/src/scaladoc/scala/tools/nsc/doc/Settings.scala +++ b/src/scaladoc/scala/tools/nsc/doc/Settings.scala @@ -22,6 +22,8 @@ import scala.tools.nsc.settings.{DefaultPathFactory, PathFactory} * @param error A function that prints a string to the appropriate error stream * @param printMsg A function that prints the string, without any extra boilerplate of error */ class Settings(error: String => Unit, val printMsg: String => Unit = println(_), pathFactory: PathFactory = DefaultPathFactory) extends scala.tools.nsc.Settings(error, pathFactory) { + // https://github.com/tkawachi/sbt-doctest depends on this constructor being available + def this(error: String => Unit, printMsg: String => Unit) = this(error, printMsg, DefaultPathFactory) // TODO 2.13 Remove private def removalIn213 = "This flag is scheduled for removal in 2.13. If you have a case where you need this flag then please report a bug." From 3ecfc649eeeeb5795537afe549493abb28d3df8c Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Sat, 29 Aug 2020 14:39:36 +0100 Subject: [PATCH 35/46] Cleanup JavaParser.annotation I accidentally thought a reported bug was here while it was actually in Typer, so this is just some cleanups (and a TODO) in the area. --- .../scala/tools/nsc/javac/JavaParsers.scala | 139 ++++++------------ 1 file changed, 49 insertions(+), 90 deletions(-) diff --git a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala index e98c5751bd99..eaf404f95024 100644 --- a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala @@ -380,100 +380,61 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners { * ElementValueList ::= ElementValue {`,` ElementValue} */ def annotation(): Tree = { - def annArg(): Tree = { - def elementValue(): Tree = { - tryLiteral() match { - case Some(lit) => atPos(in.currentPos)(Literal(lit)) - case _ if in.token == AT => - in.nextToken() - annotation() - case _ if in.token == LBRACE => - atPos(in.pos) { - in.nextToken() - val ts = new ListBuffer[Tree] - if (in.token == RBRACE) - Apply(ArrayModule_overloadedApply) - else { - var bailout = false - elementValue() match { - case EmptyTree => bailout = true - case t => ts += t - } - while (in.token == COMMA && !bailout) { - in.nextToken() - if (in.token == RBRACE) { - // trailing comma - } else { - elementValue() match { - case EmptyTree => bailout = true - case t => ts += t - } - } - } - if (!bailout && in.token != RBRACE) { - bailout = true - } - if (bailout) { - var braceDepth = 1 - while (braceDepth > 0) { - in.nextToken() - in.token match { - case LBRACE => braceDepth += 1 - case RBRACE => braceDepth -= 1 - case _ => - } - } - EmptyTree - } else { - accept(RBRACE) - Apply(ArrayModule_overloadedApply, ts.toList: _*) - } - } - } - case _ if in.token == IDENTIFIER => - qualId(orClassLiteral = true) - case _ => - in.nextToken() - EmptyTree - } + object LiteralK { def unapply(token: Token) = tryLiteral() } + + def elementValue(): Tree = in.token match { + case LiteralK(k) => in.nextToken(); atPos(in.currentPos)(Literal(k)) + case IDENTIFIER => qualId(orClassLiteral = true) + case LBRACE => accept(LBRACE); elementArray() + case AT => accept(AT); annotation() + case _ => in.nextToken(); EmptyTree + } + + def elementArray(): Tree = atPos(in.pos) { + val ts = new ListBuffer[Tree] + while (in.token != RBRACE) { + ts += elementValue() + if (in.token == COMMA) in.nextToken() // done this way trailing commas are supported } + val ok = !ts.contains(EmptyTree) + in.token match { + case RBRACE if ok => accept(RBRACE); Apply(ArrayModule_overloadedApply, ts.toList: _*) + case _ => skipTo(RBRACE); EmptyTree + } + } - if (in.token == IDENTIFIER) { - qualId(orClassLiteral = true) match { - case name: Ident if in.token == EQUALS => - in.nextToken() - /* name = value */ - val value = elementValue() - if (value.isEmpty) EmptyTree else gen.mkNamedArg(name, value) - case rhs => - /* implicit `value` arg with constant value */ - gen.mkNamedArg(nme.value, rhs) + // 1) name = value + // 2) implicit `value` arg with constant value + // 3) implicit `value` arg + def annArg(): Tree = { + def mkNamedArg(name: Ident, value: Tree) = if (value.isEmpty) EmptyTree else gen.mkNamedArg(name, value) + in.token match { + case IDENTIFIER => qualId(orClassLiteral = true) match { + case name: Ident if in.token == EQUALS => accept(EQUALS); mkNamedArg(name, elementValue()) + case rhs => mkNamedArg(Ident(nme.value), rhs) } - } else { - /* implicit `value` arg */ - val value = elementValue() - if (value.isEmpty) EmptyTree else gen.mkNamedArg(nme.value, value) + case _ => mkNamedArg(Ident(nme.value), elementValue()) } } atPos(in.pos) { val id = convertToTypeId(qualId()) - if (in.token == LPAREN) { - val saved = new JavaTokenData {}.copyFrom(in) // prep to bail if non-literals/identifiers - accept(LPAREN) - val args = - if (in.token == RPAREN) Nil - else commaSeparated(atPos(in.pos)(annArg())) - if (in.token == RPAREN) { - accept(RPAREN) - New(id, args :: Nil) - } else { - in.copyFrom(saved) - skipAhead() - accept(RPAREN) - EmptyTree - } - } else New(id, ListOfNil) + in.token match { + case LPAREN => + // TODO: fix copyFrom+skipAhead; CharArrayReaderData missing + val saved = new JavaTokenData {}.copyFrom(in) // prep to bail if non-literals/identifiers + accept(LPAREN) + val args = in.token match { + case RPAREN => Nil + case _ => commaSeparated(atPos(in.pos)(annArg())) + } + val ok = !args.contains(EmptyTree) + in.token match { + case RPAREN if ok => accept(RPAREN); New(id, List(args)) + case _ => in.copyFrom(saved); skipAhead(); accept(RPAREN); EmptyTree + } + case _ => New(id, ListOfNil) + } } } @@ -717,6 +678,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners { def constantTpe(const: Constant): Tree = TypeTree(ConstantType(const)) def forConst(const: Constant): Tree = { + in.nextToken() if (in.token != SEMI) tpt1 else { def isStringTyped = tpt1 match { @@ -1010,10 +972,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners { case _ => null } if (l == null) None - else { - in.nextToken() - Some(Constant(l)) - } + else Some(Constant(l)) } /** CompilationUnit ::= [package QualId semi] TopStatSeq From 2569ed7e1daebe514b9279b8cbc88945a50ce7c3 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Fri, 28 Aug 2020 18:26:39 +0100 Subject: [PATCH 36/46] Handle NestedAnnotArg from Java sources Previously annotations in java sources were ignored. Now that they're parsed, some of the typer checks needed tweaks for the nested annotations arguments case. --- src/compiler/scala/tools/nsc/typechecker/Typers.scala | 6 +++++- test/files/pos/t12133/I.java | 4 ++++ test/files/pos/t12133/J.java | 4 ++++ test/files/pos/t12133/Table.java | 6 ++++++ test/files/pos/t12133/UniqueConstraint.java | 5 +++++ test/files/pos/t12133/test.scala | 4 ++++ 6 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 test/files/pos/t12133/I.java create mode 100644 test/files/pos/t12133/J.java create mode 100644 test/files/pos/t12133/Table.java create mode 100644 test/files/pos/t12133/UniqueConstraint.java create mode 100644 test/files/pos/t12133/test.scala diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 03b2377ee29b..a239c81219b3 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3832,6 +3832,10 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper * an error message is reported and None is returned. */ def tree2ConstArg(tree: Tree, pt: Type): Option[ClassfileAnnotArg] = tree match { + case Apply(Select(New(_), nme.CONSTRUCTOR), _) if pt.typeSymbol == ArrayClass && unit.isJava => + // In Java, a single value may be passed for array annotation parameters + tree2ConstArg(Apply(Select(gen.mkAttributedRef(ArrayModule), nme.apply), List(tree)), pt) + case Apply(Select(New(tpt), nme.CONSTRUCTOR), args) if (pt.typeSymbol == ArrayClass) => reportAnnotationError(ArrayConstantsError(tree)); None @@ -3840,7 +3844,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper val annType = annInfo.tpe if (!annType.typeSymbol.isSubClass(pt.typeSymbol)) - reportAnnotationError(AnnotationTypeMismatchError(tpt, annType, annType)) + reportAnnotationError(AnnotationTypeMismatchError(tpt, pt, annType)) else if (!annType.typeSymbol.isSubClass(ClassfileAnnotationClass)) reportAnnotationError(NestedAnnotationError(ann, annType)) diff --git a/test/files/pos/t12133/I.java b/test/files/pos/t12133/I.java new file mode 100644 index 000000000000..5d5305a80093 --- /dev/null +++ b/test/files/pos/t12133/I.java @@ -0,0 +1,4 @@ +package pkg; + +@UniqueConstraint(columnNames = {"account_id_ok", "name"}) +public class I {} diff --git a/test/files/pos/t12133/J.java b/test/files/pos/t12133/J.java new file mode 100644 index 000000000000..2c8d95f3badb --- /dev/null +++ b/test/files/pos/t12133/J.java @@ -0,0 +1,4 @@ +package pkg; + +@Table(name = "portal", uniqueConstraints = @UniqueConstraint(columnNames = {"account_id_fk", "name"})) +public class J {} diff --git a/test/files/pos/t12133/Table.java b/test/files/pos/t12133/Table.java new file mode 100644 index 000000000000..edb74c3e7c88 --- /dev/null +++ b/test/files/pos/t12133/Table.java @@ -0,0 +1,6 @@ +package pkg; + +public @interface Table { + String name(); + UniqueConstraint[] uniqueConstraints(); +} diff --git a/test/files/pos/t12133/UniqueConstraint.java b/test/files/pos/t12133/UniqueConstraint.java new file mode 100644 index 000000000000..82b82d98593c --- /dev/null +++ b/test/files/pos/t12133/UniqueConstraint.java @@ -0,0 +1,5 @@ +package pkg; + +public @interface UniqueConstraint { + String[] columnNames(); +} diff --git a/test/files/pos/t12133/test.scala b/test/files/pos/t12133/test.scala new file mode 100644 index 000000000000..68c7a2ee2b0a --- /dev/null +++ b/test/files/pos/t12133/test.scala @@ -0,0 +1,4 @@ +class Test { + new pkg.I + new pkg.J +} From 54a2bee380985be9817e73eec51bfdc914d40d5d Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 15 Jul 2020 14:12:28 +1000 Subject: [PATCH 37/46] Refactor DeterminismTest to expose internals as an app. --- .../scala/tools/nsc/DeterminismTest.scala | 73 +----------- .../scala/tools/nsc/DeterminismTester.scala | 107 ++++++++++++++++++ 2 files changed, 110 insertions(+), 70 deletions(-) create mode 100644 test/junit/scala/tools/nsc/DeterminismTester.scala diff --git a/test/junit/scala/tools/nsc/DeterminismTest.scala b/test/junit/scala/tools/nsc/DeterminismTest.scala index d6880538175a..dbbd0ec060f5 100644 --- a/test/junit/scala/tools/nsc/DeterminismTest.scala +++ b/test/junit/scala/tools/nsc/DeterminismTest.scala @@ -1,19 +1,13 @@ package scala.tools.nsc -import java.io.OutputStreamWriter -import java.nio.charset.Charset -import java.nio.file.attribute.BasicFileAttributes -import java.nio.file.{FileVisitResult, Files, Path, SimpleFileVisitor} - -import javax.tools.ToolProvider import org.junit.Test -import scala.collection.JavaConverters.seqAsJavaListConverter import scala.reflect.internal.util.{BatchSourceFile, SourceFile} -import scala.tools.nsc.reporters.StoreReporter -import FileUtils._ class DeterminismTest { + private val tester = new DeterminismTester + import tester.test + @Test def testLambdaLift(): Unit = { def code = List[SourceFile]( source("a.scala", @@ -322,67 +316,6 @@ class DeterminismTest { } def source(name: String, code: String): SourceFile = new BatchSourceFile(name, code) - private def test(groups: List[List[SourceFile]]): Unit = { - val referenceOutput = Files.createTempDirectory("reference") - - def compile(output: Path, files: List[SourceFile]): Unit = { - val g = new Global(new Settings) - g.settings.usejavacp.value = true - g.settings.classpath.value = output.toAbsolutePath.toString - g.settings.outputDirs.setSingleOutput(output.toString) - g.settings.async.value = true - val storeReporter = new StoreReporter - g.reporter = storeReporter - import g._ - val r = new Run - // println("scalac " + files.mkString(" ")) - r.compileSources(files) - Predef.assert(!storeReporter.hasErrors, storeReporter.infos.mkString("\n")) - files.filter(_.file.name.endsWith(".java")) match { - case Nil => - case javaSources => - def tempFileFor(s: SourceFile): Path = { - val f = output.resolve(s.file.name) - Files.write(f, new String(s.content).getBytes(Charset.defaultCharset())) - } - val options = List("-d", output.toString) - val javac = ToolProvider.getSystemJavaCompiler - assert(javac != null, "No javac from getSystemJavaCompiler. If the java on your path isn't a JDK version, but $JAVA_HOME is, launch sbt with --java-home \"$JAVA_HOME\"") - val fileMan = javac.getStandardFileManager(null, null, null) - val javaFileObjects = fileMan.getJavaFileObjects(javaSources.map(s => tempFileFor(s).toAbsolutePath.toString): _*) - val task = javac.getTask(new OutputStreamWriter(System.out), fileMan, null, options.asJava, Nil.asJava, javaFileObjects) - val result = task.call() - Predef.assert(result) - } - } - - for (group <- groups.init) { - compile(referenceOutput, group) - } - compile(referenceOutput, groups.last) - - class CopyVisitor(src: Path, dest: Path) extends SimpleFileVisitor[Path] { - override def preVisitDirectory(dir: Path, attrs: BasicFileAttributes): FileVisitResult = { - Files.createDirectories(dest.resolve(src.relativize(dir))) - super.preVisitDirectory(dir, attrs) - } - override def visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult = { - Files.copy(file, dest.resolve(src.relativize(file))) - super.visitFile(file, attrs) - } - } - for (permutation <- permutationsWithSubsets(groups.last)) { - val recompileOutput = Files.createTempDirectory("recompileOutput") - copyRecursive(referenceOutput, recompileOutput) - compile(recompileOutput, permutation) - assertDirectorySame(referenceOutput, recompileOutput, permutation.toString) - deleteRecursive(recompileOutput) - } - deleteRecursive(referenceOutput) - - } - def permutationsWithSubsets[A](as: List[A]): List[List[A]] = - as.permutations.toList.flatMap(_.inits.filter(_.nonEmpty)).distinct } diff --git a/test/junit/scala/tools/nsc/DeterminismTester.scala b/test/junit/scala/tools/nsc/DeterminismTester.scala new file mode 100644 index 000000000000..66caaa5a515f --- /dev/null +++ b/test/junit/scala/tools/nsc/DeterminismTester.scala @@ -0,0 +1,107 @@ +package scala.tools.nsc + +import java.io.OutputStreamWriter +import java.nio.charset.Charset +import java.nio.file.attribute.BasicFileAttributes +import java.nio.file.{FileVisitResult, Files, Path, Paths, SimpleFileVisitor} +import scala.collection.JavaConverters._ +import javax.tools.ToolProvider + +import scala.reflect.internal.util.SourceFile +import scala.reflect.io.AbstractFile +import scala.tools.nsc.FileUtils._ +import scala.tools.nsc.reporters.StoreReporter +import scala.reflect.internal.util.BatchSourceFile + +object DeterminismTester extends DeterminismTester { + def main(args: Array[String]): Unit = { + val (scalacOpts, sourceFilesPaths) = args.indexOf("--") match { + case -1 => (Nil, args.toList) + case i => + val tuple = args.toList.splitAt(i) + (tuple._1, tuple._2.drop(1)) + } + def isJavaOrScala(p: Path) = { + val name = p.getFileName.toString + name.endsWith(".java") || name.endsWith(".scala") + } + def expand(path: Path): Seq[Path] = { + if (Files.isDirectory(path)) + Files.walk(path).iterator().asScala.filter(isJavaOrScala).toList + else path :: Nil + } + val sourceFiles = sourceFilesPaths.map(Paths.get(_)).flatMap(expand).map(path => new BatchSourceFile(AbstractFile.getFile(path.toFile))) + test(scalacOpts, sourceFiles :: Nil) + } +} + +class DeterminismTester { + + def test(groups: List[List[SourceFile]]): Unit = test(Nil, groups) + def test(scalacOptions: List[String], groups: List[List[SourceFile]]): Unit = { + val referenceOutput = Files.createTempDirectory("reference") + + def compile(output: Path, files: List[SourceFile]): Unit = { + val g = new Global(new Settings) + g.settings.usejavacp.value = true + g.settings.classpath.value = output.toAbsolutePath.toString + g.settings.outputDirs.setSingleOutput(output.toString) + g.settings.async.value = true + g.settings.processArguments(scalacOptions, true) + val storeReporter = new StoreReporter + g.reporter = storeReporter + import g._ + val r = new Run + // println("scalac " + files.mkString(" ")) + r.compileSources(files) + Predef.assert(!storeReporter.hasErrors, storeReporter.infos.mkString("\n")) + files.filter(_.file.name.endsWith(".java")) match { + case Nil => + case javaSources => + def tempFileFor(s: SourceFile): Path = { + val f = output.resolve(s.file.name) + Files.write(f, new String(s.content).getBytes(Charset.defaultCharset())) + } + val options = List("-d", output.toString) + val javac = ToolProvider.getSystemJavaCompiler + assert(javac != null, "No javac from getSystemJavaCompiler. If the java on your path isn't a JDK version, but $JAVA_HOME is, launch sbt with --java-home \"$JAVA_HOME\"") + val fileMan = javac.getStandardFileManager(null, null, null) + val javaFileObjects = fileMan.getJavaFileObjects(javaSources.map(s => tempFileFor(s).toAbsolutePath.toString): _*) + val task = javac.getTask(new OutputStreamWriter(System.out), fileMan, null, options.asJava, Nil.asJava, javaFileObjects) + val result = task.call() + Predef.assert(result) + } + } + + for (group <- groups.init) { + compile(referenceOutput, group) + } + compile(referenceOutput, groups.last) + + class CopyVisitor(src: Path, dest: Path) extends SimpleFileVisitor[Path] { + override def preVisitDirectory(dir: Path, attrs: BasicFileAttributes): FileVisitResult = { + Files.createDirectories(dest.resolve(src.relativize(dir))) + super.preVisitDirectory(dir, attrs) + } + override def visitFile(file: Path, attrs: BasicFileAttributes): FileVisitResult = { + Files.copy(file, dest.resolve(src.relativize(file))) + super.visitFile(file, attrs) + } + } + val permutations: List[List[SourceFile]] = if (groups.last.size > 32) { + groups.last.reverse :: groups.last.map(_ :: Nil) + } else permutationsWithSubsets(groups.last) + for (permutation <- permutations) { + val recompileOutput = Files.createTempDirectory("recompileOutput") + copyRecursive(referenceOutput, recompileOutput) + compile(recompileOutput, permutation) + assertDirectorySame(referenceOutput, recompileOutput, permutation.toString) + deleteRecursive(recompileOutput) + } + deleteRecursive(referenceOutput) + + } + def permutationsWithSubsets[A](as: List[A]): List[List[A]] = + as.permutations.toList.flatMap(_.inits.filter(_.nonEmpty)).distinct + +} From f5ff2107ac95c5ae16f96a52e61823e940dc56be Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 17 Jul 2020 12:55:10 +1000 Subject: [PATCH 38/46] Deterministic InnerClass attribute under joint/separate compilation Use the private flag as defined in source code, rather than the potentially less-private status of the class at the end of compiler pipeline. For backwards compatibility reasons, this is limited to entries for refererenced classes only. --- .../scala/tools/nsc/backend/jvm/BTypes.scala | 17 +++++--- .../nsc/backend/jvm/BTypesFromClassfile.scala | 3 +- .../nsc/backend/jvm/BTypesFromSymbols.scala | 2 +- .../tools/nsc/backend/jvm/PostProcessor.scala | 3 +- .../backend/jvm/analysis/BackendUtils.scala | 43 ++++++++++++++----- .../files/run/java-not-private-inners/C.scala | 7 +++ .../run/java-not-private-inners/Test.java | 5 +++ .../scala/tools/nsc/DeterminismTest.scala | 15 +++++++ .../scala/tools/nsc/DeterminismTester.scala | 1 + .../jvm/NestedClassesCollectorTest.scala | 2 +- 10 files changed, 77 insertions(+), 21 deletions(-) create mode 100644 test/files/run/java-not-private-inners/C.scala create mode 100644 test/files/run/java-not-private-inners/Test.java diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala b/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala index bd329d8aa46b..faf711726039 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala @@ -680,15 +680,17 @@ abstract class BTypes { } def innerClassAttributeEntry: Either[NoClassBTypeInfo, Option[InnerClassEntry]] = info.map(i => i.nestedInfo.force map { - case NestedInfo(_, outerName, innerName, isStaticNestedClass) => + case NestedInfo(_, outerName, innerName, isStaticNestedClass, exitingTyperPrivate) => + // the static flag in the InnerClass table has a special meaning, see InnerClass comment + def adjustStatic(flags: Int): Int = ( flags & ~Opcodes.ACC_STATIC | + (if (isStaticNestedClass) Opcodes.ACC_STATIC else 0) + ) & BCodeHelpers.INNER_CLASSES_FLAGS InnerClassEntry( internalName, outerName.orNull, innerName.orNull, - // the static flag in the InnerClass table has a special meaning, see InnerClass comment - ( i.flags & ~Opcodes.ACC_STATIC | - (if (isStaticNestedClass) Opcodes.ACC_STATIC else 0) - ) & BCodeHelpers.INNER_CLASSES_FLAGS + flags = adjustStatic(i.flags), + refereeFlags = adjustStatic(if (exitingTyperPrivate) (i.flags & ~Opcodes.ACC_PUBLIC) | Opcodes.ACC_PRIVATE else i.flags) ) }) @@ -874,7 +876,8 @@ abstract class BTypes { final case class NestedInfo(enclosingClass: ClassBType, outerName: Option[String], innerName: Option[String], - isStaticNestedClass: Boolean) + isStaticNestedClass: Boolean, + exitingTyperPrivate: Boolean) /** * This class holds the data for an entry in the InnerClass table. See the InnerClass summary @@ -887,7 +890,7 @@ abstract class BTypes { * @param innerName The simple name of the inner class, may be null. * @param flags The flags for this class in the InnerClass entry. */ - final case class InnerClassEntry(name: String, outerName: String, innerName: String, flags: Int) + final case class InnerClassEntry(name: String, outerName: String, innerName: String, flags: Int, refereeFlags: Int) final case class ArrayBType(componentType: BType) extends RefBType { def dimension: Int = componentType match { diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromClassfile.scala b/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromClassfile.scala index 12721aa1e440..a49cd9e7ec65 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromClassfile.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromClassfile.scala @@ -123,7 +123,8 @@ abstract class BTypesFromClassfile { classBTypeFromParsedClassfile(classNode.outerClass) } val staticFlag = (innerEntry.access & Opcodes.ACC_STATIC) != 0 - NestedInfo(enclosingClass, Option(innerEntry.outerName), Option(innerEntry.innerName), staticFlag) + NestedInfo(enclosingClass, Option(innerEntry.outerName), Option(innerEntry.innerName), staticFlag, + (flags & Opcodes.ACC_PRIVATE) == Opcodes.ACC_PRIVATE) } val inlineInfo = inlineInfoFromClassfile(classNode) diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala b/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala index ede0c3bc3de0..9beaf3a93ec7 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala @@ -500,7 +500,7 @@ abstract class BTypesFromSymbols[G <: Global](val global: G) extends BTypes { else Some(innerClassSym.rawname + innerClassSym.moduleSuffix) // moduleSuffix for module classes } - Some(NestedInfo(enclosingClass, outerName, innerName, isStaticNestedClass)) + Some(NestedInfo(enclosingClass, outerName, innerName, isStaticNestedClass, exitingTyper(innerClassSym.isPrivate))) } /** diff --git a/src/compiler/scala/tools/nsc/backend/jvm/PostProcessor.scala b/src/compiler/scala/tools/nsc/backend/jvm/PostProcessor.scala index d70ae20bba61..b3517ba2d3cd 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/PostProcessor.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/PostProcessor.scala @@ -132,7 +132,8 @@ abstract class PostProcessor extends PerRunInit { def setInnerClasses(classNode: ClassNode): Unit = { classNode.innerClasses.clear() - backendUtils.addInnerClasses(classNode, backendUtils.collectNestedClasses(classNode)) + val (declared, referred) = backendUtils.collectNestedClasses(classNode) + backendUtils.addInnerClasses(classNode, declared, referred) } def serializeClass(classNode: ClassNode): Array[Byte] = { diff --git a/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala b/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala index 44c948800f66..614b80322d50 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala @@ -352,11 +352,12 @@ abstract class BackendUtils extends PerRunInit { } /** * Visit the class node and collect all referenced nested classes. + * @return (declaredInnerClasses, referredInnerClasses) */ - def collectNestedClasses(classNode: ClassNode): List[ClassBType] = { + def collectNestedClasses(classNode: ClassNode): (List[ClassBType], List[ClassBType]) = { val c = new Collector c.visit(classNode) - c.innerClasses.toList + (c.declaredInnerClasses.toList, c.referredInnerClasses.toList) } /* @@ -371,14 +372,27 @@ abstract class BackendUtils extends PerRunInit { * * can-multi-thread */ - final def addInnerClasses(jclass: asm.ClassVisitor, refedInnerClasses: List[ClassBType]) { - val allNestedClasses = refedInnerClasses.flatMap(_.enclosingNestedClassesChain.get).distinct + final def addInnerClasses(jclass: asm.tree.ClassNode, declaredInnerClasses: List[ClassBType], refedInnerClasses: List[ClassBType]) { + val allReferredNestedClasses = refedInnerClasses.flatMap(_.enclosingNestedClassesChain.get).distinct + + case class Entry(cls: ClassBType, isDeclared: Boolean) // sorting ensures nested classes are listed after their enclosing class thus satisfying the Eclipse Java compiler - for (nestedClass <- allNestedClasses.sortBy(_.internalName.toString)) { + val allNestedClasses = new mutable.TreeSet[Entry]()(Ordering.by(_.cls.internalName)) + declaredInnerClasses.foreach(cls => allNestedClasses += Entry(cls, isDeclared = true)) + allReferredNestedClasses.foreach(cls => allNestedClasses += Entry(cls, isDeclared = false)) + + for (nestedClass <- allNestedClasses) { // Extract the innerClassEntry - we know it exists, enclosingNestedClassesChain only returns nested classes. - val Some(e) = nestedClass.innerClassAttributeEntry.get - jclass.visitInnerClass(e.name, e.outerName, e.innerName, e.flags) + val Some(e) = nestedClass.cls.innerClassAttributeEntry.get + // Although arguably a bug, we retain backwards compatibility with prior versions of scalac by + // emitting declared private inner classes that have been publicised with `makeNonPrivate` as ACC_PUBLIC. + // Java clients can see these classes, as shown in test/files/run/java-not-private-inners + // + // Inner class entries of referred classes now use the `exitingTyper(sym.isPrivate)` so that the value + // is stable between joint and separate compilation (see `DeterminismTest.testReferenceToInnerClassMadeNonPrivate` + val flags = if (nestedClass.isDeclared) e.flags else e.refereeFlags + jclass.visitInnerClass(e.name, e.outerName, e.innerName, flags) } } @@ -633,7 +647,15 @@ object BackendUtils { def clearLabelReachable(label: LabelNode) = clearLabelFlag(label.asInstanceOf[LabelNode1], LABEL_REACHABLE_STATUS) abstract class NestedClassesCollector[T](nestedOnly: Boolean) extends GenericSignatureVisitor(nestedOnly) { - val innerClasses = mutable.Set.empty[T] + + val declaredInnerClasses = mutable.Set.empty[T] + val referredInnerClasses = mutable.Set.empty[T] + + def innerClasses: collection.Set[T] = declaredInnerClasses ++ referredInnerClasses + def clear(): Unit = { + declaredInnerClasses.clear() + referredInnerClasses.clear() + } def declaredNestedClasses(internalName: InternalName): List[T] @@ -641,7 +663,7 @@ object BackendUtils { def visit(classNode: ClassNode): Unit = { visitInternalName(classNode.name) - innerClasses ++= declaredNestedClasses(classNode.name) + declaredInnerClasses ++= declaredNestedClasses(classNode.name) visitInternalName(classNode.superName) classNode.interfaces.asScala foreach visitInternalName @@ -695,7 +717,8 @@ object BackendUtils { def visitInternalName(internalName: InternalName): Unit = if (internalName != null) { for (c <- getClassIfNested(internalName)) - innerClasses += c + if (!declaredInnerClasses.contains(c)) + referredInnerClasses += c } // either an internal/Name or [[Linternal/Name; -- there are certain references in classfiles diff --git a/test/files/run/java-not-private-inners/C.scala b/test/files/run/java-not-private-inners/C.scala new file mode 100644 index 000000000000..a659b5dc49fc --- /dev/null +++ b/test/files/run/java-not-private-inners/C.scala @@ -0,0 +1,7 @@ +object C { + private class Inner + + class OtherInner { + new Inner // trigger makeNotPrivate of `Inner`. + } +} diff --git a/test/files/run/java-not-private-inners/Test.java b/test/files/run/java-not-private-inners/Test.java new file mode 100644 index 000000000000..cc0da745d54b --- /dev/null +++ b/test/files/run/java-not-private-inners/Test.java @@ -0,0 +1,5 @@ +public class Test { + public static void main(String[] args) { + new C.Inner(); + } +} diff --git a/test/junit/scala/tools/nsc/DeterminismTest.scala b/test/junit/scala/tools/nsc/DeterminismTest.scala index dbbd0ec060f5..44cd452d0d5c 100644 --- a/test/junit/scala/tools/nsc/DeterminismTest.scala +++ b/test/junit/scala/tools/nsc/DeterminismTest.scala @@ -315,6 +315,21 @@ class DeterminismTest { test(List(code)) } + @Test def testReferenceToInnerClassMadeNonPrivate(): Unit = { + def code = List[SourceFile]( + source("t.scala", + """ + | trait T { + | private class Inner + | class OtherInner { new Inner } // triggers makeNotPrivate of Inner + | private val v: Option[Inner] = None + | } + """.stripMargin), + source("c.scala","""class C extends T""") + ) + test(List(code)) + } + def source(name: String, code: String): SourceFile = new BatchSourceFile(name, code) } diff --git a/test/junit/scala/tools/nsc/DeterminismTester.scala b/test/junit/scala/tools/nsc/DeterminismTester.scala index 66caaa5a515f..97a1914f02a9 100644 --- a/test/junit/scala/tools/nsc/DeterminismTester.scala +++ b/test/junit/scala/tools/nsc/DeterminismTester.scala @@ -42,6 +42,7 @@ class DeterminismTester { val referenceOutput = Files.createTempDirectory("reference") def compile(output: Path, files: List[SourceFile]): Unit = { + // println("compile: " + files) val g = new Global(new Settings) g.settings.usejavacp.value = true g.settings.classpath.value = output.toAbsolutePath.toString diff --git a/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala b/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala index 27f7ca5bcf38..7bd224b10f69 100644 --- a/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala +++ b/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala @@ -20,7 +20,7 @@ class NestedClassesCollectorTest { val c = new Collector def inners: List[String] = { val res = c.innerClasses.toList.sorted - c.innerClasses.clear() + c.clear() res } From 4746d541b0f7d134b438850a1c6ac042a69f0830 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Tue, 25 Aug 2020 11:40:06 +1000 Subject: [PATCH 39/46] Drop bug compatibility with Java privacy of inner classes --- .../scala/tools/nsc/backend/jvm/BTypes.scala | 5 ++--- .../backend/jvm/analysis/BackendUtils.scala | 21 +++++-------------- .../files/run/java-not-private-inners/C.scala | 7 ------- .../run/java-not-private-inners/Test.java | 5 ----- 4 files changed, 7 insertions(+), 31 deletions(-) delete mode 100644 test/files/run/java-not-private-inners/C.scala delete mode 100644 test/files/run/java-not-private-inners/Test.java diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala b/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala index faf711726039..f4c5bb3e9adb 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala @@ -689,8 +689,7 @@ abstract class BTypes { internalName, outerName.orNull, innerName.orNull, - flags = adjustStatic(i.flags), - refereeFlags = adjustStatic(if (exitingTyperPrivate) (i.flags & ~Opcodes.ACC_PUBLIC) | Opcodes.ACC_PRIVATE else i.flags) + flags = adjustStatic(if (exitingTyperPrivate) (i.flags & ~Opcodes.ACC_PUBLIC) | Opcodes.ACC_PRIVATE else i.flags) ) }) @@ -890,7 +889,7 @@ abstract class BTypes { * @param innerName The simple name of the inner class, may be null. * @param flags The flags for this class in the InnerClass entry. */ - final case class InnerClassEntry(name: String, outerName: String, innerName: String, flags: Int, refereeFlags: Int) + final case class InnerClassEntry(name: String, outerName: String, innerName: String, flags: Int) final case class ArrayBType(componentType: BType) extends RefBType { def dimension: Int = componentType match { diff --git a/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala b/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala index 614b80322d50..b4708c7ded6f 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/analysis/BackendUtils.scala @@ -373,26 +373,15 @@ abstract class BackendUtils extends PerRunInit { * can-multi-thread */ final def addInnerClasses(jclass: asm.tree.ClassNode, declaredInnerClasses: List[ClassBType], refedInnerClasses: List[ClassBType]) { - val allReferredNestedClasses = refedInnerClasses.flatMap(_.enclosingNestedClassesChain.get).distinct - - case class Entry(cls: ClassBType, isDeclared: Boolean) - // sorting ensures nested classes are listed after their enclosing class thus satisfying the Eclipse Java compiler - val allNestedClasses = new mutable.TreeSet[Entry]()(Ordering.by(_.cls.internalName)) - declaredInnerClasses.foreach(cls => allNestedClasses += Entry(cls, isDeclared = true)) - allReferredNestedClasses.foreach(cls => allNestedClasses += Entry(cls, isDeclared = false)) + val allNestedClasses = new mutable.TreeSet[ClassBType]()(Ordering.by(_.internalName)) + allNestedClasses ++= declaredInnerClasses + refedInnerClasses.foreach(_.enclosingNestedClassesChain.get.foreach(allNestedClasses += _)) for (nestedClass <- allNestedClasses) { // Extract the innerClassEntry - we know it exists, enclosingNestedClassesChain only returns nested classes. - val Some(e) = nestedClass.cls.innerClassAttributeEntry.get - // Although arguably a bug, we retain backwards compatibility with prior versions of scalac by - // emitting declared private inner classes that have been publicised with `makeNonPrivate` as ACC_PUBLIC. - // Java clients can see these classes, as shown in test/files/run/java-not-private-inners - // - // Inner class entries of referred classes now use the `exitingTyper(sym.isPrivate)` so that the value - // is stable between joint and separate compilation (see `DeterminismTest.testReferenceToInnerClassMadeNonPrivate` - val flags = if (nestedClass.isDeclared) e.flags else e.refereeFlags - jclass.visitInnerClass(e.name, e.outerName, e.innerName, flags) + val Some(e) = nestedClass.innerClassAttributeEntry.get + jclass.visitInnerClass(e.name, e.outerName, e.innerName, e.flags) } } diff --git a/test/files/run/java-not-private-inners/C.scala b/test/files/run/java-not-private-inners/C.scala deleted file mode 100644 index a659b5dc49fc..000000000000 --- a/test/files/run/java-not-private-inners/C.scala +++ /dev/null @@ -1,7 +0,0 @@ -object C { - private class Inner - - class OtherInner { - new Inner // trigger makeNotPrivate of `Inner`. - } -} diff --git a/test/files/run/java-not-private-inners/Test.java b/test/files/run/java-not-private-inners/Test.java deleted file mode 100644 index cc0da745d54b..000000000000 --- a/test/files/run/java-not-private-inners/Test.java +++ /dev/null @@ -1,5 +0,0 @@ -public class Test { - public static void main(String[] args) { - new C.Inner(); - } -} From f04fcd8486b35dcda83d4178b1230468098b96ab Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Mon, 7 Sep 2020 17:28:11 +0100 Subject: [PATCH 40/46] Add scalap to partest's IJ config --- src/intellij/partest.iml.SAMPLE | 1 + 1 file changed, 1 insertion(+) diff --git a/src/intellij/partest.iml.SAMPLE b/src/intellij/partest.iml.SAMPLE index 332f07efbb20..e1e2628654aa 100644 --- a/src/intellij/partest.iml.SAMPLE +++ b/src/intellij/partest.iml.SAMPLE @@ -12,6 +12,7 @@ + From 5a7ef0df3c0944c51552e581339b9bca410c53e8 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 7 Sep 2020 09:47:11 +1000 Subject: [PATCH 41/46] Fix NPE regression in immutable.HashMap.merge and add MiMa exclusions for private[collection] renamed field kv Co-authored-by: Mike Skells --- build.sbt | 2 ++ .../scala/collection/immutable/HashMap.scala | 16 ++++++++-------- .../scala/collection/immutable/HashMapTest.scala | 13 +++++++++++++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/build.sbt b/build.sbt index 6266357022ae..08c3e0557366 100644 --- a/build.sbt +++ b/build.sbt @@ -208,6 +208,8 @@ val mimaFilterSettings = Seq { ProblemFilters.exclude[MissingClassProblem]("scala.collection.immutable.HashMap$HashMapBuilder"), ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#Merger.retainIdentical"), ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashTrieMap.size0"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMap1.kv"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMap1.kv_="), ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.collection.immutable.HashSet#HashSetCollision1.union0"), ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashSet#HashSetCollision1.union0"), diff --git a/src/library/scala/collection/immutable/HashMap.scala b/src/library/scala/collection/immutable/HashMap.scala index 1997f1e6908d..c8f1a541cc8b 100644 --- a/src/library/scala/collection/immutable/HashMap.scala +++ b/src/library/scala/collection/immutable/HashMap.scala @@ -342,7 +342,7 @@ object HashMap extends ImmutableMapFactory[HashMap] with BitOperations.Int { } @deprecatedInheritance("This class will be made final in a future release.", "2.12.2") - class HashMap1[A,+B](private[collection] val key: A, private[collection] val hash: Int, private[collection] val value: (B @uV), private[collection] var kv: (A,B @uV)) extends HashMap[A,B] { + class HashMap1[A,+B](private[collection] val key: A, private[collection] val hash: Int, private[collection] val value: (B @uV), private[this] var kvOrNull: (A,B @uV)) extends HashMap[A,B] { override def size = 1 private[collection] def getKey = key @@ -394,8 +394,8 @@ object HashMap extends ImmutableMapFactory[HashMap] with BitOperations.Int { override def foreach[U](f: ((A, B)) => U): Unit = f(ensurePair) override private[immutable] def foreachEntry[U](f: (A, B) => U): Unit = f(key, value) // this method may be called multiple times in a multi-threaded environment, but that's ok - private[HashMap] def ensurePair: (A, B) = if (kv ne null) kv else { - kv = (key, value); kv + private[HashMap] def ensurePair: (A, B) = if (kvOrNull ne null) kvOrNull else { + kvOrNull = (key, value); kvOrNull } protected[HashMap] override def merge0[B1 >: B](that: HashMap[A, B1], level: Int, merger: Merger[A, B1]): HashMap[A, B1] = { @@ -405,10 +405,10 @@ object HashMap extends ImmutableMapFactory[HashMap] with BitOperations.Int { else if (this.hash == hm1.hash && this.key == hm1.key) if (merger eq HashMap.defaultMerger) this else if (merger eq HashMap.defaultMerger.invert) hm1 - else this.updated0(hm1.key, hm1.hash, level, hm1.value, hm1.kv, merger) - else this.updated0(hm1.key, hm1.hash, level, hm1.value, hm1.kv, merger) + else this.updated0(hm1.key, hm1.hash, level, hm1.value, hm1.ensurePair, merger) + else this.updated0(hm1.key, hm1.hash, level, hm1.value, hm1.ensurePair, merger) case _ => - that.updated0(key, hash, level, value, kv, merger.invert) + that.updated0(key, hash, level, value, ensurePair, merger.invert) } } @@ -504,7 +504,7 @@ object HashMap extends ImmutableMapFactory[HashMap] with BitOperations.Int { hm.merge0(this, level, merger.invert) case h1: HashMap1[A, B1] => if (h1.hash != hash) makeHashTrieMap(hash, this, h1.hash, h1, level, size + 1) - else updated0(h1.key, h1.hash, level, h1.value, h1.kv, merger) + else updated0(h1.key, h1.hash, level, h1.value, h1.ensurePair, merger) case c: HashMapCollision1[A, B1] => if (c.hash != hash) makeHashTrieMap(hash, this, c.hash, c, level, c.size + size) else if (merger.retainIdentical && (c eq this)) this @@ -760,7 +760,7 @@ object HashMap extends ImmutableMapFactory[HashMap] with BitOperations.Int { protected[HashMap] override def merge0[B1 >: B](that: HashMap[A, B1], level: Int, merger: Merger[A, B1]): HashMap[A, B1] = that match { case hm: HashMap1[A, B1] => - this.updated0(hm.key, hm.hash, level, hm.value.asInstanceOf[B1], hm.kv, merger) + this.updated0(hm.key, hm.hash, level, hm.value.asInstanceOf[B1], hm.ensurePair, merger) case that: HashTrieMap[A, B1] => def mergeMaybeSubset(larger: HashTrieMap[A, B1], smaller: HashTrieMap[A, B1], merger: Merger[A, B1]):HashTrieMap[A, B1] = { var resultElems: Array[HashMap[A, B1]] = null diff --git a/test/junit/scala/collection/immutable/HashMapTest.scala b/test/junit/scala/collection/immutable/HashMapTest.scala index c62db75b4f7a..ec7a2c66acc7 100644 --- a/test/junit/scala/collection/immutable/HashMapTest.scala +++ b/test/junit/scala/collection/immutable/HashMapTest.scala @@ -298,4 +298,17 @@ class HashMapTest extends AllocationTest { check(cs => TreeMap(cs: _*)) // exercise special case for HashMap/HasForEachEntry check(cs => HashMap(cs: _*).withDefault(_ => ???)) // default cases } + + @Test + def t12140(): Unit = { + trait DataType extends Product with Serializable + case class Foo(arg: String) extends DataType + case class Bar(arg: String) extends DataType + + // Create a HashMap consisting of a single HashMapCollision1. + val collision = HashMap(Foo("toxic") -> 0, Bar("toxic") -> 0) + val singleton = (new HashMap[DataType, Int]).updated(Foo("toxic"), 0) + + collision ++ singleton // was NullPointerExeption + } } From 568fe7ffccaca5793f90a615acc91cb1156102d4 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Mon, 14 Sep 2020 16:49:35 +0100 Subject: [PATCH 42/46] Fix merge conflict mistake in 3d5e61267e91f78e00c438e03bc02096e905213d --- .../tools/nsc/backend/jvm/NestedClassesCollectorTest.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala b/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala index d98ed257114e..c31ba455b043 100644 --- a/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala +++ b/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala @@ -19,8 +19,11 @@ class Collector extends NestedClassesCollector[String](nestedOnly = false) { @RunWith(classOf[JUnit4]) class NestedClassesCollectorTest { val c = new Collector { - override def visitInternalName(internalName: String, offset: Int, length: Int): Unit = - innerClasses += internalName.substring(offset, length) + override def visitInternalName(internalName: String, offset: Int, length: Int): Unit = { + val c = internalName.substring(offset, length) + if (!declaredInnerClasses.contains(c)) + referredInnerClasses += c + } } def inners: List[String] = { val res = c.innerClasses.toList.sorted From 4485dcbdd8a28aa0ead8e36ce3b88b566249e3c3 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Tue, 15 Sep 2020 07:53:44 +0100 Subject: [PATCH 43/46] Migrate some flag files ... need to last-mile the flagsfile work in 2.12.x... --- test/files/neg/t10019.check | 10 +++++----- test/files/neg/t10019.flags | 1 - test/files/neg/t10019.scala | 1 + test/files/pos/case-object-add-serializable.flags | 1 - test/files/pos/case-object-add-serializable.scala | 1 + test/files/pos/t10373.flags | 1 - test/files/pos/t10373.scala | 1 + 7 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 test/files/neg/t10019.flags delete mode 100644 test/files/pos/case-object-add-serializable.flags delete mode 100644 test/files/pos/t10373.flags diff --git a/test/files/neg/t10019.check b/test/files/neg/t10019.check index 9b861e903be1..3eb9db6bf2c3 100644 --- a/test/files/neg/t10019.check +++ b/test/files/neg/t10019.check @@ -1,11 +1,11 @@ -t10019.scala:4: warning: match may not be exhaustive. +t10019.scala:5: warning: match may not be exhaustive. It would fail on the following input: Foo(None) def single(t: Foo): Nothing = t match { ^ -t10019.scala:8: warning: match may not be exhaustive. +t10019.scala:9: warning: match may not be exhaustive. It would fail on the following input: (Foo(None), _) def tuple(s: Foo, t: Foo): Nothing = (s, t) match { ^ -error: No warnings can be incurred under -Xfatal-warnings. -two warnings found -one error found +error: No warnings can be incurred under -Werror. +2 warnings +1 error diff --git a/test/files/neg/t10019.flags b/test/files/neg/t10019.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/neg/t10019.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/neg/t10019.scala b/test/files/neg/t10019.scala index 04cd95035f66..9d9aac4e7ff3 100644 --- a/test/files/neg/t10019.scala +++ b/test/files/neg/t10019.scala @@ -1,3 +1,4 @@ +// scalac: -Werror object Bug { sealed case class Foo(e: Option[Int]) diff --git a/test/files/pos/case-object-add-serializable.flags b/test/files/pos/case-object-add-serializable.flags deleted file mode 100644 index 1134633fd40a..000000000000 --- a/test/files/pos/case-object-add-serializable.flags +++ /dev/null @@ -1 +0,0 @@ --Xdev -Xfatal-warnings diff --git a/test/files/pos/case-object-add-serializable.scala b/test/files/pos/case-object-add-serializable.scala index dae3e9ab922d..7728649414a7 100644 --- a/test/files/pos/case-object-add-serializable.scala +++ b/test/files/pos/case-object-add-serializable.scala @@ -1,3 +1,4 @@ +// scalac: -Xdev -Werror // Was: "warning: !!! base trait Serializable not found in basetypes of object Person. This might indicate incorrect caching of TypeRef#parents." // under -Xdev class Test { diff --git a/test/files/pos/t10373.flags b/test/files/pos/t10373.flags deleted file mode 100644 index 85d8eb2ba295..000000000000 --- a/test/files/pos/t10373.flags +++ /dev/null @@ -1 +0,0 @@ --Xfatal-warnings diff --git a/test/files/pos/t10373.scala b/test/files/pos/t10373.scala index c588607d3d41..fc285faef084 100644 --- a/test/files/pos/t10373.scala +++ b/test/files/pos/t10373.scala @@ -1,3 +1,4 @@ +// scalac: -Werror abstract class Foo { def bar(): Unit = this match { case Foo_1() => //do something From 9a13083df90b12e5256e2ce293ccb6a397ff7bb0 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Wed, 16 Sep 2020 12:27:46 +0100 Subject: [PATCH 44/46] When partest diffs, make sure the outDir exists Was getting the following in CI, because test/files/neg/t10019-neg.obj wasn't being created. The reason it was even going down this route was because the fatal warnings option was still in a flags file (fix in the previous commit). [error] Uncaught exception when running partest: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Error running /home/travis/build/scala/scala/test/files/neg/t10019.scala [error] sbt.ForkMain$ForkError: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Error running /home/travis/build/scala/scala/test/files/neg/t10019.scala [error] at java.util.concurrent.FutureTask.report(FutureTask.java:122) [error] at java.util.concurrent.FutureTask.get(FutureTask.java:192) [error] at scala.tools.partest.nest.AbstractRunner.runTestsForFiles(AbstractRunner.scala:353) [error] at scala.tools.partest.nest.AbstractRunner.$anonfun$run$17(AbstractRunner.scala:254) [error] at scala.tools.partest.nest.AbstractRunner.$anonfun$run$17$adapted(AbstractRunner.scala:250) [error] at scala.collection.ArrayOps$WithFilter.foreach(ArrayOps.scala:73) [error] at scala.tools.partest.nest.AbstractRunner.$anonfun$run$15(AbstractRunner.scala:250) [error] at scala.tools.partest.nest.AbstractRunner.run(AbstractRunner.scala:250) [error] at scala.tools.partest.sbt.PartestTask.execute(Framework.scala:55) [error] at sbt.ForkMain$Run.lambda$runTest$1(ForkMain.java:304) [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [error] at java.lang.Thread.run(Thread.java:748) [error] Caused by: sbt.ForkMain$ForkError: java.lang.RuntimeException: Error running /home/travis/build/scala/scala/test/files/neg/t10019.scala [error] at scala.tools.partest.nest.AbstractRunner.liftedTree1$1(AbstractRunner.scala:312) [error] at scala.tools.partest.nest.AbstractRunner.runTest(AbstractRunner.scala:310) [error] at scala.tools.partest.nest.AbstractRunner.$anonfun$runTestsForFiles$2(AbstractRunner.scala:335) [error] at scala.tools.partest.package$$anon$2.call(package.scala:141) [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [error] at java.lang.Thread.run(Thread.java:748) [error] Caused by: sbt.ForkMain$ForkError: java.io.IOException: No such file or directory [error] at java.io.UnixFileSystem.createFileExclusively(Native Method) [error] at java.io.File.createTempFile(File.java:2026) [error] at scala.tools.partest.nest.Runner.$anonfun$diffIsOk$2(Runner.scala:425) [error] at scala.tools.partest.nest.Runner.diffIsOk(Runner.scala:425) [error] at scala.tools.partest.nest.Runner.checked$1(Runner.scala:537) [error] at scala.tools.partest.nest.Runner.$anonfun$runNegTest$3(Runner.scala:540) [error] at scala.tools.partest.nest.Runner.$anonfun$runNegTest$1(Runner.scala:540) [error] at scala.tools.partest.nest.Runner.runInContext(Runner.scala:437) [error] at scala.tools.partest.nest.Runner.runNegTest(Runner.scala:532) [error] at scala.tools.partest.nest.Runner.run(Runner.scala:631) [error] at scala.tools.partest.nest.AbstractRunner.liftedTree1$1(AbstractRunner.scala:310) [error] at scala.tools.partest.nest.AbstractRunner.runTest(AbstractRunner.scala:310) [error] at scala.tools.partest.nest.AbstractRunner.$anonfun$runTestsForFiles$2(AbstractRunner.scala:335) [error] at scala.tools.partest.package$$anon$2.call(package.scala:141) [error] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [error] at java.lang.Thread.run(Thread.java:748) --- src/partest/scala/tools/partest/nest/Runner.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/partest/scala/tools/partest/nest/Runner.scala b/src/partest/scala/tools/partest/nest/Runner.scala index def13edc3ad2..db9db83f2a44 100644 --- a/src/partest/scala/tools/partest/nest/Runner.scala +++ b/src/partest/scala/tools/partest/nest/Runner.scala @@ -422,7 +422,7 @@ class Runner(val testInfo: TestInfo, val suiteRunner: AbstractRunner) { val bestDiff = if (!checkFile.canRead) diff else - gitRunner.flatMap(_ => withTempFile(outFile, fileBase, filteredCheck)(f => + gitRunner.flatMap(_ => withTempFile(outDir, fileBase, filteredCheck)(f => gitDiff(f, logFile))).getOrElse(diff) _transcript append bestDiff genFail("output differs") From 4bc4be53c15f9e215be9f0ce723dfd2b668b396a Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Thu, 17 Sep 2020 10:20:57 +0100 Subject: [PATCH 45/46] Ignore DeterminismTest testReferenceToInnerClassMadeNonPrivate --- test/junit/scala/tools/nsc/DeterminismTest.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/junit/scala/tools/nsc/DeterminismTest.scala b/test/junit/scala/tools/nsc/DeterminismTest.scala index fa8fd9c9e966..1938ab9cfd9d 100644 --- a/test/junit/scala/tools/nsc/DeterminismTest.scala +++ b/test/junit/scala/tools/nsc/DeterminismTest.scala @@ -1,6 +1,6 @@ package scala.tools.nsc -import org.junit.Test +import org.junit.{ Ignore, Test } import scala.reflect.internal.util.{BatchSourceFile, SourceFile} @@ -315,6 +315,7 @@ class DeterminismTest { test(List(code)) } + @Ignore // TODO un-@Ignore and fix, scala/bug#12156 @Test def testReferenceToInnerClassMadeNonPrivate(): Unit = { def code = List[SourceFile]( source("t.scala", From ad19d1aa2ad3692967a1aca1b3ff7aecceb45af8 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 18 Sep 2020 10:15:46 +1000 Subject: [PATCH 46/46] Fix off-by-one-phase error in backend private flag lookup Fixes scala/bug#12156 --- src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala | 6 +++--- .../scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala | 2 +- test/junit/scala/tools/nsc/DeterminismTest.scala | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala b/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala index ec75bf2a83af..96197ee1710d 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BTypes.scala @@ -676,7 +676,7 @@ abstract class BTypes { } def innerClassAttributeEntry: Either[NoClassBTypeInfo, Option[InnerClassEntry]] = info.map(i => i.nestedInfo.force map { - case NestedInfo(_, outerName, innerName, isStaticNestedClass, exitingTyperPrivate) => + case NestedInfo(_, outerName, innerName, isStaticNestedClass, enteringTyperPrivate) => // the static flag in the InnerClass table has a special meaning, see InnerClass comment def adjustStatic(flags: Int): Int = ( flags & ~Opcodes.ACC_STATIC | (if (isStaticNestedClass) Opcodes.ACC_STATIC else 0) @@ -685,7 +685,7 @@ abstract class BTypes { internalName, outerName.orNull, innerName.orNull, - flags = adjustStatic(if (exitingTyperPrivate) (i.flags & ~Opcodes.ACC_PUBLIC) | Opcodes.ACC_PRIVATE else i.flags) + flags = adjustStatic(if (enteringTyperPrivate) (i.flags & ~Opcodes.ACC_PUBLIC) | Opcodes.ACC_PRIVATE else i.flags) ) }) @@ -878,7 +878,7 @@ abstract class BTypes { outerName: Option[String], innerName: Option[String], isStaticNestedClass: Boolean, - exitingTyperPrivate: Boolean) + enteringTyperPrivate: Boolean) /** * This class holds the data for an entry in the InnerClass table. See the InnerClass summary diff --git a/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala b/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala index c902b8b2d657..544c43fd386c 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/BTypesFromSymbols.scala @@ -503,7 +503,7 @@ abstract class BTypesFromSymbols[G <: Global](val global: G) extends BTypes { else Some(s"${innerClassSym.rawname}${innerClassSym.moduleSuffix}") // moduleSuffix for module classes } - Some(NestedInfo(enclosingClass, outerName, innerName, isStaticNestedClass, exitingTyper(innerClassSym.isPrivate))) + Some(NestedInfo(enclosingClass, outerName, innerName, isStaticNestedClass, enteringTyper(innerClassSym.isPrivate))) } /** diff --git a/test/junit/scala/tools/nsc/DeterminismTest.scala b/test/junit/scala/tools/nsc/DeterminismTest.scala index 1938ab9cfd9d..1053caf1f779 100644 --- a/test/junit/scala/tools/nsc/DeterminismTest.scala +++ b/test/junit/scala/tools/nsc/DeterminismTest.scala @@ -315,7 +315,6 @@ class DeterminismTest { test(List(code)) } - @Ignore // TODO un-@Ignore and fix, scala/bug#12156 @Test def testReferenceToInnerClassMadeNonPrivate(): Unit = { def code = List[SourceFile]( source("t.scala",