From e5ed594a89f4e468f3a9e754eb75687885908ba3 Mon Sep 17 00:00:00 2001 From: Den Shabalin Date: Sat, 8 Dec 2012 13:47:14 +0100 Subject: Adds extractors for TypeName, TermName and Modifiers This change allows to pattern match over type names, term names and modifiers. Otherwise it can be quite painful to match over complex trees as each name or modifiers requires a guard. This pull request also changes the name of default constructor for term and type names i.e. TypeName(s) instead of newTermName(s). This is shorter to type, more consistent with the rest of reflection api and consistent with the way it will be pattern matched later on. --- test/files/scalacheck/ReflectionExtractors.scala | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 test/files/scalacheck/ReflectionExtractors.scala (limited to 'test/files') diff --git a/test/files/scalacheck/ReflectionExtractors.scala b/test/files/scalacheck/ReflectionExtractors.scala new file mode 100644 index 0000000000..a2615feb3e --- /dev/null +++ b/test/files/scalacheck/ReflectionExtractors.scala @@ -0,0 +1,52 @@ +import org.scalacheck._ +import Prop._ +import Gen._ +import Arbitrary._ + +import scala.reflect.runtime.universe._ +import Flag._ + +object Test extends Properties("reflection extractors") { + + val genFlag = oneOf( + TRAIT, INTERFACE, MUTABLE, MACRO, DEFERRED, ABSTRACT, FINAL, SEALED, + IMPLICIT, LAZY, OVERRIDE, PRIVATE, PROTECTED, LOCAL, CASE, ABSOVERRIDE, + BYNAMEPARAM, PARAM, COVARIANT, CONTRAVARIANT, DEFAULTPARAM, PRESUPER, + DEFAULTINIT + ) + val genModifiers = + for(flag <- genFlag; privateWithin <- genName) + yield Modifiers(flag, privateWithin, Nil) + val genTermName = for(name <- arbitrary[String]) yield TermName(name) + val genTypeName = for(name <- arbitrary[String]) yield TypeName(name) + val genName = oneOf(genTermName, genTypeName) + + implicit val arbTermName: Arbitrary[TermName] = Arbitrary(genTermName) + implicit val arbTypeName: Arbitrary[TypeName] = Arbitrary(genTypeName) + implicit val arbName: Arbitrary[Name] = Arbitrary(genName) + implicit val arbMods: Arbitrary[Modifiers] = Arbitrary(genModifiers) + + property("extract term name") = forAll { (name: TermName) => + val TermName(s) = name + s == name.toString + } + + property("extract type name") = forAll { (name: TypeName) => + val TypeName(s) = name + s == name.toString + } + + property("extract term or type name") = forAll { (name: Name) => + name match { + case TermName(s) => s == name.toString + case TypeName(s) => s == name.toString + } + } + + property("extract modifiers") = forAll { (mods: Modifiers) => + val Modifiers(flags, priv, annots) = mods + flags == mods.flags && + priv == mods.privateWithin && + annots == mods.annotations + } +} \ No newline at end of file -- cgit v1.2.3 From eea635a1c60a72a8a465fbf2cd659442c6b763ea Mon Sep 17 00:00:00 2001 From: Den Shabalin Date: Tue, 11 Dec 2012 18:17:56 +0100 Subject: Changes reflection tests to use shorter name constructors --- .../neg/macro-basic-mamdmi/Impls_Macros_Test_1.scala | 6 +++--- test/files/neg/macro-invalidimpl-f/Impls_1.scala | 2 +- test/files/neg/macro-invalidimpl-g/Impls_1.scala | 2 +- .../Impls_Macros_1.scala | 6 +++--- .../Impls_1.scala | 2 +- .../Impls_1.scala | 2 +- test/files/neg/macro-without-xmacros-a/Impls_1.scala | 6 +++--- test/files/neg/macro-without-xmacros-b/Impls_1.scala | 6 +++--- test/files/run/idempotency-this.check | 2 +- test/files/run/macro-abort-fresh/Macros_1.scala | 2 +- test/files/run/macro-abort-fresh/Test_2.scala | 2 +- test/files/run/macro-basic-ma-md-mi/Impls_1.scala | 6 +++--- .../run/macro-basic-ma-mdmi/Impls_Macros_1.scala | 6 +++--- test/files/run/macro-basic-mamd-mi/Impls_1.scala | 6 +++--- test/files/run/macro-bodyexpandstoimpl/Impls_1.scala | 2 +- .../run/macro-declared-in-annotation/Impls_1.scala | 2 +- .../run/macro-declared-in-anonymous/Impls_1.scala | 4 ++-- test/files/run/macro-declared-in-block/Impls_1.scala | 4 ++-- .../run/macro-declared-in-class-class/Impls_1.scala | 4 ++-- .../run/macro-declared-in-class-object/Impls_1.scala | 4 ++-- test/files/run/macro-declared-in-class/Impls_1.scala | 4 ++-- .../macro-declared-in-default-param/Impls_1.scala | 2 +- .../Impls_Macros_1.scala | 4 ++-- .../files/run/macro-declared-in-method/Impls_1.scala | 4 ++-- .../run/macro-declared-in-object-class/Impls_1.scala | 4 ++-- .../macro-declared-in-object-object/Impls_1.scala | 4 ++-- .../files/run/macro-declared-in-object/Impls_1.scala | 4 ++-- .../macro-declared-in-package-object/Impls_1.scala | 4 ++-- .../run/macro-declared-in-refinement/Impls_1.scala | 4 ++-- test/files/run/macro-declared-in-trait/Impls_1.scala | 4 ++-- .../run/macro-def-infer-return-type-b/Test_2.scala | 2 +- .../macro-expand-implicit-argument/Macros_1.scala | 6 +++--- .../Impls_1.scala | 2 +- .../Impls_1.scala | 2 +- .../Impls_1.scala | 2 +- .../run/macro-expand-multiple-arglists/Impls_1.scala | 4 ++-- .../run/macro-expand-nullary-generic/Impls_1.scala | 2 +- .../macro-expand-nullary-nongeneric/Impls_1.scala | 2 +- test/files/run/macro-expand-overload/Impls_1.scala | 2 +- test/files/run/macro-expand-override/Impls_1.scala | 2 +- test/files/run/macro-expand-recursive/Impls_1.scala | 4 ++-- .../run/macro-expand-tparams-explicit/Impls_1.scala | 2 +- .../run/macro-expand-tparams-implicit/Impls_1.scala | 2 +- .../run/macro-expand-tparams-optional/Impls_1.scala | 2 +- .../run/macro-expand-tparams-prefix-a/Impls_1.scala | 2 +- .../run/macro-expand-tparams-prefix-b/Impls_1.scala | 2 +- .../run/macro-expand-tparams-prefix-c1/Impls_1.scala | 6 +++--- .../Impls_Macros_1.scala | 6 +++--- .../run/macro-expand-tparams-prefix-d1/Impls_1.scala | 6 +++--- .../Impls_1.scala | 2 +- .../Macros_Test_2.scala | 2 +- .../Impls_1.scala | 2 +- .../Impls_1.scala | 2 +- .../Impls_1.scala | 2 +- .../Impls_1.scala | 2 +- .../macro-impl-default-params/Impls_Macros_1.scala | 8 ++++---- .../macro-impl-rename-context/Impls_Macros_1.scala | 2 +- .../Test_2.scala | 2 +- .../Impls_Macros_1.scala | 2 +- .../run/macro-invalidret-nontypeable/Test_2.scala | 2 +- .../files/run/macro-invalidusage-badret/Test_2.scala | 2 +- .../Impls_Macros_1.scala | 2 +- .../Test_2.scala | 2 +- .../Impls_Macros_1.scala | 4 ++-- .../Test_2.scala | 2 +- test/files/run/macro-openmacros/Impls_Macros_1.scala | 2 +- test/files/run/macro-range/Common_1.scala | 2 +- .../run/macro-range/Expansion_Impossible_2.scala | 10 +++++----- .../Impls_Macros_1.scala | 2 +- .../run/macro-reflective-ma-normal-mdmi/Test_2.scala | 2 +- .../macro-reflective-mamd-normal-mi/Impls_1.scala | 2 +- .../Macros_Test_2.scala | 10 +++++----- test/files/run/macro-reify-freevars/Test_2.scala | 8 ++++---- .../run/macro-reify-nested-a/Impls_Macros_1.scala | 2 +- .../run/macro-reify-nested-b/Impls_Macros_1.scala | 2 +- .../macro-reify-splice-outside-reify/Test_2.scala | 2 +- test/files/run/macro-reify-tagless-a/Test_2.scala | 6 +++--- test/files/run/macro-reify-type/Macros_1.scala | 6 +++--- test/files/run/macro-reify-type/Test_2.scala | 8 ++++---- test/files/run/macro-reify-unreify/Macros_1.scala | 2 +- test/files/run/macro-repl-basic.check | 6 +++--- test/files/run/macro-repl-basic.scala | 6 +++--- .../Impls_Macros_1.scala | 4 ++-- .../Impls_Macros_1.scala | 6 +++--- test/files/run/macro-typecheck-macrosdisabled2.check | 2 +- .../Impls_Macros_1.scala | 6 +++--- test/files/run/reflection-allmirrors-tostring.scala | 20 ++++++++++---------- test/files/run/reflection-enclosed-basic.scala | 4 ++-- test/files/run/reflection-enclosed-inner-basic.scala | 8 ++++---- .../run/reflection-enclosed-inner-inner-basic.scala | 8 ++++---- .../run/reflection-enclosed-inner-nested-basic.scala | 8 ++++---- .../files/run/reflection-enclosed-nested-basic.scala | 8 ++++---- .../run/reflection-enclosed-nested-inner-basic.scala | 8 ++++---- .../reflection-enclosed-nested-nested-basic.scala | 8 ++++---- test/files/run/reflection-equality.check | 2 +- test/files/run/reflection-equality.scala | 2 +- .../reflection-fieldmirror-accessorsareokay.scala | 4 ++-- .../files/run/reflection-fieldmirror-ctorparam.scala | 2 +- .../files/run/reflection-fieldmirror-getsetval.scala | 2 +- .../files/run/reflection-fieldmirror-getsetvar.scala | 2 +- ...reflection-fieldmirror-nmelocalsuffixstring.scala | 2 +- .../run/reflection-fieldmirror-privatethis.scala | 2 +- .../run/reflection-fieldsymbol-navigation.scala | 2 +- test/files/run/reflection-implClass.scala | 8 ++++---- test/files/run/reflection-magicsymbols-invoke.scala | 2 +- test/files/run/reflection-magicsymbols-repl.check | 2 +- test/files/run/reflection-magicsymbols-repl.scala | 2 +- test/files/run/reflection-magicsymbols-vanilla.scala | 2 +- test/files/run/reflection-methodsymbol-params.scala | 16 ++++++++-------- .../run/reflection-methodsymbol-returntype.scala | 16 ++++++++-------- .../run/reflection-methodsymbol-typeparams.scala | 16 ++++++++-------- test/files/run/reflection-repl-classes.check | 2 +- test/files/run/reflection-repl-classes.scala | 2 +- test/files/run/reflection-sanitychecks.scala | 16 ++++++++-------- test/files/run/reflection-valueclasses-derived.scala | 6 +++--- test/files/run/reflection-valueclasses-magic.scala | 2 +- .../files/run/reflection-valueclasses-standard.scala | 4 ++-- test/files/run/reify-aliases.check | 2 +- test/files/run/reify_copypaste1.scala | 4 ++-- test/files/run/reify_newimpl_22.check | 2 +- test/files/run/reify_newimpl_23.check | 2 +- test/files/run/reify_newimpl_25.check | 2 +- test/files/run/reify_newimpl_26.check | 2 +- test/files/run/reify_printf.scala | 8 ++++---- test/files/run/showraw_aliases.check | 4 ++-- test/files/run/showraw_mods.check | 2 +- test/files/run/showraw_tree.check | 4 ++-- test/files/run/showraw_tree_ids.check | 4 ++-- test/files/run/showraw_tree_kinds.check | 4 ++-- test/files/run/showraw_tree_types_ids.check | 16 ++++++++-------- test/files/run/showraw_tree_types_typed.check | 16 ++++++++-------- test/files/run/showraw_tree_types_untyped.check | 4 ++-- test/files/run/showraw_tree_ultimate.check | 16 ++++++++-------- test/files/run/t5418b.check | 2 +- test/files/run/t6178.scala | 2 +- test/files/run/t6181.scala | 2 +- test/files/run/t6199-mirror.scala | 2 +- test/files/run/t6392b.check | 2 +- .../run/toolbox_typecheck_implicitsdisabled.scala | 8 ++++---- .../files/run/toolbox_typecheck_macrosdisabled.scala | 4 ++-- .../run/toolbox_typecheck_macrosdisabled2.check | 2 +- .../run/toolbox_typecheck_macrosdisabled2.scala | 4 ++-- test/osgi/src/BasicReflection.scala | 18 +++++++++--------- test/pending/run/hk-lub-fail.scala | 10 +++++----- test/pending/run/macro-expand-default/Impls_1.scala | 4 ++-- .../Impls_1.scala | 4 ++-- test/pending/run/macro-expand-named/Impls_1.scala | 4 ++-- .../run/macro-expand-tparams-prefix-e1/Impls_1.scala | 6 +++--- .../run/macro-expand-tparams-prefix-f1/Impls_1.scala | 6 +++--- test/pending/run/macro-reify-tagless-b/Test_2.scala | 6 +++--- test/pending/run/t5427a.scala | 2 +- test/pending/run/t5427b.scala | 2 +- test/pending/run/t5427c.scala | 2 +- test/pending/run/t5427d.scala | 2 +- 154 files changed, 341 insertions(+), 341 deletions(-) (limited to 'test/files') 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 908438cf65..f9e0ca5077 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 @@ -3,19 +3,19 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1)))) + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) c.Expr[Int](body) } def bar(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2)))) + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) c.Expr[Int](body) } def quux(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3)))) + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) c.Expr[Int](body) } } diff --git a/test/files/neg/macro-invalidimpl-f/Impls_1.scala b/test/files/neg/macro-invalidimpl-f/Impls_1.scala index 334ee714be..0e4da86d22 100644 --- a/test/files/neg/macro-invalidimpl-f/Impls_1.scala +++ b/test/files/neg/macro-invalidimpl-f/Impls_1.scala @@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def fooNullary(c: Ctx) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works")))) c.Expr[Unit](body) } diff --git a/test/files/neg/macro-invalidimpl-g/Impls_1.scala b/test/files/neg/macro-invalidimpl-g/Impls_1.scala index 334ee714be..0e4da86d22 100644 --- a/test/files/neg/macro-invalidimpl-g/Impls_1.scala +++ b/test/files/neg/macro-invalidimpl-g/Impls_1.scala @@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def fooNullary(c: Ctx) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works")))) c.Expr[Unit](body) } diff --git a/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala index 7a7293422e..8205694768 100644 --- a/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala +++ b/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala @@ -6,9 +6,9 @@ object Impls { import c.{prefix => prefix} import c.universe._ val body = Block(List( - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("invoking foo_targs...")))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("type of prefix is: " + prefix.staticType)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("U is: " + implicitly[c.WeakTypeTag[U]].tpe))))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("invoking foo_targs...")))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("type of prefix is: " + prefix.staticType)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("U is: " + implicitly[c.WeakTypeTag[U]].tpe))))), Literal(Constant(()))) c.Expr[Unit](body) } diff --git a/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala b/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala index 8d7fdf3e8a..498bd4f18d 100644 --- a/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala +++ b/test/files/neg/macro-invalidusage-methodvaluesyntax/Impls_1.scala @@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))) + val body = 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/neg/macro-override-method-overrides-macro/Impls_1.scala b/test/files/neg/macro-override-method-overrides-macro/Impls_1.scala index ec93dd4111..69ef57d18d 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 @@ -4,7 +4,7 @@ object Impls { def impl(c: Ctx)(tag: String, x: c.Expr[_]) = { import c.{prefix => prefix} import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree)) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree)) c.Expr[Unit](body) } diff --git a/test/files/neg/macro-without-xmacros-a/Impls_1.scala b/test/files/neg/macro-without-xmacros-a/Impls_1.scala index 8976f8e28d..c6677c4fde 100644 --- a/test/files/neg/macro-without-xmacros-a/Impls_1.scala +++ b/test/files/neg/macro-without-xmacros-a/Impls_1.scala @@ -3,16 +3,16 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - c.Expr(Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))) + c.Expr(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1))))) } def bar_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - c.Expr(Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2))))) + c.Expr(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2))))) } def quux_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - c.Expr(Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3))))) + c.Expr(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3))))) } } \ No newline at end of file diff --git a/test/files/neg/macro-without-xmacros-b/Impls_1.scala b/test/files/neg/macro-without-xmacros-b/Impls_1.scala index 8976f8e28d..c6677c4fde 100644 --- a/test/files/neg/macro-without-xmacros-b/Impls_1.scala +++ b/test/files/neg/macro-without-xmacros-b/Impls_1.scala @@ -3,16 +3,16 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - c.Expr(Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))) + c.Expr(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1))))) } def bar_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - c.Expr(Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2))))) + c.Expr(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2))))) } def quux_impl(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - c.Expr(Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3))))) + c.Expr(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3))))) } } \ No newline at end of file diff --git a/test/files/run/idempotency-this.check b/test/files/run/idempotency-this.check index 08738c4565..efabaf1ec4 100644 --- a/test/files/run/idempotency-this.check +++ b/test/files/run/idempotency-this.check @@ -1,4 +1,4 @@ List() immutable.this.List.apply[String]("") -Apply(TypeApply(Select(Select(This(newTypeName("immutable")), scala.collection.immutable.List), newTermName("apply")), List(TypeTree().setOriginal(Ident(newTypeName("String"))))), List(Literal(Constant("")))) +Apply(TypeApply(Select(Select(This(TypeName("immutable")), scala.collection.immutable.List), TermName("apply")), List(TypeTree().setOriginal(Ident(TypeName("String"))))), List(Literal(Constant("")))) error! diff --git a/test/files/run/macro-abort-fresh/Macros_1.scala b/test/files/run/macro-abort-fresh/Macros_1.scala index af1e292588..415b76852f 100644 --- a/test/files/run/macro-abort-fresh/Macros_1.scala +++ b/test/files/run/macro-abort-fresh/Macros_1.scala @@ -5,7 +5,7 @@ object Impls { import c.universe._ println(c.fresh()) println(c.fresh("qwe")) - println(c.fresh(newTypeName("qwe"))) + println(c.fresh(TypeName("qwe"))) c.abort(NoPosition, "blargh") } } diff --git a/test/files/run/macro-abort-fresh/Test_2.scala b/test/files/run/macro-abort-fresh/Test_2.scala index 0b9986e9f6..61f0bdfadc 100644 --- a/test/files/run/macro-abort-fresh/Test_2.scala +++ b/test/files/run/macro-abort-fresh/Test_2.scala @@ -2,7 +2,7 @@ object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox - val tree = Select(Ident(newTermName("Macros")), newTermName("foo")) + 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/Impls_1.scala b/test/files/run/macro-basic-ma-md-mi/Impls_1.scala index 646634c972..ce30366c61 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 @@ -3,19 +3,19 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1)))) + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) c.Expr[Int](body) } def bar(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2)))) + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) c.Expr[Int](body) } def quux(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3)))) + 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-mdmi/Impls_Macros_1.scala b/test/files/run/macro-basic-ma-mdmi/Impls_Macros_1.scala index aa1e52e4aa..a601af6dde 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 @@ -3,19 +3,19 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1)))) + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) c.Expr[Int](body) } def bar(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2)))) + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) c.Expr[Int](body) } def quux(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3)))) + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) c.Expr[Int](body) } } 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 061aa2d4a3..6e5983bdec 100644 --- a/test/files/run/macro-basic-mamd-mi/Impls_1.scala +++ b/test/files/run/macro-basic-mamd-mi/Impls_1.scala @@ -3,17 +3,17 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - c.Expr(Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1))))) + c.Expr(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1))))) } def bar(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - c.Expr(Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2))))) + c.Expr(Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2))))) } def quux(c: Ctx)(x: c.Expr[Int]): c.Expr[Int] = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3)))) + 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-bodyexpandstoimpl/Impls_1.scala b/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala index 0ca0be5a48..9c1e4ee46d 100644 --- a/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala +++ b/test/files/run/macro-bodyexpandstoimpl/Impls_1.scala @@ -6,7 +6,7 @@ object Impls { def refToFoo(dummy: Int) = macro refToFoo_impl def refToFoo_impl(c: Ctx)(dummy: c.Expr[Int]) = { import c.universe._ - val body = Select(Ident(newTermName("Impls")), newTermName("foo")) + val body = Select(Ident(TermName("Impls")), TermName("foo")) c.Expr[Int](body) } } \ No newline at end of file diff --git a/test/files/run/macro-declared-in-annotation/Impls_1.scala b/test/files/run/macro-declared-in-annotation/Impls_1.scala index a11ee2907a..1ea06de679 100644 --- a/test/files/run/macro-declared-in-annotation/Impls_1.scala +++ b/test/files/run/macro-declared-in-annotation/Impls_1.scala @@ -4,7 +4,7 @@ object Impls { def foo(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) val body = Block(List(printPrefix), Literal(Constant("this is deprecated"))) c.Expr[String](body) } diff --git a/test/files/run/macro-declared-in-anonymous/Impls_1.scala b/test/files/run/macro-declared-in-anonymous/Impls_1.scala index 6f06f6d3f0..348f3420f2 100644 --- a/test/files/run/macro-declared-in-anonymous/Impls_1.scala +++ b/test/files/run/macro-declared-in-anonymous/Impls_1.scala @@ -4,8 +4,8 @@ object Impls { def foo(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + 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-declared-in-block/Impls_1.scala b/test/files/run/macro-declared-in-block/Impls_1.scala index 6f06f6d3f0..348f3420f2 100644 --- a/test/files/run/macro-declared-in-block/Impls_1.scala +++ b/test/files/run/macro-declared-in-block/Impls_1.scala @@ -4,8 +4,8 @@ object Impls { def foo(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + 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-declared-in-class-class/Impls_1.scala b/test/files/run/macro-declared-in-class-class/Impls_1.scala index 6f06f6d3f0..348f3420f2 100644 --- a/test/files/run/macro-declared-in-class-class/Impls_1.scala +++ b/test/files/run/macro-declared-in-class-class/Impls_1.scala @@ -4,8 +4,8 @@ object Impls { def foo(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + 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-declared-in-class-object/Impls_1.scala b/test/files/run/macro-declared-in-class-object/Impls_1.scala index 6f06f6d3f0..348f3420f2 100644 --- a/test/files/run/macro-declared-in-class-object/Impls_1.scala +++ b/test/files/run/macro-declared-in-class-object/Impls_1.scala @@ -4,8 +4,8 @@ object Impls { def foo(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + 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-declared-in-class/Impls_1.scala b/test/files/run/macro-declared-in-class/Impls_1.scala index 6f06f6d3f0..348f3420f2 100644 --- a/test/files/run/macro-declared-in-class/Impls_1.scala +++ b/test/files/run/macro-declared-in-class/Impls_1.scala @@ -4,8 +4,8 @@ object Impls { def foo(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + 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-declared-in-default-param/Impls_1.scala b/test/files/run/macro-declared-in-default-param/Impls_1.scala index db1e5c7435..4380f40b04 100644 --- a/test/files/run/macro-declared-in-default-param/Impls_1.scala +++ b/test/files/run/macro-declared-in-default-param/Impls_1.scala @@ -4,7 +4,7 @@ object Impls { def foo(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) val body = Block(List(printPrefix), Literal(Constant("it works"))) c.Expr[String](body) } diff --git a/test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala b/test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala index 837b306976..4c009cc367 100644 --- a/test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala +++ b/test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala @@ -4,8 +4,8 @@ object Impls { def toOptionOfInt(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Ident(definitions.SomeModule), List(Select(Select(prefix.tree, newTermName("x")), newTermName("toInt"))))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + val body = Block(List(printPrefix), Apply(Ident(definitions.SomeModule), List(Select(Select(prefix.tree, TermName("x")), TermName("toInt"))))) c.Expr[Option[Int]](body) } } diff --git a/test/files/run/macro-declared-in-method/Impls_1.scala b/test/files/run/macro-declared-in-method/Impls_1.scala index 6f06f6d3f0..348f3420f2 100644 --- a/test/files/run/macro-declared-in-method/Impls_1.scala +++ b/test/files/run/macro-declared-in-method/Impls_1.scala @@ -4,8 +4,8 @@ object Impls { def foo(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + 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-declared-in-object-class/Impls_1.scala b/test/files/run/macro-declared-in-object-class/Impls_1.scala index 6f06f6d3f0..348f3420f2 100644 --- a/test/files/run/macro-declared-in-object-class/Impls_1.scala +++ b/test/files/run/macro-declared-in-object-class/Impls_1.scala @@ -4,8 +4,8 @@ object Impls { def foo(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + 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-declared-in-object-object/Impls_1.scala b/test/files/run/macro-declared-in-object-object/Impls_1.scala index 6f06f6d3f0..348f3420f2 100644 --- a/test/files/run/macro-declared-in-object-object/Impls_1.scala +++ b/test/files/run/macro-declared-in-object-object/Impls_1.scala @@ -4,8 +4,8 @@ object Impls { def foo(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + 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-declared-in-object/Impls_1.scala b/test/files/run/macro-declared-in-object/Impls_1.scala index 6f06f6d3f0..348f3420f2 100644 --- a/test/files/run/macro-declared-in-object/Impls_1.scala +++ b/test/files/run/macro-declared-in-object/Impls_1.scala @@ -4,8 +4,8 @@ object Impls { def foo(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + 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-declared-in-package-object/Impls_1.scala b/test/files/run/macro-declared-in-package-object/Impls_1.scala index 6f06f6d3f0..348f3420f2 100644 --- a/test/files/run/macro-declared-in-package-object/Impls_1.scala +++ b/test/files/run/macro-declared-in-package-object/Impls_1.scala @@ -4,8 +4,8 @@ object Impls { def foo(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + 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-declared-in-refinement/Impls_1.scala b/test/files/run/macro-declared-in-refinement/Impls_1.scala index 6f06f6d3f0..348f3420f2 100644 --- a/test/files/run/macro-declared-in-refinement/Impls_1.scala +++ b/test/files/run/macro-declared-in-refinement/Impls_1.scala @@ -4,8 +4,8 @@ object Impls { def foo(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + 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-declared-in-trait/Impls_1.scala b/test/files/run/macro-declared-in-trait/Impls_1.scala index 6f06f6d3f0..348f3420f2 100644 --- a/test/files/run/macro-declared-in-trait/Impls_1.scala +++ b/test/files/run/macro-declared-in-trait/Impls_1.scala @@ -4,8 +4,8 @@ object Impls { def foo(c: Ctx) = { import c.{prefix => prefix} import c.universe._ - val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix)))) - val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works"))))) + val printPrefix = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("prefix = " + prefix)))) + 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-def-infer-return-type-b/Test_2.scala b/test/files/run/macro-def-infer-return-type-b/Test_2.scala index ea0fd4bbff..9e57b90b57 100644 --- a/test/files/run/macro-def-infer-return-type-b/Test_2.scala +++ b/test/files/run/macro-def-infer-return-type-b/Test_2.scala @@ -2,7 +2,7 @@ object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox - val tree = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant(42)))) + val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))) try cm.mkToolBox().eval(tree) catch { case ex: Throwable => println(ex.getMessage) } } 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 d9fd5b8cb0..b2c7b4d6ca 100644 --- a/test/files/run/macro-expand-implicit-argument/Macros_1.scala +++ b/test/files/run/macro-expand-implicit-argument/Macros_1.scala @@ -41,14 +41,14 @@ object Macros { def const(x:Int) = Literal(Constant(x)) val n = as.length - val arr = newTermName("arr") + val arr = TermName("arr") - val create = Apply(Select(ct.tree, newTermName("newArray")), List(const(n))) + val create = Apply(Select(ct.tree, TermName("newArray")), List(const(n))) val arrtpe = TypeTree(implicitly[c.WeakTypeTag[Array[A]]].tpe) val valdef = ValDef(Modifiers(), arr, arrtpe, create) val updates = (0 until n).map { - i => Apply(Select(Ident(arr), newTermName("update")), List(const(i), as(i).tree)) + i => Apply(Select(Ident(arr), TermName("update")), List(const(i), as(i).tree)) } val exprs = (Seq(valdef) ++ updates ++ Seq(Ident(arr))).toList 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 082e6b2efe..ac1e55c9b2 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 @@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int]) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(x.tree)) + 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-is-implicit/Impls_1.scala b/test/files/run/macro-expand-implicit-macro-is-implicit/Impls_1.scala index cceb038f05..aa1fc7a358 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 @@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[String]): c.Expr[Option[Int]] = { import c.universe._ - val body = Apply(Ident(definitions.SomeModule), List(Select(x.tree, newTermName("toInt")))) + 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-view/Impls_1.scala b/test/files/run/macro-expand-implicit-macro-is-view/Impls_1.scala index cceb038f05..aa1fc7a358 100644 --- a/test/files/run/macro-expand-implicit-macro-is-view/Impls_1.scala +++ b/test/files/run/macro-expand-implicit-macro-is-view/Impls_1.scala @@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[String]): c.Expr[Option[Int]] = { import c.universe._ - val body = Apply(Ident(definitions.SomeModule), List(Select(x.tree, newTermName("toInt")))) + 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-multiple-arglists/Impls_1.scala b/test/files/run/macro-expand-multiple-arglists/Impls_1.scala index 11e07932c3..4fddc13d68 100644 --- a/test/files/run/macro-expand-multiple-arglists/Impls_1.scala +++ b/test/files/run/macro-expand-multiple-arglists/Impls_1.scala @@ -3,8 +3,8 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int])(y: c.Expr[Int]) = { import c.universe._ - val sum = Apply(Select(x.tree, newTermName("$minus")), List(y.tree)) - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(sum)) + val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree)) + 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-nullary-generic/Impls_1.scala b/test/files/run/macro-expand-nullary-generic/Impls_1.scala index 1180c83a40..39a9db0e14 100644 --- a/test/files/run/macro-expand-nullary-generic/Impls_1.scala +++ b/test/files/run/macro-expand-nullary-generic/Impls_1.scala @@ -4,7 +4,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def impl[T: c.WeakTypeTag](c: Ctx) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works " + implicitly[c.WeakTypeTag[T]])))) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works " + implicitly[c.WeakTypeTag[T]])))) c.Expr[Unit](body) } 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 c6bd1cdbf1..41e50acc86 100644 --- a/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala +++ b/test/files/run/macro-expand-nullary-nongeneric/Impls_1.scala @@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def impl(c: Ctx) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works")))) c.Expr[Unit](body) } diff --git a/test/files/run/macro-expand-overload/Impls_1.scala b/test/files/run/macro-expand-overload/Impls_1.scala index f7c240d9ca..1c672f6040 100644 --- a/test/files/run/macro-expand-overload/Impls_1.scala +++ b/test/files/run/macro-expand-overload/Impls_1.scala @@ -4,7 +4,7 @@ object Impls { def impl(c: Ctx)(tag: String, x: c.Expr[_]) = { import c.{prefix => prefix} import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree)) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree)) c.Expr[Unit](body) } diff --git a/test/files/run/macro-expand-override/Impls_1.scala b/test/files/run/macro-expand-override/Impls_1.scala index ec93dd4111..69ef57d18d 100644 --- a/test/files/run/macro-expand-override/Impls_1.scala +++ b/test/files/run/macro-expand-override/Impls_1.scala @@ -4,7 +4,7 @@ object Impls { def impl(c: Ctx)(tag: String, x: c.Expr[_]) = { import c.{prefix => prefix} import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree)) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(tag)), Literal(Constant(prefix.toString)), x.tree)) c.Expr[Unit](body) } diff --git a/test/files/run/macro-expand-recursive/Impls_1.scala b/test/files/run/macro-expand-recursive/Impls_1.scala index 61db5c4a9b..47dd398454 100644 --- a/test/files/run/macro-expand-recursive/Impls_1.scala +++ b/test/files/run/macro-expand-recursive/Impls_1.scala @@ -3,13 +3,13 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("it works")))) c.Expr[Unit](body) } def fooFoo(c: Ctx) = { import c.universe._ - val body = Select(Ident(newTermName("Macros")), newTermName("foo")) + 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-tparams-explicit/Impls_1.scala b/test/files/run/macro-expand-tparams-explicit/Impls_1.scala index 72b420d92f..f748ab855f 100644 --- a/test/files/run/macro-expand-tparams-explicit/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-explicit/Impls_1.scala @@ -5,7 +5,7 @@ object Impls { def foo[U: c.WeakTypeTag](c: Ctx) = { import c.universe._ val U = implicitly[c.WeakTypeTag[U]] - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(U.toString)))) + 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/Impls_1.scala b/test/files/run/macro-expand-tparams-implicit/Impls_1.scala index 33770516df..c729aada51 100644 --- a/test/files/run/macro-expand-tparams-implicit/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-implicit/Impls_1.scala @@ -5,7 +5,7 @@ object Impls { def foo[U: c.WeakTypeTag](c: Ctx)(x: c.Expr[U]) = { import c.universe._ val U = implicitly[c.WeakTypeTag[U]] - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(U.toString)))) + 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-optional/Impls_1.scala b/test/files/run/macro-expand-tparams-optional/Impls_1.scala index 3b829e2e09..ace7a6cd26 100644 --- a/test/files/run/macro-expand-tparams-optional/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-optional/Impls_1.scala @@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo[U](c: Ctx) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("don't know U")))) + 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-expand-tparams-prefix-a/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-a/Impls_1.scala index 33770516df..c729aada51 100644 --- a/test/files/run/macro-expand-tparams-prefix-a/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-prefix-a/Impls_1.scala @@ -5,7 +5,7 @@ object Impls { def foo[U: c.WeakTypeTag](c: Ctx)(x: c.Expr[U]) = { import c.universe._ val U = implicitly[c.WeakTypeTag[U]] - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(U.toString)))) + 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-prefix-b/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-b/Impls_1.scala index 9378e67712..8880d13b04 100644 --- a/test/files/run/macro-expand-tparams-prefix-b/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-prefix-b/Impls_1.scala @@ -6,7 +6,7 @@ object Impls { import c.universe._ val T = implicitly[c.WeakTypeTag[T]] val U = implicitly[c.WeakTypeTag[U]] - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString + " " + U.toString)))) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString + " " + U.toString)))) c.Expr[Unit](body) } } \ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala index afdd7d4f7a..2df42e969f 100644 --- a/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-prefix-c1/Impls_1.scala @@ -5,9 +5,9 @@ object Impls { def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { import c.universe._ c.Expr(Block(List( - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(V.toString))))), Literal(Constant(())))) } } \ No newline at end of file diff --git a/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala b/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala index 3c2838208a..08817708d4 100644 --- a/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala +++ b/test/files/run/macro-expand-tparams-prefix-c2/Impls_Macros_1.scala @@ -5,9 +5,9 @@ object Impls { def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { import c.universe._ c.Expr(Block(List( - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(V.toString))))), Literal(Constant(())))) } } diff --git a/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala b/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala index afdd7d4f7a..2df42e969f 100644 --- a/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala +++ b/test/files/run/macro-expand-tparams-prefix-d1/Impls_1.scala @@ -5,9 +5,9 @@ object Impls { def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { import c.universe._ c.Expr(Block(List( - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(V.toString))))), Literal(Constant(())))) } } \ 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 2ef8f04be9..f6c1d27d54 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 @@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(xs: c.Expr[Int]*) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), xs.map(_.tree).toList) + 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 c832826d64..b844012d53 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 @@ -6,7 +6,7 @@ object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox - val tree = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Typed(Apply(Ident(definitions.ListModule), List(Literal(Constant(1)), Literal(Constant(2)))), Ident(tpnme.WILDCARD_STAR)))) + val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Typed(Apply(Ident(definitions.ListModule), List(Literal(Constant(1)), Literal(Constant(2)))), Ident(tpnme.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/Impls_1.scala b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-good/Impls_1.scala index 3c7f94f605..363ff0e0aa 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 @@ -7,7 +7,7 @@ object Impls { case List(Typed(stripped, Ident(wildstar))) if wildstar == tpnme.WILDCARD_STAR => List(stripped) case _ => ??? } - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), stripped_xs) + 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-varargs/Impls_1.scala b/test/files/run/macro-expand-varargs-explicit-over-varargs/Impls_1.scala index 2066893bdc..0b61ab2f9b 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 @@ -7,7 +7,7 @@ object Impls { def foo(c: Ctx)(xs: c.Expr[Int]*) = { import c.universe._ - val body = Apply(Select(Ident(newTermName("Impls")), newTermName("myprintln")), xs.map(_.tree).toList) + 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-nonvarargs/Impls_1.scala b/test/files/run/macro-expand-varargs-implicit-over-nonvarargs/Impls_1.scala index 2ef8f04be9..f6c1d27d54 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 @@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(xs: c.Expr[Int]*) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), xs.map(_.tree).toList) + 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-varargs/Impls_1.scala b/test/files/run/macro-expand-varargs-implicit-over-varargs/Impls_1.scala index 2066893bdc..0b61ab2f9b 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 @@ -7,7 +7,7 @@ object Impls { def foo(c: Ctx)(xs: c.Expr[Int]*) = { import c.universe._ - val body = Apply(Select(Ident(newTermName("Impls")), newTermName("myprintln")), xs.map(_.tree).toList) + 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-impl-default-params/Impls_Macros_1.scala b/test/files/run/macro-impl-default-params/Impls_Macros_1.scala index 7c40045c0f..95d746980e 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 @@ -7,10 +7,10 @@ object Impls { import c.universe._ val U = implicitly[c.WeakTypeTag[U]] val body = Block(List( - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("invoking foo_targs...")))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("type of prefix is: " + prefix.staticType)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("type of prefix tree is: " + prefix.tree.tpe)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("U is: " + U.tpe))))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("invoking foo_targs...")))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("type of prefix is: " + prefix.staticType)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("type of prefix tree is: " + prefix.tree.tpe)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("U is: " + U.tpe))))), Literal(Constant(()))) c.Expr[Unit](body) } 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 56c23f5faf..738c88bbc8 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 @@ -4,7 +4,7 @@ object Impls { def foo(unconventionalName: Ctx)(x: unconventionalName.Expr[Int]) = { import unconventionalName.universe._ val body = Block(List( - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("invoking foo..."))))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant("invoking foo..."))))), Literal(Constant(()))) unconventionalName.Expr[Unit](body) } 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 0b9986e9f6..61f0bdfadc 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 @@ -2,7 +2,7 @@ object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox - val tree = Select(Ident(newTermName("Macros")), newTermName("foo")) + 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/Impls_Macros_1.scala b/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala index fb0d55208c..869a5a41fa 100644 --- a/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala +++ b/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala @@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx) = { import c.universe._ - val body = Ident(newTermName("IDoNotExist")) + val body = Ident(TermName("IDoNotExist")) c.Expr[Int](body) } } diff --git a/test/files/run/macro-invalidret-nontypeable/Test_2.scala b/test/files/run/macro-invalidret-nontypeable/Test_2.scala index 0daee49a08..7cd474ff52 100644 --- a/test/files/run/macro-invalidret-nontypeable/Test_2.scala +++ b/test/files/run/macro-invalidret-nontypeable/Test_2.scala @@ -2,7 +2,7 @@ import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox - val tree = Select(Ident(newTermName("Macros")), newTermName("foo")) + 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/Test_2.scala b/test/files/run/macro-invalidusage-badret/Test_2.scala index 5cb0be5ddd..fc71353f54 100644 --- a/test/files/run/macro-invalidusage-badret/Test_2.scala +++ b/test/files/run/macro-invalidusage-badret/Test_2.scala @@ -2,7 +2,7 @@ object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox - val tree = Typed(Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant(42)))), Ident(newTypeName("String"))) + val tree = Typed(Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))), Ident(TypeName("String"))) try cm.mkToolBox().eval(tree) catch { case ex: Throwable => println(ex.getMessage) } } 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 4583a726cf..8a93161af5 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 @@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo[T: c.WeakTypeTag](c: Ctx)(x: c.Expr[T]) = { import c.universe._ - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(x.tree.toString)))) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(x.tree.toString)))) c.Expr[Unit](body) } } 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 e453d0b70c..9a34c62e0f 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 @@ -2,7 +2,7 @@ object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox - val tree = Select(Ident(newTermName("Macros")), newTermName("foo")) + val tree = Select(Ident(TermName("Macros")), TermName("foo")) try cm.mkToolBox().eval(tree) catch { case ex: Throwable => println(ex.getMessage) } } 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 5866469499..3ac9cd2a8d 100644 --- a/test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala +++ b/test/files/run/macro-invalidusage-partialapplication/Impls_Macros_1.scala @@ -3,8 +3,8 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int])(y: c.Expr[Int]) = { import c.universe._ - val sum = Apply(Select(x.tree, newTermName("$plus")), List(y.tree)) - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(sum)) + val sum = Apply(Select(x.tree, TermName("$plus")), List(y.tree)) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum)) c.Expr[Unit](body) } } diff --git a/test/files/run/macro-invalidusage-partialapplication/Test_2.scala b/test/files/run/macro-invalidusage-partialapplication/Test_2.scala index dc48c127f4..75b8c139d4 100644 --- a/test/files/run/macro-invalidusage-partialapplication/Test_2.scala +++ b/test/files/run/macro-invalidusage-partialapplication/Test_2.scala @@ -2,7 +2,7 @@ object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox - val tree = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant(40)))) + val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(40)))) try cm.mkToolBox().eval(tree) catch { case ex: Throwable => println(ex.getMessage) } } diff --git a/test/files/run/macro-openmacros/Impls_Macros_1.scala b/test/files/run/macro-openmacros/Impls_Macros_1.scala index b863ac048b..50a1782431 100644 --- a/test/files/run/macro-openmacros/Impls_Macros_1.scala +++ b/test/files/run/macro-openmacros/Impls_Macros_1.scala @@ -14,7 +14,7 @@ object Macros { } import c.universe._ - val next = if (c.enclosingMacros.length < 3) c.Expr[Unit](Select(Ident(c.mirror.staticModule("Macros")), newTermName("foo"))) else c.literalUnit + val next = if (c.enclosingMacros.length < 3) c.Expr[Unit](Select(Ident(c.mirror.staticModule("Macros")), TermName("foo"))) else c.literalUnit c.universe.reify { println(c.literal(normalizePaths(c.enclosingMacros.toString)).splice) next.splice diff --git a/test/files/run/macro-range/Common_1.scala b/test/files/run/macro-range/Common_1.scala index 5c4bc211fc..4083e6126e 100644 --- a/test/files/run/macro-range/Common_1.scala +++ b/test/files/run/macro-range/Common_1.scala @@ -43,5 +43,5 @@ abstract class Utils { LabelDef(lname, Nil, rhs) } def makeBinop(left: Tree, op: String, right: Tree): Tree = - Apply(Select(left, newTermName(op)), List(right)) + Apply(Select(left, TermName(op)), List(right)) } diff --git a/test/files/run/macro-range/Expansion_Impossible_2.scala b/test/files/run/macro-range/Expansion_Impossible_2.scala index 57e0cee97f..ca0db48822 100644 --- a/test/files/run/macro-range/Expansion_Impossible_2.scala +++ b/test/files/run/macro-range/Expansion_Impossible_2.scala @@ -16,11 +16,11 @@ object Impls { // scala"($_this: RangeDefault).foreach($f)" c.Expr(c.prefix.tree match { case Apply(Select(New(tpt), initName), List(lo, hi)) if tpt.symbol.fullName == "Range" => - val iname = newTermName("$i") - val hname = newTermName("$h") + val iname = TermName("$i") + val hname = TermName("$h") def iref = Ident(iname) def href = Ident(hname) - val labelname = newTermName("$while") + val labelname = TermName("$while") val cond = makeBinop(iref, "$less", href) val body = Block( List(makeApply(f.tree, List(iref))), @@ -37,8 +37,8 @@ object Impls { case _ => Apply( Select( - Typed(c.prefix.tree, Ident(newTypeName("RangeDefault"))), - newTermName("foreach")), + Typed(c.prefix.tree, Ident(TypeName("RangeDefault"))), + TermName("foreach")), List(f.tree)) }) } 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 fa559334d4..51e0264ed5 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 @@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int]) = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1)))) + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) c.Expr[Int](body) } } 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 2e64c01e35..267d1bc7b0 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 @@ -2,6 +2,6 @@ object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox - val tree = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant(42)))) + val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))) println(cm.mkToolBox().eval(tree)) } diff --git a/test/files/run/macro-reflective-mamd-normal-mi/Impls_1.scala b/test/files/run/macro-reflective-mamd-normal-mi/Impls_1.scala index 5d7e077731..4261a6d45d 100644 --- a/test/files/run/macro-reflective-mamd-normal-mi/Impls_1.scala +++ b/test/files/run/macro-reflective-mamd-normal-mi/Impls_1.scala @@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int]) = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1)))) + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) c.Expr[Int](body) } } \ No newline at end of file diff --git a/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala b/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala index 70560009b1..13cd953bde 100644 --- a/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala +++ b/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala @@ -8,12 +8,12 @@ object Test extends App { import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox - val macrobody = Select(Ident(newTermName("Impls")), newTermName("foo")) - val macroparam = ValDef(NoMods, newTermName("x"), TypeTree(definitions.IntClass.toType), EmptyTree) - val macrodef = DefDef(Modifiers(MACRO), newTermName("foo"), Nil, List(List(macroparam)), TypeTree(), macrobody) + val macrobody = Select(Ident(TermName("Impls")), TermName("foo")) + val macroparam = ValDef(NoMods, TermName("x"), TypeTree(definitions.IntClass.toType), EmptyTree) + val macrodef = DefDef(Modifiers(MACRO), TermName("foo"), Nil, List(List(macroparam)), TypeTree(), macrobody) val modulector = DefDef(NoMods, nme.CONSTRUCTOR, Nil, List(List()), TypeTree(), Block(List(Apply(Select(Super(This(tpnme.EMPTY), tpnme.EMPTY), nme.CONSTRUCTOR), List())), Literal(Constant(())))) - val module = ModuleDef(NoMods, newTermName("Macros"), Template(Nil, emptyValDef, List(modulector, macrodef))) - val macroapp = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant(42)))) + val module = ModuleDef(NoMods, TermName("Macros"), Template(Nil, emptyValDef, List(modulector, macrodef))) + val macroapp = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))) val tree = Block(List(macrodef, module), macroapp) val toolbox = cm.mkToolBox(options = "-language:experimental.macros") println(toolbox.eval(tree)) diff --git a/test/files/run/macro-reify-freevars/Test_2.scala b/test/files/run/macro-reify-freevars/Test_2.scala index 7af9d89bdb..c2d0118e17 100644 --- a/test/files/run/macro-reify-freevars/Test_2.scala +++ b/test/files/run/macro-reify-freevars/Test_2.scala @@ -2,10 +2,10 @@ object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox - val q = New(AppliedTypeTree(Select(Select(Select(Ident(newTermName("scala")), newTermName("collection")), newTermName("slick")), newTypeName("Queryable")), List(Ident(newTermName("Int"))))) - val x = ValDef(NoMods, newTermName("x"), Ident(newTermName("Int")), EmptyTree) - val fn = Function(List(x), Apply(Select(Ident(newTermName("x")), newTermName("$plus")), List(Literal(Constant("5"))))) - val tree = Apply(Select(q, newTermName("map")), List(fn)) + val q = New(AppliedTypeTree(Select(Select(Select(Ident(TermName("scala")), TermName("collection")), TermName("slick")), TypeName("Queryable")), List(Ident(TermName("Int"))))) + val x = ValDef(NoMods, TermName("x"), Ident(TermName("Int")), EmptyTree) + val fn = Function(List(x), Apply(Select(Ident(TermName("x")), TermName("$plus")), List(Literal(Constant("5"))))) + 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-nested-a/Impls_Macros_1.scala b/test/files/run/macro-reify-nested-a/Impls_Macros_1.scala index b4351c2c53..bb6a45e11e 100644 --- a/test/files/run/macro-reify-nested-a/Impls_Macros_1.scala +++ b/test/files/run/macro-reify-nested-a/Impls_Macros_1.scala @@ -28,7 +28,7 @@ object QueryableMacros{ val foo = c.Expr[ru.Expr[Queryable[S]]]( c.reifyTree( mkRuntimeUniverseRef, EmptyTree, c.typeCheck( Utils[c.type](c).removeDoubleReify( - Apply(Select(c.prefix.tree, newTermName( name )), List( projection.tree )) + Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) ).asInstanceOf[Tree] ))) c.universe.reify{ Queryable.factory[S]( foo.splice )} diff --git a/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala b/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala index b4351c2c53..bb6a45e11e 100644 --- a/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala +++ b/test/files/run/macro-reify-nested-b/Impls_Macros_1.scala @@ -28,7 +28,7 @@ object QueryableMacros{ val foo = c.Expr[ru.Expr[Queryable[S]]]( c.reifyTree( mkRuntimeUniverseRef, EmptyTree, c.typeCheck( Utils[c.type](c).removeDoubleReify( - Apply(Select(c.prefix.tree, newTermName( name )), List( projection.tree )) + Apply(Select(c.prefix.tree, TermName( name )), List( projection.tree )) ).asInstanceOf[Tree] ))) c.universe.reify{ Queryable.factory[S]( foo.splice )} 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 54bd03fcd2..dbc17e7c15 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 @@ -2,7 +2,7 @@ object Test extends App { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox - val tree = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant(42)))) + val tree = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant(42)))) try println(cm.mkToolBox().eval(tree)) catch { case ex: Throwable => println(ex.getMessage) } } 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 584c4bdf5b..afb418a755 100644 --- a/test/files/run/macro-reify-tagless-a/Test_2.scala +++ b/test/files/run/macro-reify-tagless-a/Test_2.scala @@ -6,9 +6,9 @@ object Test extends App { import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox val tpt = AppliedTypeTree(Ident(definitions.ListClass), List(Ident(definitions.StringClass))) - val rhs = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant("hello world")))) - val list = ValDef(NoMods, newTermName("list"), tpt, rhs) - val tree = Block(List(list), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Ident(list.name)))) + val rhs = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant("hello world")))) + val list = ValDef(NoMods, TermName("list"), tpt, rhs) + val tree = Block(List(list), Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Ident(list.name)))) try cm.mkToolBox().eval(tree) catch { case ex: Throwable => println(ex.getMessage) } } diff --git a/test/files/run/macro-reify-type/Macros_1.scala b/test/files/run/macro-reify-type/Macros_1.scala index 06de05735d..c4d1d9f8ad 100644 --- a/test/files/run/macro-reify-type/Macros_1.scala +++ b/test/files/run/macro-reify-type/Macros_1.scala @@ -8,7 +8,7 @@ object StaticReflect { import c.universe._ val nameName: TermName = name.tree match { - case Literal(Constant(str: String)) => newTermName(str) + case Literal(Constant(str: String)) => TermName(str) case _ => c.error(c.enclosingPosition, s"Method name not constant.") ; return reify(ru.NoType) } val clazz = weakTypeOf[A] @@ -17,8 +17,8 @@ object StaticReflect { case NoSymbol => c.error(c.enclosingPosition, s"No member called $nameName in $clazz.") ; reify(ru.NoType) case member => val mtpe = member typeSignatureIn clazz - val mtag = c.reifyType(treeBuild.mkRuntimeUniverseRef, Select(treeBuild.mkRuntimeUniverseRef, newTermName("rootMirror")), mtpe) - val mtree = Select(mtag, newTermName("tpe")) + val mtag = c.reifyType(treeBuild.mkRuntimeUniverseRef, Select(treeBuild.mkRuntimeUniverseRef, TermName("rootMirror")), mtpe) + val mtree = Select(mtag, TermName("tpe")) c.Expr[ru.Type](mtree) } diff --git a/test/files/run/macro-reify-type/Test_2.scala b/test/files/run/macro-reify-type/Test_2.scala index 9beaf98681..1f35973531 100644 --- a/test/files/run/macro-reify-type/Test_2.scala +++ b/test/files/run/macro-reify-type/Test_2.scala @@ -7,10 +7,10 @@ object Test extends App { //val $m: $u.Mirror = scala.reflect.runtime.universe.rootMirror; //import $u._, $m._, Flag._ //val tpe = { - // val symdef$B2 = build.newNestedSymbol(build.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), newTypeName("B"), NoPosition, DEFERRED | PARAM, false); - // val symdef$That2 = build.newNestedSymbol(build.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), newTypeName("That"), NoPosition, DEFERRED | PARAM, false); - // val symdef$f2 = build.newNestedSymbol(build.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), newTermName("f"), NoPosition, PARAM, false); - // val symdef$bf2 = build.newNestedSymbol(build.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), newTermName("bf"), NoPosition, IMPLICIT | PARAM, false); + // val symdef$B2 = build.newNestedSymbol(build.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TypeName("B"), NoPosition, DEFERRED | PARAM, false); + // val symdef$That2 = build.newNestedSymbol(build.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TypeName("That"), NoPosition, DEFERRED | PARAM, false); + // val symdef$f2 = build.newNestedSymbol(build.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TermName("f"), NoPosition, PARAM, false); + // val symdef$bf2 = build.newNestedSymbol(build.selectTerm(staticClass("scala.collection.TraversableLike"), "map"), TermName("bf"), NoPosition, IMPLICIT | PARAM, false); // build.setTypeSignature(symdef$B2, TypeBounds(staticClass("scala.Nothing").asType.toTypeConstructor, staticClass("scala.Any").asType.toTypeConstructor)); // build.setTypeSignature(symdef$That2, TypeBounds(staticClass("scala.Nothing").asType.toTypeConstructor, staticClass("scala.Any").asType.toTypeConstructor)); // build.setTypeSignature(symdef$f2, TypeRef(ThisType(staticPackage("scala").asModule.moduleClass), staticClass("scala.Function1"), List(staticClass("scala.Int").asType.toTypeConstructor, TypeRef(NoPrefix, symdef$B2, List())))); diff --git a/test/files/run/macro-reify-unreify/Macros_1.scala b/test/files/run/macro-reify-unreify/Macros_1.scala index 9f04c13014..25ed352cca 100644 --- a/test/files/run/macro-reify-unreify/Macros_1.scala +++ b/test/files/run/macro-reify-unreify/Macros_1.scala @@ -9,7 +9,7 @@ object Macros { import treeBuild._ val world = c.reifyTree(mkRuntimeUniverseRef, EmptyTree, s.tree) - val greeting = c.reifyTree(mkRuntimeUniverseRef, EmptyTree, c.typeCheck(Apply(Select(Literal(Constant("hello ")), newTermName("$plus")), List(c.unreifyTree(world))))) + val greeting = c.reifyTree(mkRuntimeUniverseRef, EmptyTree, c.typeCheck(Apply(Select(Literal(Constant("hello ")), TermName("$plus")), List(c.unreifyTree(world))))) val typedGreeting = c.Expr[String](greeting) c.universe.reify { diff --git a/test/files/run/macro-repl-basic.check b/test/files/run/macro-repl-basic.check index 7deed4a878..5323f429da 100644 --- a/test/files/run/macro-repl-basic.check +++ b/test/files/run/macro-repl-basic.check @@ -14,19 +14,19 @@ scala> scala> object Impls { def foo(c: Ctx)(x: c.Expr[Int]) = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1)))) + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) c.Expr[Int](body) } def bar(c: Ctx)(x: c.Expr[Int]) = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2)))) + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) c.Expr[Int](body) } def quux(c: Ctx)(x: c.Expr[Int]) = { import c.universe._ - val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3)))) + val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) c.Expr[Int](body) } } diff --git a/test/files/run/macro-repl-basic.scala b/test/files/run/macro-repl-basic.scala index eae1febb3a..3c22c13dc7 100644 --- a/test/files/run/macro-repl-basic.scala +++ b/test/files/run/macro-repl-basic.scala @@ -8,19 +8,19 @@ object Test extends ReplTest { |object Impls { | def foo(c: Ctx)(x: c.Expr[Int]) = { | import c.universe._ - | val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(1)))) + | val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(1)))) | c.Expr[Int](body) | } | | def bar(c: Ctx)(x: c.Expr[Int]) = { | import c.universe._ - | val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(2)))) + | val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(2)))) | c.Expr[Int](body) | } | | def quux(c: Ctx)(x: c.Expr[Int]) = { | import c.universe._ - | val body = Apply(Select(x.tree, newTermName("$plus")), List(Literal(Constant(3)))) + | val body = Apply(Select(x.tree, TermName("$plus")), List(Literal(Constant(3)))) | c.Expr[Int](body) | } |} 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 633cb930fc..dbeb7efbc0 100644 --- a/test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala +++ b/test/files/run/macro-typecheck-implicitsdisabled/Impls_Macros_1.scala @@ -4,7 +4,7 @@ object Macros { def impl_with_implicits_enabled(c: Context) = { import c.universe._ - val tree1 = Apply(Select(Literal(Constant(1)), newTermName("$minus$greater")), List(Literal(Constant(2)))) + val tree1 = Apply(Select(Literal(Constant(1)), TermName("$minus$greater")), List(Literal(Constant(2)))) val ttree1 = c.typeCheck(tree1, withImplicitViewsDisabled = false) c.literal(ttree1.toString) } @@ -15,7 +15,7 @@ object Macros { import c.universe._ try { - val tree2 = Apply(Select(Literal(Constant(1)), newTermName("$minus$greater")), List(Literal(Constant(2)))) + val tree2 = Apply(Select(Literal(Constant(1)), TermName("$minus$greater")), List(Literal(Constant(2)))) val ttree2 = c.typeCheck(tree2, withImplicitViewsDisabled = true) c.literal(ttree2.toString) } catch { 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 f693ad78cc..ff535fea8d 100644 --- a/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala +++ b/test/files/run/macro-typecheck-macrosdisabled/Impls_Macros_1.scala @@ -4,8 +4,8 @@ object Macros { def impl_with_macros_enabled(c: Context) = { import c.universe._ - val ru = Select(Select(Select(Select(Ident(newTermName("scala")), newTermName("reflect")), newTermName("runtime")), newTermName("package")), newTermName("universe")) - val tree1 = Apply(Select(ru, newTermName("reify")), List(Literal(Constant(2)))) + val ru = Select(Select(Select(Select(Ident(TermName("scala")), TermName("reflect")), TermName("runtime")), TermName("package")), TermName("universe")) + val tree1 = Apply(Select(ru, TermName("reify")), List(Literal(Constant(2)))) val ttree1 = c.typeCheck(tree1, withMacrosDisabled = false) c.literal(ttree1.toString) } @@ -21,7 +21,7 @@ object Macros { val ru = build.newFreeTerm("ru", scala.reflect.runtime.universe) build.setTypeSignature(ru, rutpe) - val tree2 = Apply(Select(Ident(ru), newTermName("reify")), List(Literal(Constant(2)))) + val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Literal(Constant(2)))) val ttree2 = c.typeCheck(tree2, withMacrosDisabled = true) c.literal(ttree2.toString) } diff --git a/test/files/run/macro-typecheck-macrosdisabled2.check b/test/files/run/macro-typecheck-macrosdisabled2.check index 7bdd1d6a3a..b958a95552 100644 --- a/test/files/run/macro-typecheck-macrosdisabled2.check +++ b/test/files/run/macro-typecheck-macrosdisabled2.check @@ -10,7 +10,7 @@ def apply[U >: Nothing <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; - $u.Apply.apply($u.Select.apply($u.Select.apply($u.build.Ident($m.staticPackage("scala")), $u.newTermName("Array")), $u.newTermName("apply")), scala.collection.immutable.List.apply[$u.Literal]($u.Literal.apply($u.Constant.apply(2)))) + $u.Apply.apply($u.Select.apply($u.Select.apply($u.build.Ident($m.staticPackage("scala")), $u.TermName.apply("Array")), $u.TermName.apply("apply")), scala.collection.immutable.List.apply[$u.Literal]($u.Literal.apply($u.Constant.apply(2)))) } }; new $treecreator1() 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 1dbf5a1a87..a96e0c53b6 100644 --- a/test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala +++ b/test/files/run/macro-typecheck-macrosdisabled2/Impls_Macros_1.scala @@ -4,8 +4,8 @@ object Macros { def impl_with_macros_enabled(c: Context) = { import c.universe._ - val ru = Select(Select(Select(Select(Ident(newTermName("scala")), newTermName("reflect")), newTermName("runtime")), newTermName("package")), newTermName("universe")) - val tree1 = Apply(Select(ru, newTermName("reify")), List(Apply(Select(Ident(newTermName("scala")), newTermName("Array")), List(Literal(Constant(2)))))) + val ru = Select(Select(Select(Select(Ident(TermName("scala")), TermName("reflect")), TermName("runtime")), TermName("package")), TermName("universe")) + val tree1 = Apply(Select(ru, TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) val ttree1 = c.typeCheck(tree1, withMacrosDisabled = false) c.literal(ttree1.toString) } @@ -21,7 +21,7 @@ object Macros { val ru = build.newFreeTerm("ru", scala.reflect.runtime.universe) build.setTypeSignature(ru, rutpe) - val tree2 = Apply(Select(Ident(ru), newTermName("reify")), List(Apply(Select(Ident(newTermName("scala")), newTermName("Array")), List(Literal(Constant(2)))))) + val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) val ttree2 = c.typeCheck(tree2, withMacrosDisabled = true) c.literal(ttree2.toString) } diff --git a/test/files/run/reflection-allmirrors-tostring.scala b/test/files/run/reflection-allmirrors-tostring.scala index 73afff291c..0ca387a6b1 100644 --- a/test/files/run/reflection-allmirrors-tostring.scala +++ b/test/files/run/reflection-allmirrors-tostring.scala @@ -26,18 +26,18 @@ object Test extends App { println(cm.reflect(new C)) val im = cm.reflect(new C) - println(im.reflectField(typeOf[C].member(newTermName("f1")).asTerm)) - println(im.reflectField(typeOf[C].member(newTermName("f2")).asTerm)) - println(im.reflectMethod(typeOf[C].member(newTermName("m1")).asMethod)) - println(im.reflectMethod(typeOf[C].member(newTermName("m2")).asMethod)) - println(im.reflectMethod(typeOf[C].member(newTermName("m3")).asMethod)) - println(im.reflectMethod(typeOf[C].member(newTermName("m4")).asMethod)) - println(im.reflectMethod(typeOf[C].member(newTermName("m5")).asMethod)) - println(im.reflectClass(typeOf[C].member(newTypeName("C")).asClass)) - println(im.reflectModule(typeOf[C].member(newTermName("M")).asModule)) + println(im.reflectField(typeOf[C].member(TermName("f1")).asTerm)) + println(im.reflectField(typeOf[C].member(TermName("f2")).asTerm)) + println(im.reflectMethod(typeOf[C].member(TermName("m1")).asMethod)) + println(im.reflectMethod(typeOf[C].member(TermName("m2")).asMethod)) + println(im.reflectMethod(typeOf[C].member(TermName("m3")).asMethod)) + println(im.reflectMethod(typeOf[C].member(TermName("m4")).asMethod)) + println(im.reflectMethod(typeOf[C].member(TermName("m5")).asMethod)) + println(im.reflectClass(typeOf[C].member(TypeName("C")).asClass)) + println(im.reflectModule(typeOf[C].member(TermName("M")).asModule)) val c = cm.staticClass("C") - val cc = typeOf[C].member(newTypeName("C")).asClass + val cc = typeOf[C].member(TypeName("C")).asClass println(cm.reflectClass(c).reflectConstructor(c.typeSignature.member(nme.CONSTRUCTOR).asMethod)) println(im.reflectClass(cc).reflectConstructor(cc.typeSignature.member(nme.CONSTRUCTOR).asMethod)) } \ No newline at end of file diff --git a/test/files/run/reflection-enclosed-basic.scala b/test/files/run/reflection-enclosed-basic.scala index 1dcb6c2a27..39e327cff6 100644 --- a/test/files/run/reflection-enclosed-basic.scala +++ b/test/files/run/reflection-enclosed-basic.scala @@ -12,7 +12,7 @@ private object B6 extends B2 { override def toString = "B6"; override def foo = object Test extends App { def testMethodInvocation(instance: Any) = { val instanceMirror = cm.reflect(instance) - val method = instanceMirror.symbol.typeSignature.declaration(newTermName("foo")).asMethod + val method = instanceMirror.symbol.typeSignature.declaration(TermName("foo")).asMethod val methodMirror = instanceMirror.reflectMethod(method) println(methodMirror()) } @@ -20,7 +20,7 @@ object Test extends App { def testNestedClass(name: String) = { val sym = cm.staticClass(name) println(sym) - val ctor = sym.typeSignature.declaration(newTermName("")).asMethod + val ctor = sym.typeSignature.declaration(TermName("")).asMethod val ctorMirror = cm.reflectClass(sym).reflectConstructor(ctor) val instance = ctorMirror() println(instance) diff --git a/test/files/run/reflection-enclosed-inner-basic.scala b/test/files/run/reflection-enclosed-inner-basic.scala index 2b2c701993..997a67ed61 100644 --- a/test/files/run/reflection-enclosed-inner-basic.scala +++ b/test/files/run/reflection-enclosed-inner-basic.scala @@ -18,15 +18,15 @@ object Test extends App { def testMethodInvocation(instance: Any) = { val instanceMirror = cm.reflect(instance) - val method = instanceMirror.symbol.typeSignature.declaration(newTermName("foo")).asMethod + val method = instanceMirror.symbol.typeSignature.declaration(TermName("foo")).asMethod val methodMirror = instanceMirror.reflectMethod(method) println(methodMirror()) } def testInnerClass(name: String) = { - val sym = b.typeSignature.declaration(newTypeName(name)).asClass + val sym = b.typeSignature.declaration(TypeName(name)).asClass println(sym) - val ctor = sym.typeSignature.declaration(newTermName("")).asMethod + val ctor = sym.typeSignature.declaration(TermName("")).asMethod val ctorMirror = cm.reflect(new B).reflectClass(sym).reflectConstructor(ctor) val instance = ctorMirror() println(instance) @@ -37,7 +37,7 @@ object Test extends App { testInnerClass("B2") def testInnerModule(name: String) = { - val sym = b.typeSignature.declaration(newTermName(name)).asModule + val sym = b.typeSignature.declaration(TermName(name)).asModule println(sym) val moduleMirror = cm.reflect(new B).reflectModule(sym) val instance = moduleMirror.instance diff --git a/test/files/run/reflection-enclosed-inner-inner-basic.scala b/test/files/run/reflection-enclosed-inner-inner-basic.scala index 1b9e19d37d..704363dab9 100644 --- a/test/files/run/reflection-enclosed-inner-inner-basic.scala +++ b/test/files/run/reflection-enclosed-inner-inner-basic.scala @@ -20,15 +20,15 @@ object Test extends App { def testMethodInvocation(instance: Any) = { val instanceMirror = cm.reflect(instance) - val method = instanceMirror.symbol.typeSignature.declaration(newTermName("foo")).asMethod + val method = instanceMirror.symbol.typeSignature.declaration(TermName("foo")).asMethod val methodMirror = instanceMirror.reflectMethod(method) println(methodMirror()) } def testInnerClass(name: String) = { - val sym = b.typeSignature.declaration(newTypeName(name)).asClass + val sym = b.typeSignature.declaration(TypeName(name)).asClass println(sym) - val ctor = sym.typeSignature.declaration(newTermName("")).asMethod + val ctor = sym.typeSignature.declaration(TermName("")).asMethod val outer1 = new B val outer2 = new outer1.BB val ctorMirror = cm.reflect(outer2).reflectClass(sym).reflectConstructor(ctor) @@ -41,7 +41,7 @@ object Test extends App { testInnerClass("B2") def testInnerModule(name: String) = { - val sym = b.typeSignature.declaration(newTermName(name)).asModule + val sym = b.typeSignature.declaration(TermName(name)).asModule println(sym) val outer1 = new B val outer2 = new outer1.BB diff --git a/test/files/run/reflection-enclosed-inner-nested-basic.scala b/test/files/run/reflection-enclosed-inner-nested-basic.scala index 2800ee2548..1e3797a9ea 100644 --- a/test/files/run/reflection-enclosed-inner-nested-basic.scala +++ b/test/files/run/reflection-enclosed-inner-nested-basic.scala @@ -21,15 +21,15 @@ object Test extends App { def testMethodInvocation(instance: Any) = { val instanceMirror = cm.reflect(instance) - val method = instanceMirror.symbol.typeSignature.declaration(newTermName("foo")).asMethod + val method = instanceMirror.symbol.typeSignature.declaration(TermName("foo")).asMethod val methodMirror = instanceMirror.reflectMethod(method) println(methodMirror()) } def testNestedClass(name: String) = { - val sym = b.typeSignature.declaration(newTypeName(name)).asClass + val sym = b.typeSignature.declaration(TypeName(name)).asClass println(sym) - val ctor = sym.typeSignature.declaration(newTermName("")).asMethod + val ctor = sym.typeSignature.declaration(TermName("")).asMethod val ctorMirror = cm.reflect(outer1.BB).reflectClass(sym).reflectConstructor(ctor) val instance = ctorMirror() println(instance) @@ -40,7 +40,7 @@ object Test extends App { testNestedClass("B2") def testNestedModule(name: String) = { - val sym = b.typeSignature.declaration(newTermName(name)).asModule + val sym = b.typeSignature.declaration(TermName(name)).asModule println(sym) val moduleMirror = cm.reflect(outer1.BB).reflectModule(sym) val instance = moduleMirror.instance diff --git a/test/files/run/reflection-enclosed-nested-basic.scala b/test/files/run/reflection-enclosed-nested-basic.scala index 8b740c2da2..a629d8a2d0 100644 --- a/test/files/run/reflection-enclosed-nested-basic.scala +++ b/test/files/run/reflection-enclosed-nested-basic.scala @@ -18,15 +18,15 @@ object Test extends App { def testMethodInvocation(instance: Any) = { val instanceMirror = cm.reflect(instance) - val method = instanceMirror.symbol.typeSignature.declaration(newTermName("foo")).asMethod + val method = instanceMirror.symbol.typeSignature.declaration(TermName("foo")).asMethod val methodMirror = instanceMirror.reflectMethod(method) println(methodMirror()) } def testNestedClass(name: String) = { - val sym = b.typeSignature.declaration(newTypeName(name)).asClass + val sym = b.typeSignature.declaration(TypeName(name)).asClass println(sym) - val ctor = sym.typeSignature.declaration(newTermName("")).asMethod + val ctor = sym.typeSignature.declaration(TermName("")).asMethod val ctorMirror = cm.reflectClass(sym).reflectConstructor(ctor) val instance = ctorMirror() println(instance) @@ -37,7 +37,7 @@ object Test extends App { testNestedClass("B2") def testNestedModule(name: String) = { - val sym = b.typeSignature.declaration(newTermName(name)).asModule + val sym = b.typeSignature.declaration(TermName(name)).asModule println(sym) val moduleMirror = cm.reflectModule(sym) val instance = moduleMirror.instance diff --git a/test/files/run/reflection-enclosed-nested-inner-basic.scala b/test/files/run/reflection-enclosed-nested-inner-basic.scala index 7466733d37..9c726e55d4 100644 --- a/test/files/run/reflection-enclosed-nested-inner-basic.scala +++ b/test/files/run/reflection-enclosed-nested-inner-basic.scala @@ -20,15 +20,15 @@ object Test extends App { def testMethodInvocation(instance: Any) = { val instanceMirror = cm.reflect(instance) - val method = instanceMirror.symbol.typeSignature.declaration(newTermName("foo")).asMethod + val method = instanceMirror.symbol.typeSignature.declaration(TermName("foo")).asMethod val methodMirror = instanceMirror.reflectMethod(method) println(methodMirror()) } def testInnerClass(name: String) = { - val sym = b.typeSignature.declaration(newTypeName(name)).asClass + val sym = b.typeSignature.declaration(TypeName(name)).asClass println(sym) - val ctor = sym.typeSignature.declaration(newTermName("")).asMethod + val ctor = sym.typeSignature.declaration(TermName("")).asMethod val ctorMirror = cm.reflect(new B.BB).reflectClass(sym).reflectConstructor(ctor) val instance = ctorMirror() println(instance) @@ -39,7 +39,7 @@ object Test extends App { testInnerClass("B2") def testInnerModule(name: String) = { - val sym = b.typeSignature.declaration(newTermName(name)).asModule + val sym = b.typeSignature.declaration(TermName(name)).asModule println(sym) val moduleMirror = cm.reflect(new B.BB).reflectModule(sym) val instance = moduleMirror.instance diff --git a/test/files/run/reflection-enclosed-nested-nested-basic.scala b/test/files/run/reflection-enclosed-nested-nested-basic.scala index 8335ea482a..247eba120e 100644 --- a/test/files/run/reflection-enclosed-nested-nested-basic.scala +++ b/test/files/run/reflection-enclosed-nested-nested-basic.scala @@ -20,15 +20,15 @@ object Test extends App { def testMethodInvocation(instance: Any) = { val instanceMirror = cm.reflect(instance) - val method = instanceMirror.symbol.typeSignature.declaration(newTermName("foo")).asMethod + val method = instanceMirror.symbol.typeSignature.declaration(TermName("foo")).asMethod val methodMirror = instanceMirror.reflectMethod(method) println(methodMirror()) } def testNestedClass(name: String) = { - val sym = b.typeSignature.declaration(newTypeName(name)).asClass + val sym = b.typeSignature.declaration(TypeName(name)).asClass println(sym) - val ctor = sym.typeSignature.declaration(newTermName("")).asMethod + val ctor = sym.typeSignature.declaration(TermName("")).asMethod val ctorMirror = cm.reflectClass(sym).reflectConstructor(ctor) val instance = ctorMirror() println(instance) @@ -39,7 +39,7 @@ object Test extends App { testNestedClass("B2") def testNestedModule(name: String) = { - val sym = b.typeSignature.declaration(newTermName(name)).asModule + val sym = b.typeSignature.declaration(TermName(name)).asModule println(sym) val moduleMirror = cm.reflectModule(sym) val instance = moduleMirror.instance diff --git a/test/files/run/reflection-equality.check b/test/files/run/reflection-equality.check index 17c1f6dd70..eb2ab0020d 100644 --- a/test/files/run/reflection-equality.check +++ b/test/files/run/reflection-equality.check @@ -29,7 +29,7 @@ java.lang.Object { def methodIntIntInt(x: scala.Int,y: scala.Int): scala.Int } -scala> val ms: MethodSymbol = ts.declaration(newTermName("methodIntIntInt")).asMethod +scala> val ms: MethodSymbol = ts.declaration(TermName("methodIntIntInt")).asMethod ms: reflect.runtime.universe.MethodSymbol = method methodIntIntInt scala> val MethodType( _, t1 ) = ms.typeSignature diff --git a/test/files/run/reflection-equality.scala b/test/files/run/reflection-equality.scala index 8fc82721e7..40f116bb53 100644 --- a/test/files/run/reflection-equality.scala +++ b/test/files/run/reflection-equality.scala @@ -11,7 +11,7 @@ object Test extends ReplTest { |def im: InstanceMirror = cm.reflect(new X) |val cs: ClassSymbol = im.symbol |val ts: Type = cs.typeSignature - |val ms: MethodSymbol = ts.declaration(newTermName("methodIntIntInt")).asMethod + |val ms: MethodSymbol = ts.declaration(TermName("methodIntIntInt")).asMethod |val MethodType( _, t1 ) = ms.typeSignature |val t2 = typeOf[scala.Int] |t1 == t2 diff --git a/test/files/run/reflection-fieldmirror-accessorsareokay.scala b/test/files/run/reflection-fieldmirror-accessorsareokay.scala index 16354025f3..3926ab7835 100644 --- a/test/files/run/reflection-fieldmirror-accessorsareokay.scala +++ b/test/files/run/reflection-fieldmirror-accessorsareokay.scala @@ -24,6 +24,6 @@ object Test extends App { } } - test(cs.typeSignature.declaration(newTermName("x")).asTerm) - test(cs.typeSignature.declaration(newTermName("x_$eq")).asTerm) + test(cs.typeSignature.declaration(TermName("x")).asTerm) + test(cs.typeSignature.declaration(TermName("x_$eq")).asTerm) } diff --git a/test/files/run/reflection-fieldmirror-ctorparam.scala b/test/files/run/reflection-fieldmirror-ctorparam.scala index b9d50fe97b..608adad27b 100644 --- a/test/files/run/reflection-fieldmirror-ctorparam.scala +++ b/test/files/run/reflection-fieldmirror-ctorparam.scala @@ -10,7 +10,7 @@ object Test extends App { val im: InstanceMirror = cm.reflect(a) val cs = im.symbol - val f = cs.typeSignature.declaration(newTermName("x")).asTerm + val f = cs.typeSignature.declaration(TermName("x")).asTerm try { val fm: FieldMirror = im.reflectField(f) println(fm.get) diff --git a/test/files/run/reflection-fieldmirror-getsetval.scala b/test/files/run/reflection-fieldmirror-getsetval.scala index 67c54d9708..9cacb7080b 100644 --- a/test/files/run/reflection-fieldmirror-getsetval.scala +++ b/test/files/run/reflection-fieldmirror-getsetval.scala @@ -10,7 +10,7 @@ object Test extends App { val im: InstanceMirror = cm.reflect(a) val cs = im.symbol - val f = cs.typeSignature.declaration(newTermName("x" + nme.LOCAL_SUFFIX_STRING)).asTerm + val f = cs.typeSignature.declaration(TermName("x" + nme.LOCAL_SUFFIX_STRING)).asTerm val fm: FieldMirror = im.reflectField(f) try { println(fm.get) diff --git a/test/files/run/reflection-fieldmirror-getsetvar.scala b/test/files/run/reflection-fieldmirror-getsetvar.scala index abcf396dd1..52c13a73bb 100644 --- a/test/files/run/reflection-fieldmirror-getsetvar.scala +++ b/test/files/run/reflection-fieldmirror-getsetvar.scala @@ -10,7 +10,7 @@ object Test extends App { val im: InstanceMirror = cm.reflect(a) val cs = im.symbol - val f = cs.typeSignature.declaration(newTermName("x" + nme.LOCAL_SUFFIX_STRING)).asTerm + val f = cs.typeSignature.declaration(TermName("x" + nme.LOCAL_SUFFIX_STRING)).asTerm val fm: FieldMirror = im.reflectField(f) println(fm.get) fm.set(2) diff --git a/test/files/run/reflection-fieldmirror-nmelocalsuffixstring.scala b/test/files/run/reflection-fieldmirror-nmelocalsuffixstring.scala index 2b4a9bb55e..e070cdcfa3 100644 --- a/test/files/run/reflection-fieldmirror-nmelocalsuffixstring.scala +++ b/test/files/run/reflection-fieldmirror-nmelocalsuffixstring.scala @@ -10,7 +10,7 @@ object Test extends App { val im: InstanceMirror = cm.reflect(a) val cs = im.symbol - val f = cs.typeSignature.declaration(newTermName("x" + nme.LOCAL_SUFFIX_STRING)).asTerm + val f = cs.typeSignature.declaration(TermName("x" + nme.LOCAL_SUFFIX_STRING)).asTerm val fm: FieldMirror = im.reflectField(f) println(fm.symbol.isVar) } diff --git a/test/files/run/reflection-fieldmirror-privatethis.scala b/test/files/run/reflection-fieldmirror-privatethis.scala index ab838dbb1b..89948772b1 100644 --- a/test/files/run/reflection-fieldmirror-privatethis.scala +++ b/test/files/run/reflection-fieldmirror-privatethis.scala @@ -10,7 +10,7 @@ object Test extends App { val im: InstanceMirror = cm.reflect(a) val cs = im.symbol - val f = cs.typeSignature.declaration(newTermName("x")).asTerm + val f = cs.typeSignature.declaration(TermName("x")).asTerm val fm: FieldMirror = im.reflectField(f) println(fm.symbol.isVar) println(fm.get) diff --git a/test/files/run/reflection-fieldsymbol-navigation.scala b/test/files/run/reflection-fieldsymbol-navigation.scala index 4448724988..33dc18a7e3 100644 --- a/test/files/run/reflection-fieldsymbol-navigation.scala +++ b/test/files/run/reflection-fieldsymbol-navigation.scala @@ -5,7 +5,7 @@ class C { } object Test extends App { - val x = typeOf[C].member(newTermName("x")).asTerm + val x = typeOf[C].member(TermName("x")).asTerm println(x) println(x.isVar) println(x.accessed) diff --git a/test/files/run/reflection-implClass.scala b/test/files/run/reflection-implClass.scala index b3c0081ccf..db211fd9a8 100644 --- a/test/files/run/reflection-implClass.scala +++ b/test/files/run/reflection-implClass.scala @@ -10,19 +10,19 @@ object Test extends App with Outer { import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} - assert(cm.classSymbol(classTag[Foo].runtimeClass).typeSignature.declaration(newTermName("bar")).typeSignature == - cm.classSymbol(classTag[Bar].runtimeClass).typeSignature.declaration(newTermName("foo")).typeSignature) + assert(cm.classSymbol(classTag[Foo].runtimeClass).typeSignature.declaration(TermName("bar")).typeSignature == + cm.classSymbol(classTag[Bar].runtimeClass).typeSignature.declaration(TermName("foo")).typeSignature) val s1 = implClass(classTag[Foo].runtimeClass) assert(s1 != NoSymbol) assert(s1.typeSignature != NoType) assert(s1.companionSymbol.typeSignature != NoType) - assert(s1.companionSymbol.typeSignature.declaration(newTermName("bar")) != NoSymbol) + assert(s1.companionSymbol.typeSignature.declaration(TermName("bar")) != NoSymbol) val s2 = implClass(classTag[Bar].runtimeClass) assert(s2 != NoSymbol) assert(s2.typeSignature != NoType) assert(s2.companionSymbol.typeSignature != NoType) - assert(s2.companionSymbol.typeSignature.declaration(newTermName("foo")) != NoSymbol) + assert(s2.companionSymbol.typeSignature.declaration(TermName("foo")) != NoSymbol) def implClass(clazz: Class[_]) = { val implClass = Class.forName(clazz.getName + "$class") cm.classSymbol(implClass) diff --git a/test/files/run/reflection-magicsymbols-invoke.scala b/test/files/run/reflection-magicsymbols-invoke.scala index 5f39370708..e366495ec7 100644 --- a/test/files/run/reflection-magicsymbols-invoke.scala +++ b/test/files/run/reflection-magicsymbols-invoke.scala @@ -28,7 +28,7 @@ object Test extends App { val ctor = tpe.declaration(nme.CONSTRUCTOR).asMethod cm.reflectClass(ctor.owner.asClass).reflectConstructor(ctor)(args: _*) } else { - val meth = tpe.declaration(newTermName(method).encodedName.toTermName).asMethod + val meth = tpe.declaration(TermName(method).encodedName.toTermName).asMethod cm.reflect(receiver).reflectMethod(meth)(args: _*) } }) diff --git a/test/files/run/reflection-magicsymbols-repl.check b/test/files/run/reflection-magicsymbols-repl.check index d3cd26f25f..85a1f63f01 100644 --- a/test/files/run/reflection-magicsymbols-repl.check +++ b/test/files/run/reflection-magicsymbols-repl.check @@ -19,7 +19,7 @@ scala> class A { defined class A scala> def test(n: Int): Unit = { - val sig = typeOf[A] member newTermName("foo" + n) typeSignature + val sig = typeOf[A] member TermName("foo" + n) typeSignature val x = sig.asInstanceOf[MethodType].params.head println(x.typeSignature) } diff --git a/test/files/run/reflection-magicsymbols-repl.scala b/test/files/run/reflection-magicsymbols-repl.scala index 26127b8661..6a432c2664 100644 --- a/test/files/run/reflection-magicsymbols-repl.scala +++ b/test/files/run/reflection-magicsymbols-repl.scala @@ -14,7 +14,7 @@ object Test extends ReplTest { | def foo8(x: Singleton) = ??? |} |def test(n: Int): Unit = { - | val sig = typeOf[A] member newTermName("foo" + n) typeSignature + | val sig = typeOf[A] member TermName("foo" + n) typeSignature | val x = sig.asInstanceOf[MethodType].params.head | println(x.typeSignature) |} diff --git a/test/files/run/reflection-magicsymbols-vanilla.scala b/test/files/run/reflection-magicsymbols-vanilla.scala index 32819dcc46..26b70460eb 100644 --- a/test/files/run/reflection-magicsymbols-vanilla.scala +++ b/test/files/run/reflection-magicsymbols-vanilla.scala @@ -12,7 +12,7 @@ class A { object Test extends App { import scala.reflect.runtime.universe._ def test(n: Int): Unit = { - val sig = typeOf[A] member newTermName("foo" + n) typeSignature + val sig = typeOf[A] member TermName("foo" + n) typeSignature val x = sig.asInstanceOf[MethodType].params.head println(x.typeSignature) } diff --git a/test/files/run/reflection-methodsymbol-params.scala b/test/files/run/reflection-methodsymbol-params.scala index 45b1f9628f..baad8d6b9b 100644 --- a/test/files/run/reflection-methodsymbol-params.scala +++ b/test/files/run/reflection-methodsymbol-params.scala @@ -13,12 +13,12 @@ class C { } object Test extends App { - println(typeOf[C].member(newTermName("x1")).asMethod.paramss) - println(typeOf[C].member(newTermName("x2")).asMethod.paramss) - println(typeOf[C].member(newTermName("x3")).asMethod.paramss) - println(typeOf[C].member(newTermName("x4")).asMethod.paramss) - println(typeOf[C].member(newTermName("y1")).asMethod.paramss) - println(typeOf[C].member(newTermName("y2")).asMethod.paramss) - println(typeOf[C].member(newTermName("y3")).asMethod.paramss) - println(typeOf[C].member(newTermName("y4")).asMethod.paramss) + println(typeOf[C].member(TermName("x1")).asMethod.paramss) + println(typeOf[C].member(TermName("x2")).asMethod.paramss) + println(typeOf[C].member(TermName("x3")).asMethod.paramss) + println(typeOf[C].member(TermName("x4")).asMethod.paramss) + println(typeOf[C].member(TermName("y1")).asMethod.paramss) + println(typeOf[C].member(TermName("y2")).asMethod.paramss) + println(typeOf[C].member(TermName("y3")).asMethod.paramss) + println(typeOf[C].member(TermName("y4")).asMethod.paramss) } \ No newline at end of file diff --git a/test/files/run/reflection-methodsymbol-returntype.scala b/test/files/run/reflection-methodsymbol-returntype.scala index 392754dbe4..74a9e5dac0 100644 --- a/test/files/run/reflection-methodsymbol-returntype.scala +++ b/test/files/run/reflection-methodsymbol-returntype.scala @@ -13,12 +13,12 @@ class C { } object Test extends App { - println(typeOf[C].member(newTermName("x1")).asMethod.returnType) - println(typeOf[C].member(newTermName("x2")).asMethod.returnType) - println(typeOf[C].member(newTermName("x3")).asMethod.returnType) - println(typeOf[C].member(newTermName("x4")).asMethod.returnType) - println(typeOf[C].member(newTermName("y1")).asMethod.returnType) - println(typeOf[C].member(newTermName("y2")).asMethod.returnType) - println(typeOf[C].member(newTermName("y3")).asMethod.returnType) - println(typeOf[C].member(newTermName("y4")).asMethod.returnType) + println(typeOf[C].member(TermName("x1")).asMethod.returnType) + println(typeOf[C].member(TermName("x2")).asMethod.returnType) + println(typeOf[C].member(TermName("x3")).asMethod.returnType) + println(typeOf[C].member(TermName("x4")).asMethod.returnType) + println(typeOf[C].member(TermName("y1")).asMethod.returnType) + println(typeOf[C].member(TermName("y2")).asMethod.returnType) + println(typeOf[C].member(TermName("y3")).asMethod.returnType) + println(typeOf[C].member(TermName("y4")).asMethod.returnType) } \ No newline at end of file diff --git a/test/files/run/reflection-methodsymbol-typeparams.scala b/test/files/run/reflection-methodsymbol-typeparams.scala index bb0a3c3aec..56d37ebeaa 100644 --- a/test/files/run/reflection-methodsymbol-typeparams.scala +++ b/test/files/run/reflection-methodsymbol-typeparams.scala @@ -13,12 +13,12 @@ class C { } object Test extends App { - println(typeOf[C].member(newTermName("x1")).asMethod.typeParams) - println(typeOf[C].member(newTermName("x2")).asMethod.typeParams) - println(typeOf[C].member(newTermName("x3")).asMethod.typeParams) - println(typeOf[C].member(newTermName("x4")).asMethod.typeParams) - println(typeOf[C].member(newTermName("y1")).asMethod.typeParams) - println(typeOf[C].member(newTermName("y2")).asMethod.typeParams) - println(typeOf[C].member(newTermName("y3")).asMethod.typeParams) - println(typeOf[C].member(newTermName("y4")).asMethod.typeParams) + println(typeOf[C].member(TermName("x1")).asMethod.typeParams) + println(typeOf[C].member(TermName("x2")).asMethod.typeParams) + println(typeOf[C].member(TermName("x3")).asMethod.typeParams) + println(typeOf[C].member(TermName("x4")).asMethod.typeParams) + println(typeOf[C].member(TermName("y1")).asMethod.typeParams) + println(typeOf[C].member(TermName("y2")).asMethod.typeParams) + println(typeOf[C].member(TermName("y3")).asMethod.typeParams) + println(typeOf[C].member(TermName("y4")).asMethod.typeParams) } \ No newline at end of file diff --git a/test/files/run/reflection-repl-classes.check b/test/files/run/reflection-repl-classes.check index 2dd96a93bf..606d67ce5e 100644 --- a/test/files/run/reflection-repl-classes.check +++ b/test/files/run/reflection-repl-classes.check @@ -19,7 +19,7 @@ scala> object defs { val cm = reflect.runtime.currentMirror val u = cm.universe val im = cm.reflect(new B) - val method = im.symbol.typeSignature.member(u.newTermName("foo")).asMethod + val method = im.symbol.typeSignature.member(u.TermName("foo")).asMethod val mm = im.reflectMethod(method) } defined module defs diff --git a/test/files/run/reflection-repl-classes.scala b/test/files/run/reflection-repl-classes.scala index 80e332cde3..4bfb980498 100644 --- a/test/files/run/reflection-repl-classes.scala +++ b/test/files/run/reflection-repl-classes.scala @@ -12,7 +12,7 @@ object Test extends ReplTest { | val cm = reflect.runtime.currentMirror | val u = cm.universe | val im = cm.reflect(new B) - | val method = im.symbol.typeSignature.member(u.newTermName("foo")).asMethod + | val method = im.symbol.typeSignature.member(u.TermName("foo")).asMethod | val mm = im.reflectMethod(method) |} |import defs._ diff --git a/test/files/run/reflection-sanitychecks.scala b/test/files/run/reflection-sanitychecks.scala index f817f23731..709c32c80e 100644 --- a/test/files/run/reflection-sanitychecks.scala +++ b/test/files/run/reflection-sanitychecks.scala @@ -32,14 +32,14 @@ object Test extends App { def test(tpe: Type): Unit = { def failsafe(action: => Any): Any = try action catch { case ex: Throwable => ex.toString } println(s"=========members of ${tpe.typeSymbol.name} in a mirror of D=========") - println("field #1: " + failsafe(im.reflectField(tpe.member(newTermName("foo")).asTerm).get)) - println("method #1: " + failsafe(im.reflectMethod(tpe.member(newTermName("bar")).asMethod)())) - println("field #2: " + failsafe(im.reflectField(tpe.member(newTermName("quux")).asTerm).get)) - println("method #2: " + failsafe(im.reflectMethod(tpe.member(newTermName("baz")).asMethod)())) - println("constructor #1: " + failsafe(cm.reflectClass(im.symbol).reflectConstructor(tpe.member(newTermName("bar")).asMethod)())) - println("constructor #2: " + failsafe(cm.reflectClass(im.symbol).reflectConstructor(tpe.member(newTermName("")).asMethod)())) - println("class: " + failsafe(im.reflectClass(tpe.member(newTypeName("C")).asClass).reflectConstructor(typeOf[C].member(newTypeName("C")).asClass.typeSignature.member(newTermName("")).asMethod)())) - println("object: " + failsafe(im.reflectModule(tpe.member(newTermName("O")).asModule).instance)) + println("field #1: " + failsafe(im.reflectField(tpe.member(TermName("foo")).asTerm).get)) + println("method #1: " + failsafe(im.reflectMethod(tpe.member(TermName("bar")).asMethod)())) + println("field #2: " + failsafe(im.reflectField(tpe.member(TermName("quux")).asTerm).get)) + println("method #2: " + failsafe(im.reflectMethod(tpe.member(TermName("baz")).asMethod)())) + println("constructor #1: " + failsafe(cm.reflectClass(im.symbol).reflectConstructor(tpe.member(TermName("bar")).asMethod)())) + println("constructor #2: " + failsafe(cm.reflectClass(im.symbol).reflectConstructor(tpe.member(TermName("")).asMethod)())) + println("class: " + failsafe(im.reflectClass(tpe.member(TypeName("C")).asClass).reflectConstructor(typeOf[C].member(TypeName("C")).asClass.typeSignature.member(TermName("")).asMethod)())) + println("object: " + failsafe(im.reflectModule(tpe.member(TermName("O")).asModule).instance)) println() } diff --git a/test/files/run/reflection-valueclasses-derived.scala b/test/files/run/reflection-valueclasses-derived.scala index 6b08f987ba..8d25e2929c 100644 --- a/test/files/run/reflection-valueclasses-derived.scala +++ b/test/files/run/reflection-valueclasses-derived.scala @@ -6,7 +6,7 @@ class C(val x: Int) extends AnyVal { } object Test extends App { - println(cm.reflect(new C(2)).reflectMethod(typeOf[C].member(newTermName("foo")).asMethod)(2)) - println(cm.reflect(new C(2)).reflectMethod(typeOf[C].member(newTermName("getClass")).asMethod)()) - println(cm.reflect(new C(2)).reflectMethod(typeOf[C].member(newTermName("toString")).asMethod)()) + println(cm.reflect(new C(2)).reflectMethod(typeOf[C].member(TermName("foo")).asMethod)(2)) + println(cm.reflect(new C(2)).reflectMethod(typeOf[C].member(TermName("getClass")).asMethod)()) + println(cm.reflect(new C(2)).reflectMethod(typeOf[C].member(TermName("toString")).asMethod)()) } \ No newline at end of file diff --git a/test/files/run/reflection-valueclasses-magic.scala b/test/files/run/reflection-valueclasses-magic.scala index c4a26e460a..33d4634397 100644 --- a/test/files/run/reflection-valueclasses-magic.scala +++ b/test/files/run/reflection-valueclasses-magic.scala @@ -44,7 +44,7 @@ object Test extends App { val realex = scala.ExceptionUtils.unwrapThrowable(ex) println(realex.getClass + ": " + realex.getMessage) } - val meth = tpe.declaration(newTermName(method).encodedName.toTermName) + val meth = tpe.declaration(TermName(method).encodedName.toTermName) val testees = if (meth.isMethod) List(meth.asMethod) else meth.asTerm.alternatives.map(_.asMethod) testees foreach (testee => { val convertedArgs = args.zipWithIndex.map { case (arg, i) => convert(arg, testee.paramss.flatten.apply(i).typeSignature) } diff --git a/test/files/run/reflection-valueclasses-standard.scala b/test/files/run/reflection-valueclasses-standard.scala index 18a3d1fa04..b6b5a2ede2 100644 --- a/test/files/run/reflection-valueclasses-standard.scala +++ b/test/files/run/reflection-valueclasses-standard.scala @@ -5,8 +5,8 @@ import scala.reflect.{ClassTag, classTag} object Test extends App { def test[T: ClassTag: TypeTag](x: T) = { println(s"========${classTag[T].runtimeClass}========") - println(cm.reflect(x).reflectMethod(typeOf[T].member(newTermName("getClass")).asMethod)()) - println(cm.reflect(x).reflectMethod(typeOf[T].member(newTermName("toString")).asMethod)()) + println(cm.reflect(x).reflectMethod(typeOf[T].member(TermName("getClass")).asMethod)()) + println(cm.reflect(x).reflectMethod(typeOf[T].member(TermName("toString")).asMethod)()) } test(2.toByte) diff --git a/test/files/run/reify-aliases.check b/test/files/run/reify-aliases.check index aa846b9bc6..da784227af 100644 --- a/test/files/run/reify-aliases.check +++ b/test/files/run/reify-aliases.check @@ -1 +1 @@ -TypeRef(SingleType(ThisType(scala), scala.Predef), newTypeName("String"), List()) +TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List()) diff --git a/test/files/run/reify_copypaste1.scala b/test/files/run/reify_copypaste1.scala index c597b7af19..b2eef28026 100644 --- a/test/files/run/reify_copypaste1.scala +++ b/test/files/run/reify_copypaste1.scala @@ -9,8 +9,8 @@ object Test extends App { val output = new java.io.ByteArrayOutputStream() System.setOut(new java.io.PrintStream(output)) val toolBox = currentMirror.mkToolBox(options = "-Yreify-copypaste") - val reify = Select(Select(Select(Select(Ident(ScalaPackage), newTermName("reflect")), newTermName("runtime")), newTermName("universe")), newTermName("reify")) - val reifee = Block(List(ValDef(Modifiers(LAZY), newTermName("x"), TypeTree(), Apply(Ident(ListModule), List(Literal(Constant(1)), Literal(Constant(2)))))), Ident(newTermName("x"))) + val reify = Select(Select(Select(Select(Ident(ScalaPackage), TermName("reflect")), TermName("runtime")), TermName("universe")), TermName("reify")) + val reifee = Block(List(ValDef(Modifiers(LAZY), TermName("x"), TypeTree(), Apply(Ident(ListModule), List(Literal(Constant(1)), Literal(Constant(2)))))), Ident(TermName("x"))) toolBox.eval(Apply(reify, List(reifee))) val Block(List(tpeCopypaste), exprCopypaste @ ModuleDef(_, _, Template(_, _, (_ :: stats) :+ expr))) = toolBox.parse(output.toString()) output.reset() diff --git a/test/files/run/reify_newimpl_22.check b/test/files/run/reify_newimpl_22.check index dcb3e2889b..e68fe2f6b1 100644 --- a/test/files/run/reify_newimpl_22.check +++ b/test/files/run/reify_newimpl_22.check @@ -19,7 +19,7 @@ scala> { } println(code.eval) } -:15: free term: Ident(newTermName("x")) defined by res0 in :14:21 +:15: free term: Ident(TermName("x")) defined by res0 in :14:21 val code = reify { ^ 2 diff --git a/test/files/run/reify_newimpl_23.check b/test/files/run/reify_newimpl_23.check index 882124657e..38c95646a8 100644 --- a/test/files/run/reify_newimpl_23.check +++ b/test/files/run/reify_newimpl_23.check @@ -18,7 +18,7 @@ scala> def foo[T]{ } println(code.eval) } -:13: free type: Ident(newTypeName("T")) defined by foo in :12:16 +:13: free type: Ident(TypeName("T")) defined by foo in :12:16 val code = reify { ^ foo: [T]=> Unit diff --git a/test/files/run/reify_newimpl_25.check b/test/files/run/reify_newimpl_25.check index d1028b94c7..86f6abce02 100644 --- a/test/files/run/reify_newimpl_25.check +++ b/test/files/run/reify_newimpl_25.check @@ -9,7 +9,7 @@ scala> { val tt = implicitly[TypeTag[x.type]] println(tt) } -:11: free term: Ident(newTermName("x")) defined by res0 in :10:21 +:11: free term: Ident(TermName("x")) defined by res0 in :10:21 val tt = implicitly[TypeTag[x.type]] ^ TypeTag[x.type] diff --git a/test/files/run/reify_newimpl_26.check b/test/files/run/reify_newimpl_26.check index 347f6365aa..d3e2540de0 100644 --- a/test/files/run/reify_newimpl_26.check +++ b/test/files/run/reify_newimpl_26.check @@ -8,7 +8,7 @@ scala> def foo[T]{ val tt = implicitly[WeakTypeTag[List[T]]] println(tt) } -:9: free type: Ident(newTypeName("T")) defined by foo in :7:16 +:9: free type: Ident(TypeName("T")) defined by foo in :7:16 val tt = implicitly[WeakTypeTag[List[T]]] ^ foo: [T]=> Unit diff --git a/test/files/run/reify_printf.scala b/test/files/run/reify_printf.scala index 272856b962..9932a58dfa 100644 --- a/test/files/run/reify_printf.scala +++ b/test/files/run/reify_printf.scala @@ -23,7 +23,7 @@ object Test extends App { */ var i = 0 - def gensym(name: String) = { i += 1; newTermName(name + i) } + def gensym(name: String) = { i += 1; TermName(name + i) } def createTempValDef( value : Tree, tpe : Type ) : (Option[Tree],Tree) = { val local = gensym("temp") @@ -59,10 +59,10 @@ object Test extends App { Apply( Select( Select( - Ident( newTermName("scala") ) - , newTermName("Predef") + Ident( TermName("scala") ) + , TermName("Predef") ) - , newTermName("print") + , TermName("print") ) , List(ref) ): Tree diff --git a/test/files/run/showraw_aliases.check b/test/files/run/showraw_aliases.check index aebd354031..d6a198b1cb 100644 --- a/test/files/run/showraw_aliases.check +++ b/test/files/run/showraw_aliases.check @@ -1,2 +1,2 @@ -Block(List(Import(Select(Select(Ident(scala), scala.reflect), scala.reflect.runtime), List(ImportSelector(newTermName("universe"), , newTermName("ru"), )))), Select(Select(Select(Select(Ident(scala), scala.reflect), scala.reflect.runtime), scala.reflect.runtime.package), [newTermName("universe") aka newTermName("ru")])) -Block(List(Import(Select(Select(Ident(scala#), scala.reflect#), scala.reflect.runtime#), List(ImportSelector(newTermName("universe"), , newTermName("ru"), )))), Select(Select(Select(Select(Ident(scala#), scala.reflect#), scala.reflect.runtime#), scala.reflect.runtime.package#), [newTermName("universe")# aka newTermName("ru")])) +Block(List(Import(Select(Select(Ident(scala), scala.reflect), scala.reflect.runtime), List(ImportSelector(TermName("universe"), , TermName("ru"), )))), Select(Select(Select(Select(Ident(scala), scala.reflect), scala.reflect.runtime), scala.reflect.runtime.package), [TermName("universe") aka TermName("ru")])) +Block(List(Import(Select(Select(Ident(scala#), scala.reflect#), scala.reflect.runtime#), List(ImportSelector(TermName("universe"), , TermName("ru"), )))), Select(Select(Select(Select(Ident(scala#), scala.reflect#), scala.reflect.runtime#), scala.reflect.runtime.package#), [TermName("universe")# aka TermName("ru")])) diff --git a/test/files/run/showraw_mods.check b/test/files/run/showraw_mods.check index 7fca027614..3ec868542d 100644 --- a/test/files/run/showraw_mods.check +++ b/test/files/run/showraw_mods.check @@ -1 +1 @@ -Block(List(ClassDef(Modifiers(ABSTRACT | DEFAULTPARAM/TRAIT), newTypeName("C"), List(), Template(List(Ident(newTypeName("AnyRef"))), emptyValDef, List(DefDef(Modifiers(), newTermName("$init$"), List(), List(List()), TypeTree(), Block(List(), Literal(Constant(())))), ValDef(Modifiers(PRIVATE | LOCAL), newTermName("x"), TypeTree(), Literal(Constant(2))), ValDef(Modifiers(MUTABLE), newTermName("y"), TypeTree(), Select(This(newTypeName("C")), newTermName("x"))), ValDef(Modifiers(LAZY), newTermName("z"), TypeTree(), Select(This(newTypeName("C")), newTermName("y"))))))), Literal(Constant(()))) +Block(List(ClassDef(Modifiers(ABSTRACT | DEFAULTPARAM/TRAIT), TypeName("C"), List(), Template(List(Ident(TypeName("AnyRef"))), emptyValDef, List(DefDef(Modifiers(), TermName("$init$"), List(), List(List()), TypeTree(), Block(List(), Literal(Constant(())))), ValDef(Modifiers(PRIVATE | LOCAL), TermName("x"), TypeTree(), Literal(Constant(2))), ValDef(Modifiers(MUTABLE), TermName("y"), TypeTree(), Select(This(TypeName("C")), TermName("x"))), ValDef(Modifiers(LAZY), TermName("z"), TypeTree(), Select(This(TypeName("C")), TermName("y"))))))), Literal(Constant(()))) diff --git a/test/files/run/showraw_tree.check b/test/files/run/showraw_tree.check index dca272684e..0416b12568 100644 --- a/test/files/run/showraw_tree.check +++ b/test/files/run/showraw_tree.check @@ -1,2 +1,2 @@ -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap), List(Ident(newTypeName("String")), Ident(newTypeName("String"))))), nme.CONSTRUCTOR), List()) -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap), List(Ident(newTypeName("String")), Ident(newTypeName("String"))))), nme.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap), List(Ident(TypeName("String")), Ident(TypeName("String"))))), nme.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap), List(Ident(TypeName("String")), Ident(TypeName("String"))))), nme.CONSTRUCTOR), List()) diff --git a/test/files/run/showraw_tree_ids.check b/test/files/run/showraw_tree_ids.check index d25599c7fc..6e17bf2fb4 100644 --- a/test/files/run/showraw_tree_ids.check +++ b/test/files/run/showraw_tree_ids.check @@ -1,2 +1,2 @@ -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap#), List(Ident(newTypeName("String")#), Ident(newTypeName("String")#)))), nme.CONSTRUCTOR), List()) -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap#), List(Ident(newTypeName("String")#), Ident(newTypeName("String")#)))), nme.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap#), List(Ident(TypeName("String")#), Ident(TypeName("String")#)))), nme.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap#), List(Ident(TypeName("String")#), Ident(TypeName("String")#)))), nme.CONSTRUCTOR), List()) diff --git a/test/files/run/showraw_tree_kinds.check b/test/files/run/showraw_tree_kinds.check index d0d4cd0058..16147a64f4 100644 --- a/test/files/run/showraw_tree_kinds.check +++ b/test/files/run/showraw_tree_kinds.check @@ -1,2 +1,2 @@ -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap#CLS), List(Ident(newTypeName("String")#TPE), Ident(newTypeName("String")#TPE)))), nme.CONSTRUCTOR), List()) -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap#CLS), List(Ident(newTypeName("String")#TPE), Ident(newTypeName("String")#TPE)))), nme.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap#CLS), List(Ident(TypeName("String")#TPE), Ident(TypeName("String")#TPE)))), nme.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap#CLS), List(Ident(TypeName("String")#TPE), Ident(TypeName("String")#TPE)))), nme.CONSTRUCTOR), List()) diff --git a/test/files/run/showraw_tree_types_ids.check b/test/files/run/showraw_tree_types_ids.check index 92ee45a1e6..c98b16e956 100644 --- a/test/files/run/showraw_tree_types_ids.check +++ b/test/files/run/showraw_tree_types_ids.check @@ -1,10 +1,10 @@ -Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap#), List(TypeTree[4]().setOriginal(Ident[4](newTypeName("String")#)), TypeTree[4]().setOriginal(Ident[4](newTypeName("String")#)))))), nme.CONSTRUCTOR#), List()) -[1] TypeRef(ThisType(scala.collection.immutable#), scala.collection.immutable.HashMap#, List(TypeRef(ThisType(scala.Predef#), newTypeName("String")#, List()), TypeRef(ThisType(scala.Predef#), newTypeName("String")#, List()))) -[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable#), scala.collection.immutable.HashMap#, List(TypeRef(ThisType(scala.Predef#), newTypeName("String")#, List()), TypeRef(ThisType(scala.Predef#), newTypeName("String")#, List())))) +Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap#), List(TypeTree[4]().setOriginal(Ident[4](TypeName("String")#)), TypeTree[4]().setOriginal(Ident[4](TypeName("String")#)))))), nme.CONSTRUCTOR#), List()) +[1] TypeRef(ThisType(scala.collection.immutable#), scala.collection.immutable.HashMap#, List(TypeRef(ThisType(scala.Predef#), TypeName("String")#, List()), TypeRef(ThisType(scala.Predef#), TypeName("String")#, List()))) +[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable#), scala.collection.immutable.HashMap#, List(TypeRef(ThisType(scala.Predef#), TypeName("String")#, List()), TypeRef(ThisType(scala.Predef#), TypeName("String")#, List())))) [3] TypeRef(ThisType(scala.collection.immutable#), scala.collection.immutable.HashMap#, List()) -[4] TypeRef(ThisType(scala.Predef#), newTypeName("String")#, List()) -Apply[5](Select[6](New[5](TypeTree[5]().setOriginal(AppliedTypeTree(Ident[7](scala.collection.mutable.HashMap#), List(TypeTree[4]().setOriginal(Ident[4](newTypeName("String")#)), TypeTree[4]().setOriginal(Ident[4](newTypeName("String")#)))))), nme.CONSTRUCTOR#), List()) -[4] TypeRef(ThisType(scala.Predef#), newTypeName("String")#, List()) -[5] TypeRef(ThisType(scala.collection.mutable#), scala.collection.mutable.HashMap#, List(TypeRef(ThisType(scala.Predef#), newTypeName("String")#, List()), TypeRef(ThisType(scala.Predef#), newTypeName("String")#, List()))) -[6] MethodType(List(), TypeRef(ThisType(scala.collection.mutable#), scala.collection.mutable.HashMap#, List(TypeRef(ThisType(scala.Predef#), newTypeName("String")#, List()), TypeRef(ThisType(scala.Predef#), newTypeName("String")#, List())))) +[4] TypeRef(ThisType(scala.Predef#), TypeName("String")#, List()) +Apply[5](Select[6](New[5](TypeTree[5]().setOriginal(AppliedTypeTree(Ident[7](scala.collection.mutable.HashMap#), List(TypeTree[4]().setOriginal(Ident[4](TypeName("String")#)), TypeTree[4]().setOriginal(Ident[4](TypeName("String")#)))))), nme.CONSTRUCTOR#), List()) +[4] TypeRef(ThisType(scala.Predef#), TypeName("String")#, List()) +[5] TypeRef(ThisType(scala.collection.mutable#), scala.collection.mutable.HashMap#, List(TypeRef(ThisType(scala.Predef#), TypeName("String")#, List()), TypeRef(ThisType(scala.Predef#), TypeName("String")#, List()))) +[6] MethodType(List(), TypeRef(ThisType(scala.collection.mutable#), scala.collection.mutable.HashMap#, List(TypeRef(ThisType(scala.Predef#), TypeName("String")#, List()), TypeRef(ThisType(scala.Predef#), TypeName("String")#, List())))) [7] TypeRef(ThisType(scala.collection.mutable#), scala.collection.mutable.HashMap#, List()) diff --git a/test/files/run/showraw_tree_types_typed.check b/test/files/run/showraw_tree_types_typed.check index c6c20409dc..30dda7d18b 100644 --- a/test/files/run/showraw_tree_types_typed.check +++ b/test/files/run/showraw_tree_types_typed.check @@ -1,10 +1,10 @@ -Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap), List(TypeTree[4]().setOriginal(Ident[4](newTypeName("String"))), TypeTree[4]().setOriginal(Ident[4](newTypeName("String"))))))), nme.CONSTRUCTOR), List()) -[1] TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List(TypeRef(ThisType(scala.Predef), newTypeName("String"), List()), TypeRef(ThisType(scala.Predef), newTypeName("String"), List()))) -[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List(TypeRef(ThisType(scala.Predef), newTypeName("String"), List()), TypeRef(ThisType(scala.Predef), newTypeName("String"), List())))) +Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap), List(TypeTree[4]().setOriginal(Ident[4](TypeName("String"))), TypeTree[4]().setOriginal(Ident[4](TypeName("String"))))))), nme.CONSTRUCTOR), List()) +[1] TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List(TypeRef(ThisType(scala.Predef), TypeName("String"), List()), TypeRef(ThisType(scala.Predef), TypeName("String"), List()))) +[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List(TypeRef(ThisType(scala.Predef), TypeName("String"), List()), TypeRef(ThisType(scala.Predef), TypeName("String"), List())))) [3] TypeRef(ThisType(scala.collection.immutable), scala.collection.immutable.HashMap, List()) -[4] TypeRef(ThisType(scala.Predef), newTypeName("String"), List()) -Apply[5](Select[6](New[5](TypeTree[5]().setOriginal(AppliedTypeTree(Ident[7](scala.collection.mutable.HashMap), List(TypeTree[4]().setOriginal(Ident[4](newTypeName("String"))), TypeTree[4]().setOriginal(Ident[4](newTypeName("String"))))))), nme.CONSTRUCTOR), List()) -[4] TypeRef(ThisType(scala.Predef), newTypeName("String"), List()) -[5] TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List(TypeRef(ThisType(scala.Predef), newTypeName("String"), List()), TypeRef(ThisType(scala.Predef), newTypeName("String"), List()))) -[6] MethodType(List(), TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List(TypeRef(ThisType(scala.Predef), newTypeName("String"), List()), TypeRef(ThisType(scala.Predef), newTypeName("String"), List())))) +[4] TypeRef(ThisType(scala.Predef), TypeName("String"), List()) +Apply[5](Select[6](New[5](TypeTree[5]().setOriginal(AppliedTypeTree(Ident[7](scala.collection.mutable.HashMap), List(TypeTree[4]().setOriginal(Ident[4](TypeName("String"))), TypeTree[4]().setOriginal(Ident[4](TypeName("String"))))))), nme.CONSTRUCTOR), List()) +[4] TypeRef(ThisType(scala.Predef), TypeName("String"), List()) +[5] TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List(TypeRef(ThisType(scala.Predef), TypeName("String"), List()), TypeRef(ThisType(scala.Predef), TypeName("String"), List()))) +[6] MethodType(List(), TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List(TypeRef(ThisType(scala.Predef), TypeName("String"), List()), TypeRef(ThisType(scala.Predef), TypeName("String"), List())))) [7] TypeRef(ThisType(scala.collection.mutable), scala.collection.mutable.HashMap, List()) diff --git a/test/files/run/showraw_tree_types_untyped.check b/test/files/run/showraw_tree_types_untyped.check index dca272684e..0416b12568 100644 --- a/test/files/run/showraw_tree_types_untyped.check +++ b/test/files/run/showraw_tree_types_untyped.check @@ -1,2 +1,2 @@ -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap), List(Ident(newTypeName("String")), Ident(newTypeName("String"))))), nme.CONSTRUCTOR), List()) -Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap), List(Ident(newTypeName("String")), Ident(newTypeName("String"))))), nme.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.immutable.HashMap), List(Ident(TypeName("String")), Ident(TypeName("String"))))), nme.CONSTRUCTOR), List()) +Apply(Select(New(AppliedTypeTree(Ident(scala.collection.mutable.HashMap), List(Ident(TypeName("String")), Ident(TypeName("String"))))), nme.CONSTRUCTOR), List()) diff --git a/test/files/run/showraw_tree_ultimate.check b/test/files/run/showraw_tree_ultimate.check index 46ccd4df8f..991ecc5410 100644 --- a/test/files/run/showraw_tree_ultimate.check +++ b/test/files/run/showraw_tree_ultimate.check @@ -1,10 +1,10 @@ -Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap##CLS), List(TypeTree[4]().setOriginal(Ident[4](newTypeName("String")##TPE)), TypeTree[4]().setOriginal(Ident[4](newTypeName("String")##TPE)))))), nme.CONSTRUCTOR##PCTOR), List()) -[1] TypeRef(ThisType(scala.collection.immutable##PK), scala.collection.immutable.HashMap##CLS, List(TypeRef(ThisType(scala.Predef##MODC), newTypeName("String")##TPE, List()), TypeRef(ThisType(scala.Predef##MODC), newTypeName("String")##TPE, List()))) -[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable##PK), scala.collection.immutable.HashMap##CLS, List(TypeRef(ThisType(scala.Predef##MODC), newTypeName("String")##TPE, List()), TypeRef(ThisType(scala.Predef##MODC), newTypeName("String")##TPE, List())))) +Apply[1](Select[2](New[1](TypeTree[1]().setOriginal(AppliedTypeTree(Ident[3](scala.collection.immutable.HashMap##CLS), List(TypeTree[4]().setOriginal(Ident[4](TypeName("String")##TPE)), TypeTree[4]().setOriginal(Ident[4](TypeName("String")##TPE)))))), nme.CONSTRUCTOR##PCTOR), List()) +[1] TypeRef(ThisType(scala.collection.immutable##PK), scala.collection.immutable.HashMap##CLS, List(TypeRef(ThisType(scala.Predef##MODC), TypeName("String")##TPE, List()), TypeRef(ThisType(scala.Predef##MODC), TypeName("String")##TPE, List()))) +[2] MethodType(List(), TypeRef(ThisType(scala.collection.immutable##PK), scala.collection.immutable.HashMap##CLS, List(TypeRef(ThisType(scala.Predef##MODC), TypeName("String")##TPE, List()), TypeRef(ThisType(scala.Predef##MODC), TypeName("String")##TPE, List())))) [3] TypeRef(ThisType(scala.collection.immutable##PK), scala.collection.immutable.HashMap##CLS, List()) -[4] TypeRef(ThisType(scala.Predef##MODC), newTypeName("String")##TPE, List()) -Apply[5](Select[6](New[5](TypeTree[5]().setOriginal(AppliedTypeTree(Ident[7](scala.collection.mutable.HashMap##CLS), List(TypeTree[4]().setOriginal(Ident[4](newTypeName("String")##TPE)), TypeTree[4]().setOriginal(Ident[4](newTypeName("String")##TPE)))))), nme.CONSTRUCTOR##CTOR), List()) -[4] TypeRef(ThisType(scala.Predef##MODC), newTypeName("String")##TPE, List()) -[5] TypeRef(ThisType(scala.collection.mutable##PK), scala.collection.mutable.HashMap##CLS, List(TypeRef(ThisType(scala.Predef##MODC), newTypeName("String")##TPE, List()), TypeRef(ThisType(scala.Predef##MODC), newTypeName("String")##TPE, List()))) -[6] MethodType(List(), TypeRef(ThisType(scala.collection.mutable##PK), scala.collection.mutable.HashMap##CLS, List(TypeRef(ThisType(scala.Predef##MODC), newTypeName("String")##TPE, List()), TypeRef(ThisType(scala.Predef##MODC), newTypeName("String")##TPE, List())))) +[4] TypeRef(ThisType(scala.Predef##MODC), TypeName("String")##TPE, List()) +Apply[5](Select[6](New[5](TypeTree[5]().setOriginal(AppliedTypeTree(Ident[7](scala.collection.mutable.HashMap##CLS), List(TypeTree[4]().setOriginal(Ident[4](TypeName("String")##TPE)), TypeTree[4]().setOriginal(Ident[4](TypeName("String")##TPE)))))), nme.CONSTRUCTOR##CTOR), List()) +[4] TypeRef(ThisType(scala.Predef##MODC), TypeName("String")##TPE, List()) +[5] TypeRef(ThisType(scala.collection.mutable##PK), scala.collection.mutable.HashMap##CLS, List(TypeRef(ThisType(scala.Predef##MODC), TypeName("String")##TPE, List()), TypeRef(ThisType(scala.Predef##MODC), TypeName("String")##TPE, List()))) +[6] MethodType(List(), TypeRef(ThisType(scala.collection.mutable##PK), scala.collection.mutable.HashMap##CLS, List(TypeRef(ThisType(scala.Predef##MODC), TypeName("String")##TPE, List()), TypeRef(ThisType(scala.Predef##MODC), TypeName("String")##TPE, List())))) [7] TypeRef(ThisType(scala.collection.mutable##PK), scala.collection.mutable.HashMap##CLS, List()) diff --git a/test/files/run/t5418b.check b/test/files/run/t5418b.check index 48d82a2aae..f036a4be84 100644 --- a/test/files/run/t5418b.check +++ b/test/files/run/t5418b.check @@ -1,2 +1,2 @@ new Object().getClass() -TypeRef(ThisType(java.lang), java.lang.Class, List(TypeRef(NoPrefix, newTypeName("?0"), List()))) +TypeRef(ThisType(java.lang), java.lang.Class, List(TypeRef(NoPrefix, TypeName("?0"), List()))) diff --git a/test/files/run/t6178.scala b/test/files/run/t6178.scala index 0b4cf0bbf5..41e148af91 100644 --- a/test/files/run/t6178.scala +++ b/test/files/run/t6178.scala @@ -2,6 +2,6 @@ import scala.reflect.runtime.universe._ import scala.reflect.runtime.{currentMirror => cm} object Test extends App { - val plus = typeOf[java.lang.String].member(newTermName("$plus")).asMethod + val plus = typeOf[java.lang.String].member(TermName("$plus")).asMethod println(cm.reflect("").reflectMethod(plus).apply("2")) } \ No newline at end of file diff --git a/test/files/run/t6181.scala b/test/files/run/t6181.scala index fb23eaff63..eaa7340178 100644 --- a/test/files/run/t6181.scala +++ b/test/files/run/t6181.scala @@ -3,6 +3,6 @@ import scala.reflect.runtime.{currentMirror => cm} object Test extends App { class C { def test(x: => Int) = println(x) } - val mm = cm.reflect(new C).reflectMethod(typeOf[C].member(newTermName("test")).asMethod) + val mm = cm.reflect(new C).reflectMethod(typeOf[C].member(TermName("test")).asMethod) mm(2) } \ No newline at end of file diff --git a/test/files/run/t6199-mirror.scala b/test/files/run/t6199-mirror.scala index 772a384542..3fda56bf7c 100644 --- a/test/files/run/t6199-mirror.scala +++ b/test/files/run/t6199-mirror.scala @@ -3,5 +3,5 @@ import scala.reflect.runtime.{currentMirror => cm} object Test extends App { class C { def foo = () } - println(cm.reflect(new C).reflectMethod(typeOf[C].member(newTermName("foo")).asMethod)()) + println(cm.reflect(new C).reflectMethod(typeOf[C].member(TermName("foo")).asMethod)()) } \ No newline at end of file diff --git a/test/files/run/t6392b.check b/test/files/run/t6392b.check index e9c7ecaa34..2afc48495f 100644 --- a/test/files/run/t6392b.check +++ b/test/files/run/t6392b.check @@ -1 +1 @@ -ModuleDef(Modifiers(), newTermName("C"), Template(List(Select(Ident(scala#PK), newTypeName("AnyRef")#TPE)), emptyValDef, List(DefDef(Modifiers(), nme.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(newTypeName("C")), tpnme.EMPTY), nme.CONSTRUCTOR#PCTOR), List())), Literal(Constant(()))))))) +ModuleDef(Modifiers(), TermName("C"), Template(List(Select(Ident(scala#PK), TypeName("AnyRef")#TPE)), emptyValDef, List(DefDef(Modifiers(), nme.CONSTRUCTOR, List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(TypeName("C")), tpnme.EMPTY), nme.CONSTRUCTOR#PCTOR), List())), Literal(Constant(()))))))) diff --git a/test/files/run/toolbox_typecheck_implicitsdisabled.scala b/test/files/run/toolbox_typecheck_implicitsdisabled.scala index 8a3d433142..95a7056279 100644 --- a/test/files/run/toolbox_typecheck_implicitsdisabled.scala +++ b/test/files/run/toolbox_typecheck_implicitsdisabled.scala @@ -7,16 +7,16 @@ object Test extends App { val toolbox = cm.mkToolBox() val tree1 = Block(List( - Import(Select(Ident(newTermName("scala")), newTermName("Predef")), List(ImportSelector(nme.WILDCARD, -1, null, -1)))), - Apply(Select(Literal(Constant(1)), newTermName("$minus$greater")), List(Literal(Constant(2)))) + Import(Select(Ident(TermName("scala")), TermName("Predef")), List(ImportSelector(nme.WILDCARD, -1, null, -1)))), + Apply(Select(Literal(Constant(1)), TermName("$minus$greater")), List(Literal(Constant(2)))) ) val ttree1 = toolbox.typeCheck(tree1, withImplicitViewsDisabled = false) println(ttree1) try { val tree2 = Block(List( - Import(Select(Ident(newTermName("scala")), newTermName("Predef")), List(ImportSelector(nme.WILDCARD, -1, null, -1)))), - Apply(Select(Literal(Constant(1)), newTermName("$minus$greater")), List(Literal(Constant(2)))) + Import(Select(Ident(TermName("scala")), TermName("Predef")), List(ImportSelector(nme.WILDCARD, -1, null, -1)))), + Apply(Select(Literal(Constant(1)), TermName("$minus$greater")), List(Literal(Constant(2)))) ) val ttree2 = toolbox.typeCheck(tree2, withImplicitViewsDisabled = true) println(ttree2) diff --git a/test/files/run/toolbox_typecheck_macrosdisabled.scala b/test/files/run/toolbox_typecheck_macrosdisabled.scala index 51eb63f294..1f7fda8575 100644 --- a/test/files/run/toolbox_typecheck_macrosdisabled.scala +++ b/test/files/run/toolbox_typecheck_macrosdisabled.scala @@ -15,11 +15,11 @@ object Test extends App { val ru = build.newFreeTerm("ru", scala.reflect.runtime.universe) build.setTypeSignature(ru, rutpe) - val tree1 = Apply(Select(Ident(ru), newTermName("reify")), List(Literal(Constant(2)))) + val tree1 = Apply(Select(Ident(ru), TermName("reify")), List(Literal(Constant(2)))) val ttree1 = toolbox.typeCheck(tree1, withMacrosDisabled = false) println(ttree1) - val tree2 = Apply(Select(Ident(ru), newTermName("reify")), List(Literal(Constant(2)))) + val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Literal(Constant(2)))) val ttree2 = toolbox.typeCheck(tree2, withMacrosDisabled = true) println(ttree2) } diff --git a/test/files/run/toolbox_typecheck_macrosdisabled2.check b/test/files/run/toolbox_typecheck_macrosdisabled2.check index f5c9b6eeab..74dfb03666 100644 --- a/test/files/run/toolbox_typecheck_macrosdisabled2.check +++ b/test/files/run/toolbox_typecheck_macrosdisabled2.check @@ -19,7 +19,7 @@ def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = { val $u: U = $m$untyped.universe; val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror]; - $u.Apply.apply($u.Select.apply($u.Select.apply($u.build.Ident($m.staticPackage("scala")), $u.newTermName("Array")), $u.newTermName("apply")), scala.collection.immutable.List.apply[$u.Literal]($u.Literal.apply($u.Constant.apply(2)))) + $u.Apply.apply($u.Select.apply($u.Select.apply($u.build.Ident($m.staticPackage("scala")), $u.TermName.apply("Array")), $u.TermName.apply("apply")), scala.collection.immutable.List.apply[$u.Literal]($u.Literal.apply($u.Constant.apply(2)))) } }; new $treecreator1() diff --git a/test/files/run/toolbox_typecheck_macrosdisabled2.scala b/test/files/run/toolbox_typecheck_macrosdisabled2.scala index 74fd09d9fd..7bfe3ba8a4 100644 --- a/test/files/run/toolbox_typecheck_macrosdisabled2.scala +++ b/test/files/run/toolbox_typecheck_macrosdisabled2.scala @@ -15,11 +15,11 @@ object Test extends App { val ru = build.newFreeTerm("ru", scala.reflect.runtime.universe) build.setTypeSignature(ru, rutpe) - val tree1 = Apply(Select(Ident(ru), newTermName("reify")), List(Apply(Select(Ident(newTermName("scala")), newTermName("Array")), List(Literal(Constant(2)))))) + val tree1 = Apply(Select(Ident(ru), TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) val ttree1 = toolbox.typeCheck(tree1, withMacrosDisabled = false) println(ttree1) - val tree2 = Apply(Select(Ident(ru), newTermName("reify")), List(Apply(Select(Ident(newTermName("scala")), newTermName("Array")), List(Literal(Constant(2)))))) + val tree2 = Apply(Select(Ident(ru), TermName("reify")), List(Apply(Select(Ident(TermName("scala")), TermName("Array")), List(Literal(Constant(2)))))) val ttree2 = toolbox.typeCheck(tree2, withMacrosDisabled = true) println(ttree2) } diff --git a/test/osgi/src/BasicReflection.scala b/test/osgi/src/BasicReflection.scala index 8a0a05d531..68fedb7c83 100644 --- a/test/osgi/src/BasicReflection.scala +++ b/test/osgi/src/BasicReflection.scala @@ -1,10 +1,10 @@ package tools.test.osgi package reflection package basic - + import org.junit.Assert._ import org.ops4j.pax.exam.CoreOptions._ - + import org.junit.Test import org.junit.runner.RunWith import org.ops4j.pax.exam @@ -41,15 +41,15 @@ object M class BasicReflectionTest extends ScalaOsgiHelper { @Configuration - def config(): Array[exam.Option] = + def config(): Array[exam.Option] = justReflectionOptions // Ensure Pax-exam requires C/M in our module def dummy = { new C - M.toString + M.toString } - + @Test def basicMirrorThroughOsgi(): Unit = { // Note for now just assert that we can do this stuff. @@ -57,10 +57,10 @@ class BasicReflectionTest extends ScalaOsgiHelper { val cm = runtimeMirror(classOf[C].getClassLoader) val im = cm.reflect(new C) assertEquals("Unable to reflect field name!", - "value f1", - im.reflectField(typeOf[C].member(newTermName("f1")).asTerm).symbol.toString) + "value f1", + im.reflectField(typeOf[C].member(TermName("f1")).asTerm).symbol.toString) assertEquals("Unable to reflect value!", - 2, - im.reflectField(typeOf[C].member(newTermName("f1")).asTerm).get) + 2, + im.reflectField(typeOf[C].member(TermName("f1")).asTerm).get) } } diff --git a/test/pending/run/hk-lub-fail.scala b/test/pending/run/hk-lub-fail.scala index b58a86ee75..0ac4fdd841 100644 --- a/test/pending/run/hk-lub-fail.scala +++ b/test/pending/run/hk-lub-fail.scala @@ -25,12 +25,12 @@ object Test { // A repl session to get you started. /* - val quux1 = EmptyPackageClass.tpe.member(newTermName("Quux1")) - val quux2 = EmptyPackageClass.tpe.member(newTermName("Quux2")) + val quux1 = EmptyPackageClass.tpe.member(TermName("Quux1")) + val quux2 = EmptyPackageClass.tpe.member(TermName("Quux2")) val tps = List(quux1, quux2) map (_.tpe) - val test = EmptyPackageClass.tpe.member(newTermName("Test")) - val f = test.tpe.member(newTypeName("F")).tpe - + val test = EmptyPackageClass.tpe.member(TermName("Test")) + val f = test.tpe.member(TypeName("F")).tpe + val fn = f.normalize.asInstanceOf[ExistentialType] val fn2 = fn.underlying.asInstanceOf[TypeRef] */ diff --git a/test/pending/run/macro-expand-default/Impls_1.scala b/test/pending/run/macro-expand-default/Impls_1.scala index 7cf8d59c75..bb55f02ab2 100644 --- a/test/pending/run/macro-expand-default/Impls_1.scala +++ b/test/pending/run/macro-expand-default/Impls_1.scala @@ -3,8 +3,8 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = { import c.universe._ - val sum = Apply(Select(x.tree, newTermName("$minus")), List(y.tree)) - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(sum)) + val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree)) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum)) Expr[Unit](body) } } \ No newline at end of file diff --git a/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala b/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala index be00fd0d8a..eed68280cd 100644 --- a/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala +++ b/test/pending/run/macro-expand-macro-has-context-bound/Impls_1.scala @@ -3,8 +3,8 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo[U](c: Ctx)(x: c.Expr[U])(evidence: c.Expr[Numeric[U]]) = { import c.universe._ - val plusOne = Apply(Select(evidence.tree, newTermName("plus")), List(x.tree, Literal(Constant(1)))) - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(plusOne)) + val plusOne = Apply(Select(evidence.tree, TermName("plus")), List(x.tree, Literal(Constant(1)))) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(plusOne)) Expr[Unit](body) } } \ No newline at end of file diff --git a/test/pending/run/macro-expand-named/Impls_1.scala b/test/pending/run/macro-expand-named/Impls_1.scala index 7cf8d59c75..bb55f02ab2 100644 --- a/test/pending/run/macro-expand-named/Impls_1.scala +++ b/test/pending/run/macro-expand-named/Impls_1.scala @@ -3,8 +3,8 @@ import scala.reflect.macros.{Context => Ctx} object Impls { def foo(c: Ctx)(x: c.Expr[Int], y: c.Expr[Int]) = { import c.universe._ - val sum = Apply(Select(x.tree, newTermName("$minus")), List(y.tree)) - val body = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(sum)) + val sum = Apply(Select(x.tree, TermName("$minus")), List(y.tree)) + val body = Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(sum)) Expr[Unit](body) } } \ No newline at end of file diff --git a/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala b/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala index 26de70cc12..487ac79673 100644 --- a/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala +++ b/test/pending/run/macro-expand-tparams-prefix-e1/Impls_1.scala @@ -4,9 +4,9 @@ object Impls { def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { import c.universe._ Block(List( - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(V.toString))))), Literal(Constant(()))) } } \ No newline at end of file diff --git a/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala b/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala index 26de70cc12..487ac79673 100644 --- a/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala +++ b/test/pending/run/macro-expand-tparams-prefix-f1/Impls_1.scala @@ -4,9 +4,9 @@ object Impls { def foo[T, U: c.WeakTypeTag, V](c: Ctx)(implicit T: c.WeakTypeTag[T], V: c.WeakTypeTag[V]): c.Expr[Unit] = { import c.universe._ Block(List( - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(T.toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), - Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant(V.toString))))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(T.toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(implicitly[c.WeakTypeTag[U]].toString)))), + Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Literal(Constant(V.toString))))), Literal(Constant(()))) } } \ No newline at end of file diff --git a/test/pending/run/macro-reify-tagless-b/Test_2.scala b/test/pending/run/macro-reify-tagless-b/Test_2.scala index 10487b1515..09ca6ba30e 100644 --- a/test/pending/run/macro-reify-tagless-b/Test_2.scala +++ b/test/pending/run/macro-reify-tagless-b/Test_2.scala @@ -6,8 +6,8 @@ object Test extends App { import scala.reflect.runtime.{currentMirror => cm} import scala.tools.reflect.ToolBox val tpt = AppliedTypeTree(Ident(definitions.ListClass), List(Ident(definitions.StringClass))) - val rhs = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant("hello world")))) - val list = ValDef(NoMods, newTermName("list"), tpt, rhs) - val tree = Block(list, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Ident(list.name)))) + val rhs = Apply(Select(Ident(TermName("Macros")), TermName("foo")), List(Literal(Constant("hello world")))) + val list = ValDef(NoMods, TermName("list"), tpt, rhs) + val tree = Block(list, Apply(Select(Ident(definitions.PredefModule), TermName("println")), List(Ident(list.name)))) println(cm.mkToolBox().eval(tree)) } diff --git a/test/pending/run/t5427a.scala b/test/pending/run/t5427a.scala index f7cd05158d..a7d20922db 100644 --- a/test/pending/run/t5427a.scala +++ b/test/pending/run/t5427a.scala @@ -4,7 +4,7 @@ object Foo { val bar = 2 } object Test extends App { val tpe = getType(Foo) - val bar = tpe.nonPrivateMember(newTermName("bar")) + val bar = tpe.nonPrivateMember(TermName("bar")) val value = getValue(Foo, bar) println(value) } \ No newline at end of file diff --git a/test/pending/run/t5427b.scala b/test/pending/run/t5427b.scala index e80bd12369..af1ae6ea2f 100644 --- a/test/pending/run/t5427b.scala +++ b/test/pending/run/t5427b.scala @@ -5,7 +5,7 @@ class Foo { val bar = 2 } object Test extends App { val foo = new Foo val tpe = getType(foo) - val bar = tpe.nonPrivateMember(newTermName("bar")) + val bar = tpe.nonPrivateMember(TermName("bar")) val value = getValue(foo, bar) println(value) } \ No newline at end of file diff --git a/test/pending/run/t5427c.scala b/test/pending/run/t5427c.scala index 7095158e85..ba71803080 100644 --- a/test/pending/run/t5427c.scala +++ b/test/pending/run/t5427c.scala @@ -5,7 +5,7 @@ class Foo(bar: Int) object Test extends App { val foo = new Foo(2) val tpe = getType(foo) - val bar = tpe.nonPrivateMember(newTermName("bar")) + val bar = tpe.nonPrivateMember(TermName("bar")) bar match { case NoSymbol => println("no public member") case _ => println("i'm screwed") diff --git a/test/pending/run/t5427d.scala b/test/pending/run/t5427d.scala index f0cc07d27e..1d37dbdde3 100644 --- a/test/pending/run/t5427d.scala +++ b/test/pending/run/t5427d.scala @@ -5,7 +5,7 @@ class Foo(val bar: Int) object Test extends App { val foo = new Foo(2) val tpe = getType(foo) - val bar = tpe.nonPrivateMember(newTermName("bar")) + val bar = tpe.nonPrivateMember(TermName("bar")) val value = getValue(foo, bar) println(value) } \ No newline at end of file -- cgit v1.2.3 From 56ef2b330dfb3381fe2f6e717b959f1757ce69bb Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Sat, 29 Dec 2012 10:32:08 +0100 Subject: cleans up usages of --- src/library/scala/reflect/NameTransformer.scala | 2 +- test/files/run/reflection-enclosed-basic.scala | 2 +- test/files/run/reflection-enclosed-inner-basic.scala | 2 +- test/files/run/reflection-enclosed-inner-inner-basic.scala | 2 +- test/files/run/reflection-enclosed-inner-nested-basic.scala | 2 +- test/files/run/reflection-enclosed-nested-basic.scala | 2 +- test/files/run/reflection-enclosed-nested-inner-basic.scala | 2 +- test/files/run/reflection-enclosed-nested-nested-basic.scala | 2 +- test/files/run/reflection-magicsymbols-invoke.scala | 2 +- test/files/run/reflection-sanitychecks.scala | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) (limited to 'test/files') diff --git a/src/library/scala/reflect/NameTransformer.scala b/src/library/scala/reflect/NameTransformer.scala index 384ebc6134..0beb840bed 100755 --- a/src/library/scala/reflect/NameTransformer.scala +++ b/src/library/scala/reflect/NameTransformer.scala @@ -93,7 +93,7 @@ object NameTransformer { */ def decode(name0: String): String = { //System.out.println("decode: " + name);//DEBUG - val name = if (name0.endsWith("")) name0.substring(0, name0.length() - ("").length()) + "this" + val name = if (name0.endsWith("")) name0.stripSuffix("") + "this" else name0; var buf: StringBuilder = null val len = name.length() diff --git a/test/files/run/reflection-enclosed-basic.scala b/test/files/run/reflection-enclosed-basic.scala index 39e327cff6..7b9e0c20dc 100644 --- a/test/files/run/reflection-enclosed-basic.scala +++ b/test/files/run/reflection-enclosed-basic.scala @@ -20,7 +20,7 @@ object Test extends App { def testNestedClass(name: String) = { val sym = cm.staticClass(name) println(sym) - val ctor = sym.typeSignature.declaration(TermName("")).asMethod + val ctor = sym.typeSignature.declaration(nme.CONSTRUCTOR).asMethod val ctorMirror = cm.reflectClass(sym).reflectConstructor(ctor) val instance = ctorMirror() println(instance) diff --git a/test/files/run/reflection-enclosed-inner-basic.scala b/test/files/run/reflection-enclosed-inner-basic.scala index 997a67ed61..c1cf9bc336 100644 --- a/test/files/run/reflection-enclosed-inner-basic.scala +++ b/test/files/run/reflection-enclosed-inner-basic.scala @@ -26,7 +26,7 @@ object Test extends App { def testInnerClass(name: String) = { val sym = b.typeSignature.declaration(TypeName(name)).asClass println(sym) - val ctor = sym.typeSignature.declaration(TermName("")).asMethod + val ctor = sym.typeSignature.declaration(nme.CONSTRUCTOR).asMethod val ctorMirror = cm.reflect(new B).reflectClass(sym).reflectConstructor(ctor) val instance = ctorMirror() println(instance) diff --git a/test/files/run/reflection-enclosed-inner-inner-basic.scala b/test/files/run/reflection-enclosed-inner-inner-basic.scala index 704363dab9..8a73fac522 100644 --- a/test/files/run/reflection-enclosed-inner-inner-basic.scala +++ b/test/files/run/reflection-enclosed-inner-inner-basic.scala @@ -28,7 +28,7 @@ object Test extends App { def testInnerClass(name: String) = { val sym = b.typeSignature.declaration(TypeName(name)).asClass println(sym) - val ctor = sym.typeSignature.declaration(TermName("")).asMethod + val ctor = sym.typeSignature.declaration(nme.CONSTRUCTOR).asMethod val outer1 = new B val outer2 = new outer1.BB val ctorMirror = cm.reflect(outer2).reflectClass(sym).reflectConstructor(ctor) diff --git a/test/files/run/reflection-enclosed-inner-nested-basic.scala b/test/files/run/reflection-enclosed-inner-nested-basic.scala index 1e3797a9ea..6c2fc6df7a 100644 --- a/test/files/run/reflection-enclosed-inner-nested-basic.scala +++ b/test/files/run/reflection-enclosed-inner-nested-basic.scala @@ -29,7 +29,7 @@ object Test extends App { def testNestedClass(name: String) = { val sym = b.typeSignature.declaration(TypeName(name)).asClass println(sym) - val ctor = sym.typeSignature.declaration(TermName("")).asMethod + val ctor = sym.typeSignature.declaration(nme.CONSTRUCTOR).asMethod val ctorMirror = cm.reflect(outer1.BB).reflectClass(sym).reflectConstructor(ctor) val instance = ctorMirror() println(instance) diff --git a/test/files/run/reflection-enclosed-nested-basic.scala b/test/files/run/reflection-enclosed-nested-basic.scala index a629d8a2d0..180ac4ebee 100644 --- a/test/files/run/reflection-enclosed-nested-basic.scala +++ b/test/files/run/reflection-enclosed-nested-basic.scala @@ -26,7 +26,7 @@ object Test extends App { def testNestedClass(name: String) = { val sym = b.typeSignature.declaration(TypeName(name)).asClass println(sym) - val ctor = sym.typeSignature.declaration(TermName("")).asMethod + val ctor = sym.typeSignature.declaration(nme.CONSTRUCTOR).asMethod val ctorMirror = cm.reflectClass(sym).reflectConstructor(ctor) val instance = ctorMirror() println(instance) diff --git a/test/files/run/reflection-enclosed-nested-inner-basic.scala b/test/files/run/reflection-enclosed-nested-inner-basic.scala index 9c726e55d4..2558b8035a 100644 --- a/test/files/run/reflection-enclosed-nested-inner-basic.scala +++ b/test/files/run/reflection-enclosed-nested-inner-basic.scala @@ -28,7 +28,7 @@ object Test extends App { def testInnerClass(name: String) = { val sym = b.typeSignature.declaration(TypeName(name)).asClass println(sym) - val ctor = sym.typeSignature.declaration(TermName("")).asMethod + val ctor = sym.typeSignature.declaration(nme.CONSTRUCTOR).asMethod val ctorMirror = cm.reflect(new B.BB).reflectClass(sym).reflectConstructor(ctor) val instance = ctorMirror() println(instance) diff --git a/test/files/run/reflection-enclosed-nested-nested-basic.scala b/test/files/run/reflection-enclosed-nested-nested-basic.scala index 247eba120e..b4711c9a8c 100644 --- a/test/files/run/reflection-enclosed-nested-nested-basic.scala +++ b/test/files/run/reflection-enclosed-nested-nested-basic.scala @@ -28,7 +28,7 @@ object Test extends App { def testNestedClass(name: String) = { val sym = b.typeSignature.declaration(TypeName(name)).asClass println(sym) - val ctor = sym.typeSignature.declaration(TermName("")).asMethod + val ctor = sym.typeSignature.declaration(nme.CONSTRUCTOR).asMethod val ctorMirror = cm.reflectClass(sym).reflectConstructor(ctor) val instance = ctorMirror() println(instance) diff --git a/test/files/run/reflection-magicsymbols-invoke.scala b/test/files/run/reflection-magicsymbols-invoke.scala index e366495ec7..ff3992709f 100644 --- a/test/files/run/reflection-magicsymbols-invoke.scala +++ b/test/files/run/reflection-magicsymbols-invoke.scala @@ -54,7 +54,7 @@ object Test extends App { println("it's important to print the list of AnyVal's members") println("if some of them change (possibly, adding and/or removing magic symbols), we must update this test") typeOf[AnyVal].declarations.toList.sortBy(key).foreach(sym => println(key(sym))) - test(typeOf[AnyVal], null, "") + test(typeOf[AnyVal], null, nme.CONSTRUCTOR.toString) test(typeOf[AnyVal], 2, "getClass") println("============\nAnyRef") diff --git a/test/files/run/reflection-sanitychecks.scala b/test/files/run/reflection-sanitychecks.scala index 709c32c80e..6d3daff1f7 100644 --- a/test/files/run/reflection-sanitychecks.scala +++ b/test/files/run/reflection-sanitychecks.scala @@ -38,7 +38,7 @@ object Test extends App { println("method #2: " + failsafe(im.reflectMethod(tpe.member(TermName("baz")).asMethod)())) println("constructor #1: " + failsafe(cm.reflectClass(im.symbol).reflectConstructor(tpe.member(TermName("bar")).asMethod)())) println("constructor #2: " + failsafe(cm.reflectClass(im.symbol).reflectConstructor(tpe.member(TermName("")).asMethod)())) - println("class: " + failsafe(im.reflectClass(tpe.member(TypeName("C")).asClass).reflectConstructor(typeOf[C].member(TypeName("C")).asClass.typeSignature.member(TermName("")).asMethod)())) + println("class: " + failsafe(im.reflectClass(tpe.member(TypeName("C")).asClass).reflectConstructor(typeOf[C].member(TypeName("C")).asClass.typeSignature.member(nme.CONSTRUCTOR).asMethod)())) println("object: " + failsafe(im.reflectModule(tpe.member(TermName("O")).asModule).instance)) println() } -- cgit v1.2.3