[Test] Reproduce KT-65207

This commit is contained in:
Dmitriy Novozhilov
2024-02-16 09:36:47 +02:00
committed by Space Team
parent be1d8e2894
commit 9302c8c14d
11 changed files with 261 additions and 0 deletions
@@ -110,6 +110,24 @@ public class LLFirNativeTestGenerated extends AbstractLLFirNativeTest {
runTest("compiler/testData/diagnostics/nativeTests/objCName5.kt");
}
@Test
@TestMetadata("objCName6.kt")
public void testObjCName6() {
runTest("compiler/testData/diagnostics/nativeTests/objCName6.kt");
}
@Test
@TestMetadata("objCNameWIthDifferentSwiftName.kt")
public void testObjCNameWIthDifferentSwiftName() {
runTest("compiler/testData/diagnostics/nativeTests/objCNameWIthDifferentSwiftName.kt");
}
@Test
@TestMetadata("objCNameWithTwoModules.kt")
public void testObjCNameWithTwoModules() {
runTest("compiler/testData/diagnostics/nativeTests/objCNameWithTwoModules.kt");
}
@Test
@TestMetadata("objCRefinement.kt")
public void testObjCRefinement() {
@@ -110,6 +110,24 @@ public class LLFirReversedNativeTestGenerated extends AbstractLLFirReversedNativ
runTest("compiler/testData/diagnostics/nativeTests/objCName5.kt");
}
@Test
@TestMetadata("objCName6.kt")
public void testObjCName6() {
runTest("compiler/testData/diagnostics/nativeTests/objCName6.kt");
}
@Test
@TestMetadata("objCNameWIthDifferentSwiftName.kt")
public void testObjCNameWIthDifferentSwiftName() {
runTest("compiler/testData/diagnostics/nativeTests/objCNameWIthDifferentSwiftName.kt");
}
@Test
@TestMetadata("objCNameWithTwoModules.kt")
public void testObjCNameWithTwoModules() {
runTest("compiler/testData/diagnostics/nativeTests/objCNameWithTwoModules.kt");
}
@Test
@TestMetadata("objCRefinement.kt")
public void testObjCRefinement() {
@@ -2704,6 +2704,12 @@ public class FirLightTreeJvmIrTextTestGenerated extends AbstractFirLightTreeJvmI
runTest("compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRawJavaCollection.kt");
}
@Test
@TestMetadata("intersectionWithJava.kt")
public void testIntersectionWithJava() {
runTest("compiler/testData/ir/irText/fakeOverrides/intersectionWithJava.kt");
}
@Test
@TestMetadata("intersectionWithMappedSignature.kt")
public void testIntersectionWithMappedSignature() {
@@ -2704,6 +2704,12 @@ public class FirPsiJvmIrTextTestGenerated extends AbstractFirPsiJvmIrTextTest {
runTest("compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRawJavaCollection.kt");
}
@Test
@TestMetadata("intersectionWithJava.kt")
public void testIntersectionWithJava() {
runTest("compiler/testData/ir/irText/fakeOverrides/intersectionWithJava.kt");
}
@Test
@TestMetadata("intersectionWithMappedSignature.kt")
public void testIntersectionWithMappedSignature() {
@@ -0,0 +1,55 @@
FILE fqName:<root> fileName:/1.kt
CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[<root>.Java1<R of <root>.C>; <root>.KotlinInterface<R of <root>.C>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C<R of <root>.C>
TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false
CONSTRUCTOR visibility:public <> () returnType:<root>.C<R of <root>.C> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java1'
<T>: R of <root>.C
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[<root>.Java1<R of <root>.C>; <root>.KotlinInterface<R of <root>.C>]'
FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:<root>.Java1<R of <root>.C>) returnType:@[FlexibleNullability] java.util.ArrayList<@[FlexibleNullability] kotlin.Int?>? [fake_override]
overridden:
public open fun bar (): @[FlexibleNullability] java.util.ArrayList<@[FlexibleNullability] kotlin.Int?>? declared in <root>.Java1
public abstract fun bar (): java.util.ArrayList<kotlin.Int> declared in <root>.KotlinInterface
$this: VALUE_PARAMETER name:<this> type:<root>.Java1<R of <root>.C>
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Java1
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.KotlinInterface
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:<root>.Java1<R of <root>.C>) returnType:@[FlexibleNullability] R of <root>.C? [fake_override]
overridden:
public open fun foo (): @[FlexibleNullability] T of <root>.Java1? declared in <root>.Java1
public abstract fun foo (): T of <root>.KotlinInterface declared in <root>.KotlinInterface
$this: VALUE_PARAMETER name:<this> type:<root>.Java1<R of <root>.C>
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in <root>.Java1
public open fun hashCode (): kotlin.Int declared in <root>.KotlinInterface
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in <root>.Java1
public open fun toString (): kotlin.String declared in <root>.KotlinInterface
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS INTERFACE name:KotlinInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.KotlinInterface<T of <root>.KotlinInterface>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:bar visibility:public modality:ABSTRACT <> ($this:<root>.KotlinInterface<T of <root>.KotlinInterface>) returnType:java.util.ArrayList<kotlin.Int>
$this: VALUE_PARAMETER name:<this> type:<root>.KotlinInterface<T of <root>.KotlinInterface>
FUN name:foo visibility:public modality:ABSTRACT <> ($this:<root>.KotlinInterface<T of <root>.KotlinInterface>) returnType:T of <root>.KotlinInterface
$this: VALUE_PARAMETER name:<this> type:<root>.KotlinInterface<T of <root>.KotlinInterface>
@@ -0,0 +1,16 @@
abstract class C<R : Any?> : Java1<R>, KotlinInterface<R> {
constructor() /* primary */ {
super/*Java1*/<R>()
/* <init>() */
}
}
interface KotlinInterface<T : Any?> {
abstract fun bar(): ArrayList<Int>
abstract fun foo(): T
}
@@ -0,0 +1,55 @@
FILE fqName:<root> fileName:/1.kt
CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[<root>.Java1<R of <root>.C>; <root>.KotlinInterface<R of <root>.C>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C<R of <root>.C>
TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false
CONSTRUCTOR visibility:public <> () returnType:<root>.C<R of <root>.C> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java1'
<T>: @[FlexibleNullability] R of <root>.C?
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[<root>.Java1<R of <root>.C>; <root>.KotlinInterface<R of <root>.C>]'
FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:<root>.KotlinInterface<R of <root>.C>) returnType:java.util.ArrayList<kotlin.Int> [fake_override]
overridden:
public open fun bar (): @[FlexibleNullability] java.util.ArrayList<@[FlexibleNullability] kotlin.Int?>? declared in <root>.Java1
public abstract fun bar (): java.util.ArrayList<kotlin.Int> declared in <root>.KotlinInterface
$this: VALUE_PARAMETER name:<this> type:<root>.KotlinInterface<R of <root>.C>
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.Java1
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.KotlinInterface
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:<root>.KotlinInterface<R of <root>.C>) returnType:R of <root>.C [fake_override]
overridden:
public open fun foo (): @[FlexibleNullability] T of <root>.Java1? declared in <root>.Java1
public abstract fun foo (): T of <root>.KotlinInterface declared in <root>.KotlinInterface
$this: VALUE_PARAMETER name:<this> type:<root>.KotlinInterface<R of <root>.C>
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in <root>.Java1
public open fun hashCode (): kotlin.Int declared in <root>.KotlinInterface
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in <root>.Java1
public open fun toString (): kotlin.String declared in <root>.KotlinInterface
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS INTERFACE name:KotlinInterface modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.KotlinInterface<T of <root>.KotlinInterface>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:bar visibility:public modality:ABSTRACT <> ($this:<root>.KotlinInterface<T of <root>.KotlinInterface>) returnType:java.util.ArrayList<kotlin.Int>
$this: VALUE_PARAMETER name:<this> type:<root>.KotlinInterface<T of <root>.KotlinInterface>
FUN name:foo visibility:public modality:ABSTRACT <> ($this:<root>.KotlinInterface<T of <root>.KotlinInterface>) returnType:T of <root>.KotlinInterface
$this: VALUE_PARAMETER name:<this> type:<root>.KotlinInterface<T of <root>.KotlinInterface>
@@ -0,0 +1,23 @@
// TARGET_BACKEND: JVM
// ENABLE_IR_FAKE_OVERRIDE_GENERATION
// ISSUE: KT-65207
// FILE: Java1.java
import java.util.ArrayList;
public class Java1<T> {
public T foo() {
return null;
}
public ArrayList<Integer> bar() {
return null;
};
}
// FILE: 1.kt
abstract class C<R> : Java1<R>(), KotlinInterface<R>
interface KotlinInterface<T> {
fun foo(): T
fun bar(): ArrayList<Int>
}
@@ -0,0 +1,16 @@
abstract class C<R : Any?> : Java1<R>, KotlinInterface<R> {
constructor() /* primary */ {
super/*Java1*/<@FlexibleNullability R?>()
/* <init>() */
}
}
interface KotlinInterface<T : Any?> {
abstract fun bar(): ArrayList<Int>
abstract fun foo(): T
}
@@ -0,0 +1,42 @@
// CHECK:
// Mangled name: C
// Public signature: /C|null[0]
abstract class C<R : Any?> : Java1<R>, KotlinInterface<R> {
// CHECK:
// Mangled name: C#<init>(){}
// Public signature: /C.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
// CHECK JVM_IR:
// Mangled name: C#bar(){}java.util.ArrayList<kotlin.Int?>?
// Public signature: /C.bar|6344786471503787921[0]
// Public signature debug description: bar(){}java.util.ArrayList<kotlin.Int?>?
/* fake */ override fun bar(): ArrayList<Int?>?
// CHECK JVM_IR:
// Mangled name: C#foo(){}1:0?
// Public signature: /C.foo|-1179576840814333363[0]
// Public signature debug description: foo(){}1:0?
/* fake */ override fun foo(): R?
}
// CHECK:
// Mangled name: KotlinInterface
// Public signature: /KotlinInterface|null[0]
interface KotlinInterface<T : Any?> {
// CHECK JVM_IR:
// Mangled name: KotlinInterface#bar(){}java.util.ArrayList<kotlin.Int>
// Public signature: /KotlinInterface.bar|3123552224271008170[0]
// Public signature debug description: bar(){}java.util.ArrayList<kotlin.Int>
abstract fun bar(): ArrayList<Int>
// CHECK JVM_IR:
// Mangled name: KotlinInterface#foo(){}1:0
// Public signature: /KotlinInterface.foo|-5478580208809996038[0]
// Public signature debug description: foo(){}1:0
abstract fun foo(): T
}
@@ -2704,6 +2704,12 @@ public class ClassicJvmIrTextTestGenerated extends AbstractClassicJvmIrTextTest
runTest("compiler/testData/ir/irText/fakeOverrides/fakeOverrideOfRawJavaCollection.kt");
}
@Test
@TestMetadata("intersectionWithJava.kt")
public void testIntersectionWithJava() {
runTest("compiler/testData/ir/irText/fakeOverrides/intersectionWithJava.kt");
}
@Test
@TestMetadata("intersectionWithMappedSignature.kt")
public void testIntersectionWithMappedSignature() {