Change INTERFACE_IMPL_CLASS_NAME: $TImpl -> DefaultImpls
This commit is contained in:
@@ -1439,7 +1439,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (KotlinBuiltIns.isCloneable(containingTrait) && traitMethod.getName().equals("clone")) {
|
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
|
// and its 'clone' method is actually located in java/lang/Object
|
||||||
iv.invokespecial("java/lang/Object", "clone", "()Ljava/lang/Object;", false);
|
iv.invokespecial("java/lang/Object", "clone", "()Ljava/lang/Object;", false);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -4,6 +4,6 @@ interface T1 {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class `T1$$TImpl` {
|
class `T1$DefaultImpls` {
|
||||||
|
|
||||||
}
|
}
|
||||||
+3
-3
@@ -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 {
|
interface T1 {
|
||||||
^
|
^
|
||||||
compiler/testData/cli/jvm/classAndTraitClash.kt:7:1: error: duplicate JVM class name 'test/T1$$TImpl' generated from: `T1$$TImpl`, T1
|
compiler/testData/cli/jvm/classAndTraitClash.kt:7:1: error: duplicate JVM class name 'test/T1$DefaultImpls' generated from: `T1$DefaultImpls`, T1
|
||||||
class `T1$$TImpl` {
|
class `T1$DefaultImpls` {
|
||||||
^
|
^
|
||||||
COMPILATION_ERROR
|
COMPILATION_ERROR
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
@file:JvmName("XXX\$\$TImpl")
|
@file:JvmName("XXX\$DefaultImpls")
|
||||||
package test
|
package test
|
||||||
|
|
||||||
interface XXX
|
interface XXX
|
||||||
+3
-3
@@ -8,6 +8,6 @@ interface B {
|
|||||||
|
|
||||||
interface C : A, B
|
interface C : A, B
|
||||||
|
|
||||||
// There's no 'foo' in A$$TImpl, proguard and other tools may fail if we generate calls to it
|
// There's no 'foo' in A$DefaultImpls, proguard and other tools may fail if we generate calls to it
|
||||||
// 0 INVOKESTATIC A\$\$TImpl.foo
|
// 0 INVOKESTATIC A\$DefaultImpls.foo
|
||||||
// 1 INVOKESTATIC B\$\$TImpl.foo
|
// 1 INVOKESTATIC B\$DefaultImpls.foo
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ open class C : B()
|
|||||||
class D : C()
|
class D : C()
|
||||||
|
|
||||||
// Implementation of foo() should only be generated into B
|
// 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
|
// Only two declarations should be present: in A and B
|
||||||
// 2 foo\(\)I
|
// 2 foo\(\)I
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
abstract class TraitImpl implements Trait {
|
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() {
|
public void testLocalTraitImpl() {
|
||||||
doTestKotlinSyntheticClass(
|
doTestKotlinSyntheticClass(
|
||||||
"fun foo() { interface Local { fun bar() = 42 } }",
|
"fun foo() { interface Local { fun bar() = 42 } }",
|
||||||
"Local$$TImpl.class",
|
"Local$DefaultImpls.class",
|
||||||
LOCAL_TRAIT_IMPL
|
LOCAL_TRAIT_IMPL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public final class JvmAbi {
|
|||||||
*/
|
*/
|
||||||
public static final BinaryVersion VERSION = BinaryVersion.create(0, 27, 0);
|
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_IMPLS_SUFFIX = "$" + DEFAULT_IMPLS_CLASS_NAME;
|
||||||
|
|
||||||
public static final String DEFAULT_PARAMS_IMPL_SUFFIX = "$default";
|
public static final String DEFAULT_PARAMS_IMPL_SUFFIX = "$default";
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ val x: ReadOnlyPr<caret>
|
|||||||
|
|
||||||
// INVOCATION_COUNT: 2
|
// INVOCATION_COUNT: 2
|
||||||
// EXIST: "ReadOnlyProperty"
|
// EXIST: "ReadOnlyProperty"
|
||||||
// ABSENT: "ReadOnlyProperty$$TImpl"
|
// ABSENT: "ReadOnlyProperty$DefaultImpls"
|
||||||
// NOTHING_ELSE
|
// NOTHING_ELSE
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
interface A {
|
interface A {
|
||||||
fun foo() {
|
fun foo() {
|
||||||
"" // A\$\$TImpl
|
"" // A\$DefaultImpls
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -1,18 +1,18 @@
|
|||||||
Cleaning output files:
|
Cleaning output files:
|
||||||
out/production/module/test/Trait$$TImpl.class
|
|
||||||
out/production/module/test/Trait$Companion.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/Trait.class
|
||||||
End of files
|
End of files
|
||||||
Compiling files:
|
Compiling files:
|
||||||
src/const.kt
|
src/const.kt
|
||||||
End of files
|
End of files
|
||||||
Cleaning output files:
|
Cleaning output files:
|
||||||
out/production/module/test/Trait$$TImpl.class
|
|
||||||
out/production/module/test/Trait$Companion.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/Trait.class
|
||||||
out/production/module/test/Usage.class
|
out/production/module/test/Usage.class
|
||||||
End of files
|
End of files
|
||||||
Compiling files:
|
Compiling files:
|
||||||
src/const.kt
|
src/const.kt
|
||||||
src/usage.kt
|
src/usage.kt
|
||||||
End of files
|
End of files
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
p org.test 0
|
p org.test 0
|
||||||
d 0/SomeInterface
|
d 0/SomeInterface
|
||||||
d 0/SomeInterface$$TImpl
|
d 0/SomeInterface$DefaultImpls
|
||||||
d 0/SomeClass
|
d 0/SomeClass
|
||||||
|
|||||||
Reference in New Issue
Block a user