Generate synthetic annotation method in interface if -Xjvm-default is on
This commit is contained in:
@@ -1685,9 +1685,10 @@ public class FunctionCodegen {
|
|||||||
|
|
||||||
// Fake overrides in interfaces should be expanded to implementation to make proper default check
|
// Fake overrides in interfaces should be expanded to implementation to make proper default check
|
||||||
if (JvmAnnotationUtilKt.checkIsImplementationCompiledToJvmDefault(memberDescriptor, mode)) {
|
if (JvmAnnotationUtilKt.checkIsImplementationCompiledToJvmDefault(memberDescriptor, mode)) {
|
||||||
return (kind != OwnerKind.DEFAULT_IMPLS && !isSynthetic) ||
|
boolean isSyntheticInCompatibilityOrJvmDefault = isSynthetic && (mode.isCompatibility() || mode == JvmDefaultMode.ENABLE);
|
||||||
|
return (kind != OwnerKind.DEFAULT_IMPLS && !isSyntheticInCompatibilityOrJvmDefault) ||
|
||||||
(kind == OwnerKind.DEFAULT_IMPLS &&
|
(kind == OwnerKind.DEFAULT_IMPLS &&
|
||||||
(isSynthetic || //TODO: move synthetic method generation into interface
|
(isSyntheticInCompatibilityOrJvmDefault ||
|
||||||
(mode.isCompatibility() && !JvmAnnotationUtilKt.hasJvmDefaultNoCompatibilityAnnotation(containingDeclaration))));
|
(mode.isCompatibility() && !JvmAnnotationUtilKt.hasJvmDefaultNoCompatibilityAnnotation(containingDeclaration))));
|
||||||
} else {
|
} else {
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
|
|||||||
+28
@@ -6836,6 +6836,18 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop")
|
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class Interop {
|
public class Interop {
|
||||||
|
@Test
|
||||||
|
@TestMetadata("allAgainsAllCompatibility.kt")
|
||||||
|
public void testAllAgainsAllCompatibility() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/allAgainsAllCompatibility.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("allCompatibilityAgainsAll.kt")
|
||||||
|
public void testAllCompatibilityAgainsAll() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/allCompatibilityAgainsAll.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInInterop() throws Exception {
|
public void testAllFilesPresentInInterop() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
@@ -6883,6 +6895,22 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class NoDefaultImpls {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInNoDefaultImpls() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("superPropAccessFromInterface.kt")
|
||||||
|
public void testSuperPropAccessFromInterface() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls/superPropAccessFromInterface.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
|||||||
+7
-3
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
|
|||||||
import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin
|
import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin
|
||||||
import org.jetbrains.kotlin.backend.jvm.codegen.isJvmInterface
|
import org.jetbrains.kotlin.backend.jvm.codegen.isJvmInterface
|
||||||
import org.jetbrains.kotlin.backend.jvm.ir.*
|
import org.jetbrains.kotlin.backend.jvm.ir.*
|
||||||
|
import org.jetbrains.kotlin.config.JvmDefaultMode
|
||||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||||
import org.jetbrains.kotlin.descriptors.Modality
|
import org.jetbrains.kotlin.descriptors.Modality
|
||||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||||
@@ -123,9 +124,12 @@ internal class InterfaceLowering(val context: JvmBackendContext) : IrElementTran
|
|||||||
* 3) Private methods (not compiled to JVM defaults), default parameter dispatchers (not compiled to JVM defaults)
|
* 3) Private methods (not compiled to JVM defaults), default parameter dispatchers (not compiled to JVM defaults)
|
||||||
* and $annotation methods are always moved without bridges
|
* and $annotation methods are always moved without bridges
|
||||||
*/
|
*/
|
||||||
(DescriptorVisibilities.isPrivate(function.visibility) && !function.isCompiledToJvmDefault(jvmDefaultMode))
|
(!function.isCompiledToJvmDefault(jvmDefaultMode) && (DescriptorVisibilities.isPrivate(function.visibility)
|
||||||
|| (function.origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER && !function.isCompiledToJvmDefault(jvmDefaultMode))
|
|| function.origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER
|
||||||
|| function.origin == JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_OR_TYPEALIAS_ANNOTATIONS -> {
|
|| function.origin == JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_OR_TYPEALIAS_ANNOTATIONS)) ||
|
||||||
|
(function.origin == JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_OR_TYPEALIAS_ANNOTATIONS &&
|
||||||
|
(isCompatibilityMode || jvmDefaultMode == JvmDefaultMode.ENABLE) &&
|
||||||
|
function.isCompiledToJvmDefault(jvmDefaultMode)) -> {
|
||||||
val defaultImpl = createDefaultImpl(function)
|
val defaultImpl = createDefaultImpl(function)
|
||||||
defaultImpl.body = function.moveBodyTo(defaultImpl)
|
defaultImpl.body = function.moveBodyTo(defaultImpl)
|
||||||
removedFunctions[function.symbol] = defaultImpl.symbol
|
removedFunctions[function.symbol] = defaultImpl.symbol
|
||||||
|
|||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
// JVM_TARGET: 1.8
|
||||||
|
|
||||||
|
// MODULE: lib
|
||||||
|
// !JVM_DEFAULT_MODE: all-compatibility
|
||||||
|
// FILE: 1.kt
|
||||||
|
|
||||||
|
interface Foo<T> {
|
||||||
|
fun test(p: T) = "fail"
|
||||||
|
val T.prop: String
|
||||||
|
get() = "fail"
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main(lib)
|
||||||
|
// !JVM_DEFAULT_MODE: all
|
||||||
|
// FILE: main.kt
|
||||||
|
interface Foo2: Foo<String> {
|
||||||
|
override fun test(p: String) : String = p
|
||||||
|
|
||||||
|
override val String.prop: String
|
||||||
|
get() = this
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Foo3: Foo<String>, Foo2
|
||||||
|
|
||||||
|
class Base : Foo3
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val base = Base()
|
||||||
|
return base.test("O") + with(base) { "K".prop }
|
||||||
|
}
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
// JVM_TARGET: 1.8
|
||||||
|
// MODULE: lib
|
||||||
|
// !JVM_DEFAULT_MODE: all
|
||||||
|
// FILE: 1.kt
|
||||||
|
|
||||||
|
interface Foo<T> {
|
||||||
|
fun test(p: T) = "fail"
|
||||||
|
val T.prop: String
|
||||||
|
get() = "fail"
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main(lib)
|
||||||
|
// !JVM_DEFAULT_MODE: all-compatibility
|
||||||
|
// FILE: main.kt
|
||||||
|
interface Foo2: Foo<String> {
|
||||||
|
override fun test(p: String) : String = p
|
||||||
|
|
||||||
|
override val String.prop: String
|
||||||
|
get() = this
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Foo3: Foo<String>, Foo2
|
||||||
|
|
||||||
|
class Base : Foo3
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val base = Base()
|
||||||
|
return base.test("O") + with(base) { "K".prop }
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
// !JVM_DEFAULT_MODE: all
|
||||||
|
// JVM_TARGET: 1.8
|
||||||
|
// WITH_RUNTIME
|
||||||
|
// MODULE: lib
|
||||||
|
// FILE: 1.kt
|
||||||
|
interface Test {
|
||||||
|
val prop: String
|
||||||
|
get() = "OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
// MODULE: main(lib)
|
||||||
|
// FILE: 2.kt
|
||||||
|
interface Test2 : Test {
|
||||||
|
override val prop: String
|
||||||
|
get() = super.prop
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
return object : Test2 {}.prop
|
||||||
|
}
|
||||||
Vendored
+12
@@ -0,0 +1,12 @@
|
|||||||
|
// !JVM_DEFAULT_MODE: all-compatibility
|
||||||
|
// JVM_TARGET: 1.8
|
||||||
|
// WITH_RUNTIME
|
||||||
|
|
||||||
|
@Target(AnnotationTarget.PROPERTY)
|
||||||
|
annotation class Foo
|
||||||
|
|
||||||
|
interface Deprecated {
|
||||||
|
|
||||||
|
@Foo
|
||||||
|
val prop: String
|
||||||
|
}
|
||||||
Vendored
+21
@@ -0,0 +1,21 @@
|
|||||||
|
@kotlin.Metadata
|
||||||
|
public final class Deprecated$DefaultImpls {
|
||||||
|
// source: 'interfaceProperty.kt'
|
||||||
|
public synthetic deprecated static @Foo method getProp$annotations(): void
|
||||||
|
public final inner class Deprecated$DefaultImpls
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.Metadata
|
||||||
|
public interface Deprecated {
|
||||||
|
// source: 'interfaceProperty.kt'
|
||||||
|
public abstract @org.jetbrains.annotations.NotNull method getProp(): java.lang.String
|
||||||
|
public final inner class Deprecated$DefaultImpls
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.annotation.Target
|
||||||
|
@java.lang.annotation.Retention
|
||||||
|
@java.lang.annotation.Target
|
||||||
|
@kotlin.Metadata
|
||||||
|
public annotation class Foo {
|
||||||
|
// source: 'interfaceProperty.kt'
|
||||||
|
}
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
// !JVM_DEFAULT_MODE: enable
|
||||||
|
// JVM_TARGET: 1.8
|
||||||
|
// WITH_RUNTIME
|
||||||
|
@Target(AnnotationTarget.PROPERTY)
|
||||||
|
annotation class Foo
|
||||||
|
|
||||||
|
interface Deprecated {
|
||||||
|
|
||||||
|
@Foo
|
||||||
|
val prop: String
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
@kotlin.Metadata
|
||||||
|
public final class Deprecated$DefaultImpls {
|
||||||
|
// source: 'interfaceProperty.kt'
|
||||||
|
public synthetic deprecated static @Foo method getProp$annotations(): void
|
||||||
|
public final inner class Deprecated$DefaultImpls
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.Metadata
|
||||||
|
public interface Deprecated {
|
||||||
|
// source: 'interfaceProperty.kt'
|
||||||
|
public abstract @org.jetbrains.annotations.NotNull method getProp(): java.lang.String
|
||||||
|
public final inner class Deprecated$DefaultImpls
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.annotation.Target
|
||||||
|
@java.lang.annotation.Retention
|
||||||
|
@java.lang.annotation.Target
|
||||||
|
@kotlin.Metadata
|
||||||
|
public annotation class Foo {
|
||||||
|
// source: 'interfaceProperty.kt'
|
||||||
|
}
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
// !JVM_DEFAULT_MODE: all
|
||||||
|
// JVM_TARGET: 1.8
|
||||||
|
// WITH_RUNTIME
|
||||||
|
@Target(AnnotationTarget.PROPERTY)
|
||||||
|
annotation class Foo
|
||||||
|
|
||||||
|
interface Deprecated {
|
||||||
|
|
||||||
|
@Foo
|
||||||
|
val prop: String
|
||||||
|
}
|
||||||
Vendored
+14
@@ -0,0 +1,14 @@
|
|||||||
|
@kotlin.Metadata
|
||||||
|
public interface Deprecated {
|
||||||
|
// source: 'interfaceProperty.kt'
|
||||||
|
public synthetic deprecated static @Foo method getProp$annotations(): void
|
||||||
|
public abstract @org.jetbrains.annotations.NotNull method getProp(): java.lang.String
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.annotation.Target
|
||||||
|
@java.lang.annotation.Retention
|
||||||
|
@java.lang.annotation.Target
|
||||||
|
@kotlin.Metadata
|
||||||
|
public annotation class Foo {
|
||||||
|
// source: 'interfaceProperty.kt'
|
||||||
|
}
|
||||||
+28
@@ -6836,6 +6836,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop")
|
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class Interop {
|
public class Interop {
|
||||||
|
@Test
|
||||||
|
@TestMetadata("allAgainsAllCompatibility.kt")
|
||||||
|
public void testAllAgainsAllCompatibility() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/allAgainsAllCompatibility.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("allCompatibilityAgainsAll.kt")
|
||||||
|
public void testAllCompatibilityAgainsAll() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/allCompatibilityAgainsAll.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInInterop() throws Exception {
|
public void testAllFilesPresentInInterop() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||||
@@ -6883,6 +6895,22 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class NoDefaultImpls {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInNoDefaultImpls() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("superPropAccessFromInterface.kt")
|
||||||
|
public void testSuperPropAccessFromInterface() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls/superPropAccessFromInterface.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
|||||||
+28
@@ -6836,6 +6836,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop")
|
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class Interop {
|
public class Interop {
|
||||||
|
@Test
|
||||||
|
@TestMetadata("allAgainsAllCompatibility.kt")
|
||||||
|
public void testAllAgainsAllCompatibility() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/allAgainsAllCompatibility.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("allCompatibilityAgainsAll.kt")
|
||||||
|
public void testAllCompatibilityAgainsAll() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/allCompatibilityAgainsAll.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInInterop() throws Exception {
|
public void testAllFilesPresentInInterop() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
@@ -6883,6 +6895,22 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class NoDefaultImpls {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInNoDefaultImpls() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("superPropAccessFromInterface.kt")
|
||||||
|
public void testSuperPropAccessFromInterface() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls/superPropAccessFromInterface.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
|||||||
+28
@@ -749,6 +749,18 @@ public class JvmIrAgainstOldBoxTestGenerated extends AbstractJvmIrAgainstOldBoxT
|
|||||||
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop")
|
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class Interop {
|
public class Interop {
|
||||||
|
@Test
|
||||||
|
@TestMetadata("allAgainsAllCompatibility.kt")
|
||||||
|
public void testAllAgainsAllCompatibility() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/allAgainsAllCompatibility.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("allCompatibilityAgainsAll.kt")
|
||||||
|
public void testAllCompatibilityAgainsAll() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/allCompatibilityAgainsAll.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInInterop() throws Exception {
|
public void testAllFilesPresentInInterop() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_IR_AGAINST_OLD, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_IR_AGAINST_OLD, true);
|
||||||
@@ -796,6 +808,22 @@ public class JvmIrAgainstOldBoxTestGenerated extends AbstractJvmIrAgainstOldBoxT
|
|||||||
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class NoDefaultImpls {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInNoDefaultImpls() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_IR_AGAINST_OLD, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("superPropAccessFromInterface.kt")
|
||||||
|
public void testSuperPropAccessFromInterface() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls/superPropAccessFromInterface.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
|||||||
+28
@@ -749,6 +749,18 @@ public class JvmOldAgainstIrBoxTestGenerated extends AbstractJvmOldAgainstIrBoxT
|
|||||||
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop")
|
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
public class Interop {
|
public class Interop {
|
||||||
|
@Test
|
||||||
|
@TestMetadata("allAgainsAllCompatibility.kt")
|
||||||
|
public void testAllAgainsAllCompatibility() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/allAgainsAllCompatibility.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("allCompatibilityAgainsAll.kt")
|
||||||
|
public void testAllCompatibilityAgainsAll() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/allCompatibilityAgainsAll.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInInterop() throws Exception {
|
public void testAllFilesPresentInInterop() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_OLD_AGAINST_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_OLD_AGAINST_IR, true);
|
||||||
@@ -796,6 +808,22 @@ public class JvmOldAgainstIrBoxTestGenerated extends AbstractJvmOldAgainstIrBoxT
|
|||||||
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class NoDefaultImpls {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInNoDefaultImpls() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_OLD_AGAINST_IR, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("superPropAccessFromInterface.kt")
|
||||||
|
public void testSuperPropAccessFromInterface() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls/superPropAccessFromInterface.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
|
|||||||
+41
@@ -1441,6 +1441,11 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
|
|||||||
runTest("compiler/testData/codegen/bytecodeListing/jvm8/defaults/allCompatibility/deprecationWithDefault.kt");
|
runTest("compiler/testData/codegen/bytecodeListing/jvm8/defaults/allCompatibility/deprecationWithDefault.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("interfaceProperty.kt")
|
||||||
|
public void testInterfaceProperty() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/bytecodeListing/jvm8/defaults/allCompatibility/interfaceProperty.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("jvmDefaultWithoutCompatibility.kt")
|
@TestMetadata("jvmDefaultWithoutCompatibility.kt")
|
||||||
public void testJvmDefaultWithoutCompatibility() throws Exception {
|
public void testJvmDefaultWithoutCompatibility() throws Exception {
|
||||||
runTest("compiler/testData/codegen/bytecodeListing/jvm8/defaults/allCompatibility/jvmDefaultWithoutCompatibility.kt");
|
runTest("compiler/testData/codegen/bytecodeListing/jvm8/defaults/allCompatibility/jvmDefaultWithoutCompatibility.kt");
|
||||||
@@ -1474,6 +1479,42 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compiler/testData/codegen/bytecodeListing/jvm8/defaults/enable")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class Enable extends AbstractBytecodeListingTest {
|
||||||
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
|
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInEnable() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/jvm8/defaults/enable"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("interfaceProperty.kt")
|
||||||
|
public void testInterfaceProperty() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/bytecodeListing/jvm8/defaults/enable/interfaceProperty.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compiler/testData/codegen/bytecodeListing/jvm8/defaults/noDefaultImpl")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class NoDefaultImpl extends AbstractBytecodeListingTest {
|
||||||
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
|
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInNoDefaultImpl() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/jvm8/defaults/noDefaultImpl"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("interfaceProperty.kt")
|
||||||
|
public void testInterfaceProperty() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/bytecodeListing/jvm8/defaults/noDefaultImpl/interfaceProperty.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+41
@@ -1441,6 +1441,11 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
|
|||||||
runTest("compiler/testData/codegen/bytecodeListing/jvm8/defaults/allCompatibility/deprecationWithDefault.kt");
|
runTest("compiler/testData/codegen/bytecodeListing/jvm8/defaults/allCompatibility/deprecationWithDefault.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("interfaceProperty.kt")
|
||||||
|
public void testInterfaceProperty() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/bytecodeListing/jvm8/defaults/allCompatibility/interfaceProperty.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("jvmDefaultWithoutCompatibility.kt")
|
@TestMetadata("jvmDefaultWithoutCompatibility.kt")
|
||||||
public void testJvmDefaultWithoutCompatibility() throws Exception {
|
public void testJvmDefaultWithoutCompatibility() throws Exception {
|
||||||
runTest("compiler/testData/codegen/bytecodeListing/jvm8/defaults/allCompatibility/jvmDefaultWithoutCompatibility.kt");
|
runTest("compiler/testData/codegen/bytecodeListing/jvm8/defaults/allCompatibility/jvmDefaultWithoutCompatibility.kt");
|
||||||
@@ -1474,6 +1479,42 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compiler/testData/codegen/bytecodeListing/jvm8/defaults/enable")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class Enable extends AbstractIrBytecodeListingTest {
|
||||||
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
|
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInEnable() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/jvm8/defaults/enable"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("interfaceProperty.kt")
|
||||||
|
public void testInterfaceProperty() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/bytecodeListing/jvm8/defaults/enable/interfaceProperty.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compiler/testData/codegen/bytecodeListing/jvm8/defaults/noDefaultImpl")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class NoDefaultImpl extends AbstractIrBytecodeListingTest {
|
||||||
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
|
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInNoDefaultImpl() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/jvm8/defaults/noDefaultImpl"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("interfaceProperty.kt")
|
||||||
|
public void testInterfaceProperty() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/bytecodeListing/jvm8/defaults/noDefaultImpl/interfaceProperty.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java
Generated
+28
@@ -4561,6 +4561,16 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
|||||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
|
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("allAgainsAllCompatibility.kt")
|
||||||
|
public void testAllAgainsAllCompatibility() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/allAgainsAllCompatibility.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("allCompatibilityAgainsAll.kt")
|
||||||
|
public void testAllCompatibilityAgainsAll() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/allCompatibilityAgainsAll.kt");
|
||||||
|
}
|
||||||
|
|
||||||
public void testAllFilesPresentInInterop() throws Exception {
|
public void testAllFilesPresentInInterop() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||||
}
|
}
|
||||||
@@ -4600,6 +4610,24 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
|
|||||||
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/interop/newSchemeWithJvmDefault.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class NoDefaultImpls extends AbstractIrJsCodegenBoxES6Test {
|
||||||
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
|
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInNoDefaultImpls() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("superPropAccessFromInterface.kt")
|
||||||
|
public void testSuperPropAccessFromInterface() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/defaults/noDefaultImpls/superPropAccessFromInterface.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/jvm8against6")
|
@TestMetadata("compiler/testData/codegen/box/compileKotlinAgainstKotlin/jvm8/jvm8against6")
|
||||||
|
|||||||
Reference in New Issue
Block a user