From f14e9fe5eda611798d95955620b3e653a2991475 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Thu, 30 Jan 2014 09:18:06 +0300 Subject: deprecates String => Name implicit conversions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Given that in 2.11 we have upgraded our name construction facility from `newTxxxName` to `TxxxName`, I think it’s time we retire these implicit conversions, as they no longer save keystrokes, but continue to present ambient danger associated with implicit conversions. --- test/files/run/compiler-asSeenFrom.scala | 2 +- test/files/run/existentials-in-compiler.scala | 2 +- test/files/run/fail-non-value-types.scala | 4 ++-- test/files/run/no-pickle-skolems/Test_2.scala | 2 +- test/files/run/reflection-names.scala | 8 ++++---- test/files/run/t6439.check | 4 ++-- test/files/run/t6439.scala | 4 ++-- test/files/run/t7096.scala | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) (limited to 'test') diff --git a/test/files/run/compiler-asSeenFrom.scala b/test/files/run/compiler-asSeenFrom.scala index 61aa013696..ea96c6fba7 100644 --- a/test/files/run/compiler-asSeenFrom.scala +++ b/test/files/run/compiler-asSeenFrom.scala @@ -42,7 +42,7 @@ abstract class CompilerTest extends DirectTest { } class SymsInPackage(pkgName: String) { - def pkg = rootMirror.getPackage(pkgName) + def pkg = rootMirror.getPackage(TermName(pkgName)) def classes = allMembers(pkg) filter (_.isClass) def modules = allMembers(pkg) filter (_.isModule) def symbols = classes ++ terms filterNot (_ eq NoSymbol) diff --git a/test/files/run/existentials-in-compiler.scala b/test/files/run/existentials-in-compiler.scala index f5a0aa98d0..d019d56b42 100644 --- a/test/files/run/existentials-in-compiler.scala +++ b/test/files/run/existentials-in-compiler.scala @@ -75,7 +75,7 @@ package extest { """ override def check(source: String, unit: global.CompilationUnit) { - getPackage("extest").moduleClass.info.decls.toList.filter(_.isType).map(_.initialize).sortBy(_.name.toString) foreach { clazz => + getPackage(TermName("extest")).moduleClass.info.decls.toList.filter(_.isType).map(_.initialize).sortBy(_.name.toString) foreach { clazz => exitingTyper { clazz.info println(clazz.defString) diff --git a/test/files/run/fail-non-value-types.scala b/test/files/run/fail-non-value-types.scala index 51198a5f31..a42fbbf481 100644 --- a/test/files/run/fail-non-value-types.scala +++ b/test/files/run/fail-non-value-types.scala @@ -18,8 +18,8 @@ object Test { def tcon[T: TypeTag](args: Type*) = appliedType(typeOf[T].typeConstructor, args.toList) def cil = typeOf[CompletelyIndependentList[Int]] - def map = cil.member("map": TermName).asMethod - def distinct = cil.member("distinct": TermName).asMethod + def map = cil.member(TermName("map")).asMethod + def distinct = cil.member(TermName("distinct")).asMethod def main(args: Array[String]): Unit = { // Need the assert in there to fail. diff --git a/test/files/run/no-pickle-skolems/Test_2.scala b/test/files/run/no-pickle-skolems/Test_2.scala index 8fd6016aea..3293dda66d 100644 --- a/test/files/run/no-pickle-skolems/Test_2.scala +++ b/test/files/run/no-pickle-skolems/Test_2.scala @@ -32,7 +32,7 @@ object Test { } def main(args: Array[String]): Unit = { - val syms = collectSymbols[s.Bar]("to", "CC") + val syms = collectSymbols[s.Bar](TermName("to"), "CC") assert(syms.size == 1, syms) println("OK!") } diff --git a/test/files/run/reflection-names.scala b/test/files/run/reflection-names.scala index 2433c84813..a297b85825 100644 --- a/test/files/run/reflection-names.scala +++ b/test/files/run/reflection-names.scala @@ -4,10 +4,10 @@ object Test { val global = new Global(new Settings()) import global._ - val x1 = "abc" drop 1 // "bc": String - val x2 = ("abc": TermName) drop 1 // "bc": TermName - val x3 = ("abc": TypeName) drop 1 // "bc": TypeName - val x4 = (("abc": TypeName): Name) drop 1 // "bc": Name + val x1 = "abc" drop 1 // "bc": String + val x2 = TermName("abc") drop 1 // "bc": TermName + val x3 = TypeName("abc") drop 1 // "bc": TypeName + val x4 = (TypeName("abc"): Name) drop 1 // "bc": Name def main(args: Array[String]): Unit = { List(x1, x2, x3, x4) foreach (x => println(x.getClass.getName, x)) diff --git a/test/files/run/t6439.check b/test/files/run/t6439.check index f804fa75f4..f8d5b3a8cd 100644 --- a/test/files/run/t6439.check +++ b/test/files/run/t6439.check @@ -59,8 +59,8 @@ scala> :power scala> object lookup { import intp._ def apply(name: String): Symbol = types(name) orElse terms(name) - def types(name: String): Symbol = replScope lookup (name: TypeName) orElse getClassIfDefined(name) - def terms(name: String): Symbol = replScope lookup (name: TermName) orElse getModuleIfDefined(name) + def types(name: String): Symbol = replScope lookup (TypeName(name)) orElse getClassIfDefined(name) + def terms(name: String): Symbol = replScope lookup (TermName(name)) orElse getModuleIfDefined(name) def types[T: global.TypeTag] : Symbol = typeOf[T].typeSymbol def terms[T: global.TypeTag] : Symbol = typeOf[T].termSymbol def apply[T: global.TypeTag] : Symbol = typeOf[T].typeSymbol diff --git a/test/files/run/t6439.scala b/test/files/run/t6439.scala index 175a1d134f..53155a71a1 100644 --- a/test/files/run/t6439.scala +++ b/test/files/run/t6439.scala @@ -21,8 +21,8 @@ type F = Int // no warn object lookup { import intp._ def apply(name: String): Symbol = types(name) orElse terms(name) - def types(name: String): Symbol = replScope lookup (name: TypeName) orElse getClassIfDefined(name) - def terms(name: String): Symbol = replScope lookup (name: TermName) orElse getModuleIfDefined(name) + def types(name: String): Symbol = replScope lookup (TypeName(name)) orElse getClassIfDefined(name) + def terms(name: String): Symbol = replScope lookup (TermName(name)) orElse getModuleIfDefined(name) def types[T: global.TypeTag] : Symbol = typeOf[T].typeSymbol def terms[T: global.TypeTag] : Symbol = typeOf[T].termSymbol def apply[T: global.TypeTag] : Symbol = typeOf[T].typeSymbol diff --git a/test/files/run/t7096.scala b/test/files/run/t7096.scala index f36f99db95..e7a894fc23 100644 --- a/test/files/run/t7096.scala +++ b/test/files/run/t7096.scala @@ -41,7 +41,7 @@ abstract class CompilerTest extends DirectTest { } class SymsInPackage(pkgName: String) { - def pkg = rootMirror.getPackage(pkgName) + def pkg = rootMirror.getPackage(TermName(pkgName)) def classes = allMembers(pkg) filter (_.isClass) def modules = allMembers(pkg) filter (_.isModule) def symbols = classes ++ terms filterNot (_ eq NoSymbol) -- cgit v1.2.3