diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-07-17 12:36:11 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-07-20 10:04:58 +0200 |
commit | 30f5a36941aa1671849322ba79ebff0881ae7ff0 (patch) | |
tree | e76028cbb9d52b9ade6067b2d3aa82c8326fb009 /src/reflect | |
parent | a8bd1e25b9fe32a8eff2f51ee3bfa527440beb84 (diff) | |
download | scala-30f5a36941aa1671849322ba79ebff0881ae7ff0.tar.gz scala-30f5a36941aa1671849322ba79ebff0881ae7ff0.tar.bz2 scala-30f5a36941aa1671849322ba79ebff0881ae7ff0.zip |
SI-5999 removes Context.reify
Currently there are discrepancies between the behavior of
c.reify and c.universe.reify.
First step in fixing these problems is removing the duplication in the API.
That's why I'm cutting away the Context.reify shortcut.
Context.reify is a magic macro, hardwired in the fast track mechanism, so
removing it requires redeploying the starr (because an old starr will
crash if launched on sources that don't contain Context.reify).
To cleanly redeploy a starr I've left a Context.reify stub in sources,
but hidden it behind a `protected` modifier. When starr is redeployed
(in a subsequent commit) the stub will be removed.
I've also updated the tests to use c.universe.reify instead of c.reify.
This will break some of them, because c.universe.reify uses a standard
compiler mirror, which unlike a macro mirror doesn't like packageless classes.
That's an annoyance, but I think having clean separation of commits
is more important that being 100% consistent.
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/internal/Definitions.scala | 1 | ||||
-rw-r--r-- | src/reflect/scala/reflect/makro/Context.scala | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/reflect/scala/reflect/internal/Definitions.scala b/src/reflect/scala/reflect/internal/Definitions.scala index cd243b9df0..7284a199b7 100644 --- a/src/reflect/scala/reflect/internal/Definitions.scala +++ b/src/reflect/scala/reflect/internal/Definitions.scala @@ -490,7 +490,6 @@ trait Definitions extends api.StandardDefinitions { def MacroContextPrefixType = if (MacroContextClass != NoSymbol) getMemberType(MacroContextClass, tpnme.PrefixType) else NoSymbol def MacroContextUniverse = if (MacroContextClass != NoSymbol) getMemberMethod(MacroContextClass, nme.universe) else NoSymbol def MacroContextMirror = if (MacroContextClass != NoSymbol) getMemberMethod(MacroContextClass, nme.mirror) else NoSymbol - def MacroContextReify = if (MacroContextClass != NoSymbol) getMemberMethod(MacroContextClass, nme.reify) else NoSymbol lazy val MacroImplAnnotation = requiredClass[scala.reflect.makro.internal.macroImpl] lazy val MacroInternalPackage = getPackageObject("scala.reflect.makro.internal") def MacroInternal_materializeClassTag = getMemberMethod(MacroInternalPackage, nme.materializeClassTag) diff --git a/src/reflect/scala/reflect/makro/Context.scala b/src/reflect/scala/reflect/makro/Context.scala index f9858a063c..41c2791573 100644 --- a/src/reflect/scala/reflect/makro/Context.scala +++ b/src/reflect/scala/reflect/makro/Context.scala @@ -35,6 +35,6 @@ trait Context extends Aliases val prefix: Expr[PrefixType] /** Alias to the underlying mirror's reify */ - // implementation is magically hardwired to `scala.reflect.makro.runtime.ContextReifiers` - def reify[T](expr: T): Expr[T] = macro ??? + // [Eugene] obsoleted. should be removed once I redeploy a starr + protected def reify[T](expr: T): Expr[T] = ??? } |