Generate scala source for a class instance using reflection -


assuming have instance of class. best approach generate valid scala source code, written out file , compiled, of instance during runtime? (utilizing scala reflection-api/macros?) possible parse ast representation source code?

no it's not possible. class file contains jvm byte-code has nothing scala. can try use java-decompiler (http://varaneckas.com/jad/ example), wouldn't able readable.

as unserstand scala moving towards new platform (dotty), , maybe in future possible.


Popular posts from this blog