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
);
}
@@ -36,7 +36,7 @@ public final class JvmAbi {
*/
public static final BinaryVersion VERSION = BinaryVersion.create(0, 27, 0);
public static final String DEFAULT_IMPLS_CLASS_NAME = "$TImpl";
public static final String DEFAULT_IMPLS_CLASS_NAME = "DefaultImpls";
public static final String DEFAULT_IMPLS_SUFFIX = "$" + DEFAULT_IMPLS_CLASS_NAME;
public static final String DEFAULT_PARAMS_IMPL_SUFFIX = "$default";
@@ -4,5 +4,5 @@ val x: ReadOnlyPr<caret>
// INVOCATION_COUNT: 2
// EXIST: "ReadOnlyProperty"
// ABSENT: "ReadOnlyProperty$$TImpl"
// ABSENT: "ReadOnlyProperty$DefaultImpls"
// NOTHING_ELSE
+1 -1
View File
@@ -1,5 +1,5 @@
interface A {
fun foo() {
"" // A\$\$TImpl
"" // A\$DefaultImpls
}
}
@@ -1,18 +1,18 @@
Cleaning output files:
out/production/module/test/Trait$$TImpl.class
out/production/module/test/Trait$Companion.class
out/production/module/test/Trait$DefaultImpls.class
out/production/module/test/Trait.class
End of files
Compiling files:
src/const.kt
End of files
Cleaning output files:
out/production/module/test/Trait$$TImpl.class
out/production/module/test/Trait$Companion.class
out/production/module/test/Trait$DefaultImpls.class
out/production/module/test/Trait.class
out/production/module/test/Usage.class
End of files
Compiling files:
src/const.kt
src/usage.kt
End of files
End of files
@@ -1,4 +1,4 @@
p org.test 0
d 0/SomeInterface
d 0/SomeInterface$$TImpl
d 0/SomeInterface$DefaultImpls
d 0/SomeClass