Merge remote branch 'origin/master'

This commit is contained in:
Andrey Breslav
2011-12-09 14:47:05 +04:00
3 changed files with 15 additions and 1 deletions
@@ -801,7 +801,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
JetType defaultType = descriptor.getDefaultType();
if(CodegenUtil.hasTypeInfoField(defaultType)) {
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);
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");
// System.out.println(generateToText());
}
public void testInheritance() throws Exception {
blackBoxFile("typeInfo/inheritance.jet");
System.out.println(generateToText());
}
}