Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ABC
- {
- //some code
- }
- val mirror = universe.runtimeMirror(getClass.getClassLoader);
- val classInstance = Class.forName("ABC");
- val classSymbol = mirror.classSymbol(classInstance);
- val classType = classSymbol.toType;//println(classType) gives ABC
- /******this line does not work*****/
- classInstance.newInstance().asInstanceOf[classType];
- // not asInstanceOf[ABC]
- /***********/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement