Skip to content

Commit 6056f7e

Browse files
committed
SI-7624 Replace new{Term,Type}Name with {Term,Type}Name
1 parent 0459db4 commit 6056f7e

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/partest/scala/tools/partest/package.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,16 +216,16 @@ package object partest {
216216

217217
c.Expr(Block(
218218
List(Apply(
219-
Select(Ident(PredefModule), newTermName("println")),
219+
Select(Ident(PredefModule), TermName("println")),
220220
List(Apply(
221221
Select(Apply(
222-
Select(Ident(ScalaPackage), newTermName("StringContext")),
222+
Select(Ident(ScalaPackage), TermName("StringContext")),
223223
List(
224224
Literal(Constant("trace> ")),
225225
Literal(Constant("\\nres: ")),
226226
Literal(Constant(" = ")),
227227
Literal(Constant("\\n")))),
228-
newTermName("s")),
228+
TermName("s")),
229229
List(
230230
Literal(Constant(show(a.tree))),
231231
Literal(Constant(show(a.actualType))),

src/reflect/scala/reflect/api/Mirrors.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ package api
101101
* via `ModuleMirror.instance`). Entry point: `val mm = im.reflectMethod(<method symbol>)`.
102102
* Example:
103103
* {{{
104-
* scala> val methodX = typeOf[C].declaration(newTermName("x")).asMethod
104+
* scala> val methodX = typeOf[C].declaration(TermName("x")).asMethod
105105
* methodX: reflect.runtime.universe.MethodSymbol = method x
106106
*
107107
* scala> val mm = im.reflectMethod(methodX)
@@ -126,7 +126,7 @@ package api
126126
* scala> val im = m.reflect(new C)
127127
* im: reflect.runtime.universe.InstanceMirror = instance mirror for C@5f0c8ac1
128128
*
129-
* scala> val fieldX = typeOf[C].declaration(newTermName("x")).asTerm.accessed.asTerm
129+
* scala> val fieldX = typeOf[C].declaration(TermName("x")).asTerm.accessed.asTerm
130130
* fieldX: reflect.runtime.universe.TermSymbol = value x
131131
* scala> val fmX = im.reflectField(fieldX)
132132
* fmX: reflect.runtime.universe.FieldMirror = field mirror for C.x (bound to C@5f0c8ac1)
@@ -136,7 +136,7 @@ package api
136136
*
137137
* scala> fmX.set(3) // NOTE: can set an underlying value of an immutable field!
138138
*
139-
* scala> val fieldY = typeOf[C].declaration(newTermName("y")).asTerm.accessed.asTerm
139+
* scala> val fieldY = typeOf[C].declaration(TermName("y")).asTerm.accessed.asTerm
140140
* fieldY: reflect.runtime.universe.TermSymbol = variable y
141141
*
142142
* scala> val fmY = im.reflectField(fieldY)
@@ -255,7 +255,7 @@ trait Mirrors { self: Universe =>
255255
* Note also that only accessor MethodMirrors, but not FieldMirrors will accurately reflect overriding behavior.
256256
*
257257
* To get a field symbol by the name of the field you would like to reflect,
258-
* use `<this mirror>.symbol.typeSignature.member(newTermName(<name of the field>)).asTerm.accessed`.
258+
* use `<this mirror>.symbol.typeSignature.member(TermName(<name of the field>)).asTerm.accessed`.
259259
* For further information about member lookup refer to `Symbol.typeSignature`.
260260
*
261261
* The input symbol can be either private or non-private (Scala reflection transparently deals with visibility).
@@ -275,7 +275,7 @@ trait Mirrors { self: Universe =>
275275
* that can be used to invoke the method provided.
276276
*
277277
* To get a method symbol by the name of the method you would like to reflect,
278-
* use `<this mirror>.symbol.typeSignature.member(newTermName(<name of the method>)).asMethod`.
278+
* use `<this mirror>.symbol.typeSignature.member(TermName(<name of the method>)).asMethod`.
279279
* For further information about member lookup refer to `Symbol.typeSignature`.
280280
*
281281
* The input symbol can be either private or non-private (Scala reflection transparently deals with visibility).
@@ -299,7 +299,7 @@ trait Mirrors { self: Universe =>
299299
* that can be used to get the instance of the object or inspect its companion class.
300300
*
301301
* To get a module symbol by the name of the object you would like to reflect,
302-
* use `<this mirror>.symbol.typeSignature.member(newTermName(<name of the object>)).asModule`.
302+
* use `<this mirror>.symbol.typeSignature.member(TermName(<name of the object>)).asModule`.
303303
* For further information about member lookup refer to `Symbol.typeSignature`.
304304
*
305305
* The input symbol can be either private or non-private (Scala reflection transparently deals with visibility).

src/reflect/scala/reflect/api/Names.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ trait Names {
3333
* Enables an alternative notation `"map": TermName` as opposed to `newTermName("map")`.
3434
* @group Names
3535
*/
36-
implicit def stringToTermName(s: String): TermName = newTermName(s)
36+
implicit def stringToTermName(s: String): TermName = TermName(s)
3737

3838
/** An implicit conversion from String to TypeName.
3939
* Enables an alternative notation `"List": TypeName` as opposed to `newTypeName("List")`.
4040
* @group Names
4141
*/
42-
implicit def stringToTypeName(s: String): TypeName = newTypeName(s)
42+
implicit def stringToTypeName(s: String): TypeName = TypeName(s)
4343

4444
/** The abstract type of names.
4545
* @group Names

0 commit comments

Comments
 (0)