Support KClass.simpleName and built-in class literals

This commit is contained in:
Alexander Udalov
2015-03-07 03:45:46 +03:00
parent 6e45c6f17c
commit b93b9bd565
9 changed files with 84 additions and 2 deletions
@@ -2719,8 +2719,9 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
@Override
public Unit invoke(InstructionAdapter v) {
Type classAsmType = typeMapper.mapClass(descriptor);
if (descriptor instanceof JavaClassDescriptor) {
v.aconst(classAsmType);
ModuleDescriptor module = DescriptorUtils.getContainingModule(descriptor);
if (descriptor instanceof JavaClassDescriptor || module == module.getBuiltIns().getBuiltInsModule()) {
putJavaLangClassInstance(v, classAsmType);
v.invokestatic(REFLECTION, "foreignKotlinClass", Type.getMethodDescriptor(K_CLASS_TYPE, getType(Class.class)), false);
}
else {