summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-09-19 15:04:50 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-09-19 22:47:10 +0200
commit3fa900ca0ea244ac54df75dc2fd6d711739eface (patch)
treebd37a549da114d7030a7cbce14ecc527058dd1ad /src/compiler/scala/tools/nsc/typechecker
parenteadf1d2080e0ce763e4c1920a26b80c8b8609ca0 (diff)
downloadscala-3fa900ca0ea244ac54df75dc2fd6d711739eface.tar.gz
scala-3fa900ca0ea244ac54df75dc2fd6d711739eface.tar.bz2
scala-3fa900ca0ea244ac54df75dc2fd6d711739eface.zip
SI-6363 removes scala.reflect.base
As the experience has shown, there's no need for a separate layer of reflection in scala-library.jar. Therefore I'm putting an end to it.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Implicits.scala10
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Tags.scala6
2 files changed, 8 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
index dd7f26861f..7852ff49e1 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala
@@ -1150,9 +1150,9 @@ trait Implicits {
private def TagSymbols = TagMaterializers.keySet
private val TagMaterializers = Map[Symbol, Symbol](
- ClassTagClass -> MacroInternal_materializeClassTag,
- WeakTypeTagClass -> MacroInternal_materializeWeakTypeTag,
- TypeTagClass -> MacroInternal_materializeTypeTag
+ ClassTagClass -> materializeClassTag,
+ WeakTypeTagClass -> materializeWeakTypeTag,
+ TypeTagClass -> materializeTypeTag
)
/** Creates a tree will produce a tag of the requested flavor.
@@ -1183,7 +1183,7 @@ trait Implicits {
val prefix = (
// ClassTags are not path-dependent, so their materializer doesn't care about prefixes
- if (tagClass eq ClassTagClass) gen.mkBasisUniverseRef
+ if (tagClass eq ClassTagClass) EmptyTree
else pre match {
case SingleType(prePre, preSym) =>
gen.mkAttributedRef(prePre, preSym) setType pre
@@ -1205,7 +1205,7 @@ trait Implicits {
}
)
// todo. migrate hardcoded materialization in Implicits to corresponding implicit macros
- var materializer = atPos(pos.focus)(gen.mkMethodCall(TagMaterializers(tagClass), List(tp), List(prefix)))
+ var materializer = atPos(pos.focus)(gen.mkMethodCall(TagMaterializers(tagClass), List(tp), if (prefix != EmptyTree) List(prefix) else List()))
if (settings.XlogImplicits.value) println("materializing requested %s.%s[%s] using %s".format(pre, tagClass.name, tp, materializer))
if (context.macrosEnabled) success(materializer)
// don't call `failure` here. if macros are disabled, we just fail silently
diff --git a/src/compiler/scala/tools/nsc/typechecker/Tags.scala b/src/compiler/scala/tools/nsc/typechecker/Tags.scala
index 167bf5c857..0dbeafadbe 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Tags.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Tags.scala
@@ -48,8 +48,8 @@ trait Tags {
* @param pos Position for error reporting. Please, provide meaningful value.
* @param pre Prefix that represents a universe this type tag will be bound to.
* If `pre` is set to `NoType`, then any type tag in scope will do, regardless of its affiliation.
- * If `pre` is set to `NoType`, and tag resolution involves materialization, then `mkBasisPrefix` will be used.
- * @param tp Type we're looking a TypeTag for, e.g. resolveTypeTag(pos, reflectBasisPrefix, IntClass.tpe, false) will look for scala.reflect.basis.TypeTag[Int].
+ * If `pre` is set to `NoType`, and tag resolution involves materialization, then `mkRuntimeUniverseRef` will be used.
+ * @param tp Type we're looking a TypeTag for, e.g. resolveTypeTag(pos, mkRuntimeUniverseRef, IntClass.tpe, false) will look for scala.reflect.runtime.universe.TypeTag[Int].
* @param concrete If true then the result must not contain unresolved (i.e. not spliced) type parameters and abstract type members.
* If false then the function will always succeed (abstract types will be reified as free types).
* @param allowMaterialization If true (default) then the resolver is allowed to launch materialization macros when there's no type tag in scope.
@@ -61,7 +61,7 @@ trait Tags {
*/
def resolveTypeTag(pos: Position, pre: Type, tp: Type, concrete: Boolean, allowMaterialization: Boolean = true): Tree = {
val tagSym = if (concrete) TypeTagClass else WeakTypeTagClass
- val tagTp = if (pre == NoType) TypeRef(BaseUniverseClass.toTypeConstructor, tagSym, List(tp)) else singleType(pre, pre member tagSym.name)
+ val tagTp = if (pre == NoType) TypeRef(ApiUniverseClass.toTypeConstructor, tagSym, List(tp)) else singleType(pre, pre member tagSym.name)
val taggedTp = appliedType(tagTp, List(tp))
resolveTag(pos, taggedTp, allowMaterialization)
}