summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2014-01-30 09:18:06 +0300
committerEugene Burmako <xeno.by@gmail.com>2014-02-14 23:51:21 +0100
commitf14e9fe5eda611798d95955620b3e653a2991475 (patch)
tree52ebda74e66a4e351779e1b647e3cd9b9dc56380 /test
parentda09331324d302d0b85a89cdcfe32ded2587b39a (diff)
downloadscala-f14e9fe5eda611798d95955620b3e653a2991475.tar.gz
scala-f14e9fe5eda611798d95955620b3e653a2991475.tar.bz2
scala-f14e9fe5eda611798d95955620b3e653a2991475.zip
deprecates String => Name implicit conversions
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.
Diffstat (limited to 'test')
-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
8 files changed, 14 insertions, 14 deletions
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)