summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/reify/codegen/GenTypes.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-07-30 21:14:42 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-08-02 15:50:01 +0200
commit013acf6eb0117ca12ab2a0d0e8560df40a7392a3 (patch)
tree2f69939025e5796381327bd16f602b5be9cfcba4 /src/compiler/scala/reflect/reify/codegen/GenTypes.scala
parent367b82de04bdee24b0994e30c1464297eae16d74 (diff)
downloadscala-013acf6eb0117ca12ab2a0d0e8560df40a7392a3.tar.gz
scala-013acf6eb0117ca12ab2a0d0e8560df40a7392a3.tar.bz2
scala-013acf6eb0117ca12ab2a0d0e8560df40a7392a3.zip
renames asType to toType and asXXXSymbol to asXXX
This renaming arguably makes the intent of `asType` more clear, but more importantly it shaves 6 symbols off pervasive casts that are required to anything meaningful with reflection API (as in mirror.reflectMethod(tpe.member(newTermName("x")).asMethodSymbol)).
Diffstat (limited to 'src/compiler/scala/reflect/reify/codegen/GenTypes.scala')
-rw-r--r--src/compiler/scala/reflect/reify/codegen/GenTypes.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/scala/reflect/reify/codegen/GenTypes.scala b/src/compiler/scala/reflect/reify/codegen/GenTypes.scala
index c49e5b3342..c762a28f99 100644
--- a/src/compiler/scala/reflect/reify/codegen/GenTypes.scala
+++ b/src/compiler/scala/reflect/reify/codegen/GenTypes.scala
@@ -30,7 +30,7 @@ trait GenTypes {
val tsym = tpe.typeSymbolDirect
if (tsym.isClass && tpe == tsym.typeConstructor && tsym.isStatic)
- Select(Select(reify(tsym), nme.asTypeSymbol), nme.asTypeConstructor)
+ Select(Select(reify(tsym), nme.asType), nme.toTypeConstructor)
else tpe match {
case tpe @ NoType =>
reifyMirrorObject(tpe)
@@ -42,7 +42,7 @@ trait GenTypes {
mirrorBuildCall(nme.thisPrefix, mirrorMirrorSelect(nme.EmptyPackageClass))
case tpe @ ThisType(clazz) if clazz.isModuleClass && clazz.isStatic =>
val module = reify(clazz.sourceModule)
- val moduleClass = Select(Select(module, nme.asModuleSymbol), nme.moduleClass)
+ val moduleClass = Select(Select(module, nme.asModule), nme.moduleClass)
mirrorFactoryCall(nme.ThisType, moduleClass)
case tpe @ ThisType(_) =>
reifyProduct(tpe)
@@ -94,7 +94,7 @@ trait GenTypes {
}
case success =>
if (reifyDebug) println("implicit search has produced a result: " + success)
- state.reificationIsConcrete &= concrete || success.tpe <:< TypeTagClass.asTypeConstructor
+ state.reificationIsConcrete &= concrete || success.tpe <:< TypeTagClass.toTypeConstructor
Select(Apply(Select(success, nme.in), List(Ident(nme.MIRROR_SHORT))), nme.tpe)
}
if (result != EmptyTree) return result
@@ -109,7 +109,7 @@ trait GenTypes {
def searchForManifest(typer: analyzer.Typer): Tree =
analyzer.inferImplicit(
EmptyTree,
- appliedType(FullManifestClass.asTypeConstructor, List(tpe)),
+ appliedType(FullManifestClass.toTypeConstructor, List(tpe)),
reportAmbiguous = false,
isView = false,
context = typer.context,