diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala | 13 | ||||
-rw-r--r-- | test/files/neg/array-not-seq.check | 15 | ||||
-rw-r--r-- | test/files/neg/array-not-seq.flags | 1 | ||||
-rw-r--r-- | test/files/neg/array-not-seq.scala | 26 |
4 files changed, 0 insertions, 55 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala index c5494b5b1f..3f7fff3954 100644 --- a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala +++ b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala @@ -83,12 +83,6 @@ abstract class ExplicitOuter extends InfoTransform } } - /** Issue a migration warning for instance checks which might be on an Array and - * for which the type parameter conforms to Seq, because these answers changed in 2.8. - */ - def isArraySeqTest(lhs: Type, rhs: Type) = - (ArrayClass.tpe <:< lhs.widen) && (rhs.widen matchesPattern SeqClass.tpe) - def outerAccessor(clazz: Symbol): Symbol = { val firstTry = clazz.info.decl(nme.expandedName(nme.OUTER, clazz)) if (firstTry != NoSymbol && firstTry.outerSource == clazz) firstTry @@ -550,13 +544,6 @@ abstract class ExplicitOuter extends InfoTransform } case _ => - if (settings.Xmigration28.value) tree match { - case TypeApply(fn @ Select(qual, _), args) if fn.symbol == Object_isInstanceOf || fn.symbol == Any_isInstanceOf => - if (isArraySeqTest(qual.tpe, args.head.tpe)) - unit.warning(tree.pos, "An Array will no longer match as Seq[_].") - case _ => () - } - val x = super.transform(tree) if (x.tpe eq null) x else x setType transformInfo(currentOwner, x.tpe) diff --git a/test/files/neg/array-not-seq.check b/test/files/neg/array-not-seq.check deleted file mode 100644 index 6cfaa06efb..0000000000 --- a/test/files/neg/array-not-seq.check +++ /dev/null @@ -1,15 +0,0 @@ -array-not-seq.scala:2: warning: An Array will no longer match as Seq[_]. - def f1(x: Any) = x.isInstanceOf[Seq[_]] - ^ -array-not-seq.scala:4: warning: An Array will no longer match as Seq[_]. - case _: Seq[_] => true - ^ -array-not-seq.scala:16: warning: An Array will no longer match as Seq[_]. - case (Some(_: Seq[_]), Nil, _) => 1 - ^ -array-not-seq.scala:17: warning: An Array will no longer match as Seq[_]. - case (None, List(_: List[_], _), _) => 2 - ^ -error: No warnings can be incurred under -Xfatal-warnings. -four warnings found -one error found diff --git a/test/files/neg/array-not-seq.flags b/test/files/neg/array-not-seq.flags deleted file mode 100644 index 4e9f7e4a56..0000000000 --- a/test/files/neg/array-not-seq.flags +++ /dev/null @@ -1 +0,0 @@ --Xmigration -Xfatal-warnings
\ No newline at end of file diff --git a/test/files/neg/array-not-seq.scala b/test/files/neg/array-not-seq.scala deleted file mode 100644 index 5f367bdd85..0000000000 --- a/test/files/neg/array-not-seq.scala +++ /dev/null @@ -1,26 +0,0 @@ -object Test { - def f1(x: Any) = x.isInstanceOf[Seq[_]] - def f2(x: Any) = x match { - case _: Seq[_] => true - case _ => false - } - - def f3(x: Any) = x match { - case _: Array[_] => true - case _ => false - } - - def f4(x: Any) = x.isInstanceOf[Traversable[_]] - - def f5(x1: Any, x2: Any, x3: AnyRef) = (x1, x2, x3) match { - case (Some(_: Seq[_]), Nil, _) => 1 - case (None, List(_: List[_], _), _) => 2 - case _ => 3 - } - - def main(args: Array[String]): Unit = { - // println(f1(Array(1))) - // println(f2(Array(1))) - // println(f3(Array(1)) - } -} |