Skip to content

Instantly share code, notes, and snippets.

@xeno-by
Created March 26, 2014 12:53
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/9782436 to your computer and use it in GitHub Desktop.
Save xeno-by/9782436 to your computer and use it in GitHub Desktop.
trait Universe {
type Tree
}
trait NscContext {
type Tree = universe.Tree
val universe: Universe
def macroApplication: Tree
}
class Context(val c: NscContext) extends NscContext with PalladiumContext
trait PalladiumContext extends NscContext with Universes {
self: Context =>
import universe._
val c: NscContext
def macroApplication: OurTree = wrap(c.macroApplication)
}
trait Universes {
self: PalladiumContext =>
object universe extends Universe {
type NscTree = c.universe.Tree
type OurTree = Tree
class Tree(val t: NscTree)
def wrap(t: NscTree) = new OurTree(t)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment