Change INTERFACE_IMPL_CLASS_NAME: $TImpl -> DefaultImpls

This commit is contained in:
Denis Zharkov
2015-09-24 19:08:57 +03:00
parent cabf0df5d1
commit a101fffd9a
13 changed files with 20 additions and 20 deletions
@@ -1439,7 +1439,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
}
if (KotlinBuiltIns.isCloneable(containingTrait) && traitMethod.getName().equals("clone")) {
// A special hack for Cloneable: there's no kotlin/Cloneable$$TImpl class at runtime,
// A special hack for Cloneable: there's no kotlin/Cloneable$DefaultImpls class at runtime,
// and its 'clone' method is actually located in java/lang/Object
iv.invokespecial("java/lang/Object", "clone", "()Ljava/lang/Object;", false);
}
+1 -1
View File
@@ -4,6 +4,6 @@ interface T1 {
}
class `T1$$TImpl` {
class `T1$DefaultImpls` {
}
+3 -3
View File
@@ -1,7 +1,7 @@
compiler/testData/cli/jvm/classAndTraitClash.kt:3:1: error: duplicate JVM class name 'test/T1$$TImpl' generated from: `T1$$TImpl`, T1
compiler/testData/cli/jvm/classAndTraitClash.kt:3:1: error: duplicate JVM class name 'test/T1$DefaultImpls' generated from: `T1$DefaultImpls`, T1
interface T1 {
^
compiler/testData/cli/jvm/classAndTraitClash.kt:7:1: error: duplicate JVM class name 'test/T1$$TImpl' generated from: `T1$$TImpl`, T1
class `T1$$TImpl` {
compiler/testData/cli/jvm/classAndTraitClash.kt:7:1: error: duplicate JVM class name 'test/T1$DefaultImpls' generated from: `T1$DefaultImpls`, T1
class `T1$DefaultImpls` {
^
COMPILATION_ERROR
+1 -1
View File
@@ -1,4 +1,4 @@
@file:JvmName("XXX\$\$TImpl")
@file:JvmName("XXX\$DefaultImpls")
package test
interface XXX
@@ -8,6 +8,6 @@ interface B {
interface C : A, B
// There's no 'foo' in A$$TImpl, proguard and other tools may fail if we generate calls to it
// 0 INVOKESTATIC A\$\$TImpl.foo
// 1 INVOKESTATIC B\$\$TImpl.foo
// There's no 'foo' in A$DefaultImpls, proguard and other tools may fail if we generate calls to it
// 0 INVOKESTATIC A\$DefaultImpls.foo
// 1 INVOKESTATIC B\$DefaultImpls.foo
@@ -9,7 +9,7 @@ open class C : B()
class D : C()
// Implementation of foo() should only be generated into B
// 1 INVOKESTATIC A\$\$TImpl.foo
// 1 INVOKESTATIC A\$DefaultImpls.foo
// Only two declarations should be present: in A and B
// 2 foo\(\)I
@@ -4,8 +4,8 @@ import java.util.ArrayList;
abstract class TraitImpl implements Trait {
{
Trait$$TImpl.simple(this);
Trait$DefaultImpls.simple(this);
Trait$$TImpl.generic(this, new ArrayList<String>());
Trait$DefaultImpls.generic(this, new ArrayList<String>());
}
}
@@ -107,7 +107,7 @@ public class KotlinSyntheticClassAnnotationTest extends CodegenTestCase {
public void testLocalTraitImpl() {
doTestKotlinSyntheticClass(
"fun foo() { interface Local { fun bar() = 42 } }",
"Local$$TImpl.class",
"Local$DefaultImpls.class",
LOCAL_TRAIT_IMPL
);
}