Merge remote branch 'origin/master'
This commit is contained in:
@@ -801,7 +801,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
|||||||
JetType defaultType = descriptor.getDefaultType();
|
JetType defaultType = descriptor.getDefaultType();
|
||||||
if(CodegenUtil.hasTypeInfoField(defaultType)) {
|
if(CodegenUtil.hasTypeInfoField(defaultType)) {
|
||||||
if(!CodegenUtil.hasDerivedTypeInfoField(defaultType, true)) {
|
if(!CodegenUtil.hasDerivedTypeInfoField(defaultType, true)) {
|
||||||
v.newField(myClass, Opcodes.ACC_PRIVATE, "$typeInfo", "Ljet/typeinfo/TypeInfo;", null, null);
|
v.newField(myClass, Opcodes.ACC_PROTECTED, "$typeInfo", "Ljet/typeinfo/TypeInfo;", null, null);
|
||||||
|
|
||||||
MethodVisitor mv = v.newMethod(myClass, Opcodes.ACC_PUBLIC, "getTypeInfo", "()Ljet/typeinfo/TypeInfo;", null, null);
|
MethodVisitor mv = v.newMethod(myClass, Opcodes.ACC_PUBLIC, "getTypeInfo", "()Ljet/typeinfo/TypeInfo;", null, null);
|
||||||
InstructionAdapter iv = null;
|
InstructionAdapter iv = null;
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
open class A<T> () {
|
||||||
|
fun plus(e: T) = B<T> (e)
|
||||||
|
}
|
||||||
|
|
||||||
|
class B<T> (val e: T) : A<T>() {
|
||||||
|
fun add() = B<T> (e)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box() = if( A<String>().plus("239").add().e == "239" ) "OK" else "fail"
|
||||||
@@ -142,5 +142,10 @@ public class TypeInfoTest extends CodegenTestCase {
|
|||||||
blackBoxFile("typeInfo/inner.jet");
|
blackBoxFile("typeInfo/inner.jet");
|
||||||
// System.out.println(generateToText());
|
// System.out.println(generateToText());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testInheritance() throws Exception {
|
||||||
|
blackBoxFile("typeInfo/inheritance.jet");
|
||||||
|
System.out.println(generateToText());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user