summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/reflect/scala/reflect/api/Names.scala2
-rw-r--r--test/files/run/compiler-asSeenFrom.scala2
-rw-r--r--test/files/run/existentials-in-compiler.scala2
-rw-r--r--test/files/run/fail-non-value-types.scala4
-rw-r--r--test/files/run/no-pickle-skolems/Test_2.scala2
-rw-r--r--test/files/run/reflection-names.scala8
-rw-r--r--test/files/run/t6439.check4
-rw-r--r--test/files/run/t6439.scala4
-rw-r--r--test/files/run/t7096.scala2
9 files changed, 16 insertions, 14 deletions
diff --git a/src/reflect/scala/reflect/api/Names.scala b/src/reflect/scala/reflect/api/Names.scala
index 23436ca8e7..30c512ab64 100644
--- a/src/reflect/scala/reflect/api/Names.scala
+++ b/src/reflect/scala/reflect/api/Names.scala
@@ -33,12 +33,14 @@ trait Names {
* Enables an alternative notation `"map": TermName` as opposed to `newTermName("map")`.
* @group Names
*/
+ @deprecated("Use explicit `TermName(s)` instead", "2.11.0")
implicit def stringToTermName(s: String): TermName = TermName(s)
/** An implicit conversion from String to TypeName.
* Enables an alternative notation `"List": TypeName` as opposed to `newTypeName("List")`.
* @group Names
*/
+ @deprecated("Use explicit `TypeName(s)` instead", "2.11.0")
implicit def stringToTypeName(s: String): TypeName = TypeName(s)
/** The abstract type of names.
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)