Skip to content

Instantly share code, notes, and snippets.

@xeno-by
Created June 6, 2014 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xeno-by/8ebb9c5c1ce9c91ad472 to your computer and use it in GitHub Desktop.
Save xeno-by/8ebb9c5c1ce9c91ad472 to your computer and use it in GitHub Desktop.
class ReflectTypechecker { self =>
type UnaffiliatedMacroContext <: scala.reflect.moved.macros.contexts.Context
type MacroContext = UnaffiliatedMacroContext { val universe: self.global.type }
def newContext(): MacroContext = new ReflectMacroContext().asInstanceOf[MacroContext]
}
class CompilerTypechecker extends ReflectTypechecker {
override type UnaffiliatedMacroContext = scala.reflect.macros.contexts.Context
override def newContext(): MacroContext = new CompilerMacroContext().asInstanceOf[MacroContext]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment