Skip to content

Instantly share code, notes, and snippets.

@paulp
Created January 27, 2012 16:32
Show Gist options
  • Save paulp/1689641 to your computer and use it in GitHub Desktop.
Save paulp/1689641 to your computer and use it in GitHub Desktop.
def initializeFromClassRep(owner: Symbol, classRep: ClassRep) {
val useSource = classRep match {
case DualClassRep(_, _) => platform needCompile classRep
case SourceRep(_) => true
case BinaryRep(_) => false
case _ => println("nothing") ; return
}
vinform("[%s] %s %s".format(
if (useSource) "src" else "bin", owner, classRep))
val newLoader = (
if (useSource) new global.loaders.SourcefileLoader(classRep.source)
else platform.newClassLoader(classRep.binary)
)
global.loaders.enterClassAndModule(owner, classRep.className, newLoader)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment