K2: don't count use-sites of Java type parameter with nullable bounds as not null

This commit is contained in:
Mikhail Glukhikh
2024-03-08 13:41:25 +01:00
committed by Space Team
parent d353fd400d
commit c4bcdc42c1
14 changed files with 413 additions and 70 deletions
@@ -93,20 +93,20 @@ FILE fqName:<root> fileName:/1.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java3'
<T>: kotlin.Int?
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public superTypes:[<root>.Java3<kotlin.Int?>]'
FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:<root>.Java3<kotlin.Int?>) returnType:@[EnhancedNullability] kotlin.Int? [fake_override]
FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:<root>.Java3<kotlin.Int?>) returnType:@[FlexibleNullability] kotlin.Int? [fake_override]
overridden:
public open fun bar (): @[EnhancedNullability] T of <root>.Java3 declared in <root>.Java3
public open fun bar (): @[FlexibleNullability] T of <root>.Java3? declared in <root>.Java3
$this: VALUE_PARAMETER name:<this> type:<root>.Java3<kotlin.Int?>
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>.Java3
$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>.Java3<kotlin.Int?>, s:@[EnhancedNullability] kotlin.Int?) returnType:kotlin.Unit [fake_override]
FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:<root>.Java3<kotlin.Int?>, s:@[FlexibleNullability] kotlin.Int?) returnType:kotlin.Unit [fake_override]
overridden:
public open fun foo (s: @[EnhancedNullability] T of <root>.Java3): kotlin.Unit declared in <root>.Java3
public open fun foo (s: @[FlexibleNullability] T of <root>.Java3?): kotlin.Unit declared in <root>.Java3
$this: VALUE_PARAMETER name:<this> type:<root>.Java3<kotlin.Int?>
VALUE_PARAMETER name:s index:0 type:@[EnhancedNullability] kotlin.Int?
VALUE_PARAMETER name:s index:0 type:@[FlexibleNullability] kotlin.Int?
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>.Java3
@@ -122,20 +122,20 @@ FILE fqName:<root> fileName:/1.kt
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java3'
<T>: kotlin.Int
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:E modality:FINAL visibility:public superTypes:[<root>.Java3<kotlin.Int>]'
FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:<root>.Java3<kotlin.Int>) returnType:@[EnhancedNullability] kotlin.Int [fake_override]
FUN FAKE_OVERRIDE name:bar visibility:public modality:OPEN <> ($this:<root>.Java3<kotlin.Int>) returnType:@[FlexibleNullability] kotlin.Int? [fake_override]
overridden:
public open fun bar (): @[EnhancedNullability] T of <root>.Java3 declared in <root>.Java3
public open fun bar (): @[FlexibleNullability] T of <root>.Java3? declared in <root>.Java3
$this: VALUE_PARAMETER name:<this> type:<root>.Java3<kotlin.Int>
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>.Java3
$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>.Java3<kotlin.Int>, s:@[EnhancedNullability] kotlin.Int) returnType:kotlin.Unit [fake_override]
FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:<root>.Java3<kotlin.Int>, s:@[FlexibleNullability] kotlin.Int?) returnType:kotlin.Unit [fake_override]
overridden:
public open fun foo (s: @[EnhancedNullability] T of <root>.Java3): kotlin.Unit declared in <root>.Java3
public open fun foo (s: @[FlexibleNullability] T of <root>.Java3?): kotlin.Unit declared in <root>.Java3
$this: VALUE_PARAMETER name:<this> type:<root>.Java3<kotlin.Int>
VALUE_PARAMETER name:s index:0 type:@[EnhancedNullability] kotlin.Int
VALUE_PARAMETER name:s index:0 type:@[FlexibleNullability] kotlin.Int?
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>.Java3
@@ -246,23 +246,23 @@ FILE fqName:<root> fileName:/1.kt
$this: GET_VAR 'c: <root>.C declared in <root>.test' type=<root>.C origin=null
s: CONST Int type=kotlin.Int value=1
VAR name:k7 type:kotlin.Int? [val]
GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[EnhancedNullability] T of <root>.Java3 visibility:public' type=@[EnhancedNullability] kotlin.Int? origin=null
GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[FlexibleNullability] T of <root>.Java3? visibility:public' type=@[FlexibleNullability] kotlin.Int? origin=null
receiver: GET_VAR 'd: <root>.D declared in <root>.test' type=<root>.D origin=null
VAR name:k8 type:kotlin.Int? [val]
CALL 'public open fun bar (): @[EnhancedNullability] kotlin.Int? declared in <root>.D' type=@[EnhancedNullability] kotlin.Int? origin=null
CALL 'public open fun bar (): @[FlexibleNullability] kotlin.Int? declared in <root>.D' type=@[FlexibleNullability] kotlin.Int? origin=null
$this: GET_VAR 'd: <root>.D declared in <root>.test' type=<root>.D origin=null
CALL 'public open fun foo (s: @[EnhancedNullability] kotlin.Int?): kotlin.Unit declared in <root>.D' type=kotlin.Unit origin=null
CALL 'public open fun foo (s: @[FlexibleNullability] kotlin.Int?): kotlin.Unit declared in <root>.D' type=kotlin.Unit origin=null
$this: GET_VAR 'd: <root>.D declared in <root>.test' type=<root>.D origin=null
s: CONST Null type=kotlin.Nothing? value=null
VAR name:k9 type:kotlin.Int [val]
TYPE_OP type=kotlin.Int origin=IMPLICIT_NOTNULL typeOperand=kotlin.Int
GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[EnhancedNullability] T of <root>.Java3 visibility:public' type=@[EnhancedNullability] kotlin.Int origin=null
GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[FlexibleNullability] T of <root>.Java3? visibility:public' type=@[FlexibleNullability] kotlin.Int? origin=null
receiver: GET_VAR 'e: <root>.E declared in <root>.test' type=<root>.E origin=null
VAR name:k10 type:kotlin.Int [val]
TYPE_OP type=kotlin.Int origin=IMPLICIT_NOTNULL typeOperand=kotlin.Int
CALL 'public open fun bar (): @[EnhancedNullability] kotlin.Int declared in <root>.E' type=@[EnhancedNullability] kotlin.Int origin=null
CALL 'public open fun bar (): @[FlexibleNullability] kotlin.Int? declared in <root>.E' type=@[FlexibleNullability] kotlin.Int? origin=null
$this: GET_VAR 'e: <root>.E declared in <root>.test' type=<root>.E origin=null
CALL 'public open fun foo (s: @[EnhancedNullability] kotlin.Int): kotlin.Unit declared in <root>.E' type=kotlin.Unit origin=null
CALL 'public open fun foo (s: @[FlexibleNullability] kotlin.Int?): kotlin.Unit declared in <root>.E' type=kotlin.Unit origin=null
$this: GET_VAR 'e: <root>.E declared in <root>.test' type=<root>.E origin=null
s: CONST Int type=kotlin.Int value=1
VAR name:k11 type:kotlin.Int [val]
@@ -0,0 +1,173 @@
// CHECK:
// Mangled name: A
// Public signature: /A|null[0]
class A : Java1<Int> {
// CHECK:
// Mangled name: A#<init>(){}
// Public signature: /A.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
// CHECK JVM_IR:
// Mangled name: A#bar(){}kotlin.Int{EnhancedNullability}
// Public signature: /A.bar|-8608075298013083950[0]
// Public signature debug description: bar(){}kotlin.Int{EnhancedNullability}
/* fake */ override fun bar(): @EnhancedNullability Int
// CHECK:
// Mangled name: A#foo(kotlin.Int{EnhancedNullability}){}
// Public signature: /A.foo|6054053236451526699[0]
// Public signature debug description: foo(kotlin.Int{EnhancedNullability}){}
/* fake */ override fun foo(s: @EnhancedNullability Int): Unit
}
// CHECK:
// Mangled name: B
// Public signature: /B|null[0]
class B<T : Any> : Java1<T> {
// CHECK:
// Mangled name: B#<init>(){}
// Public signature: /B.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
// CHECK JVM_IR:
// Mangled name: B#bar(){}1:0{EnhancedNullability}
// Public signature: /B.bar|582597716914558172[0]
// Public signature debug description: bar(){}1:0{EnhancedNullability}
/* fake */ override fun bar(): @EnhancedNullability T
// CHECK:
// Mangled name: B#foo(1:0{EnhancedNullability}){}
// Public signature: /B.foo|-5059967198211209740[0]
// Public signature debug description: foo(1:0{EnhancedNullability}){}
/* fake */ override fun foo(s: @EnhancedNullability T): Unit
}
// CHECK:
// Mangled name: C
// Public signature: /C|null[0]
class C : Java2 {
// 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(){}kotlin.Int{EnhancedNullability}
// Public signature: /C.bar|-8608075298013083950[0]
// Public signature debug description: bar(){}kotlin.Int{EnhancedNullability}
/* fake */ override fun bar(): @EnhancedNullability Int
// CHECK:
// Mangled name: C#foo(kotlin.Int{EnhancedNullability}){}
// Public signature: /C.foo|6054053236451526699[0]
// Public signature debug description: foo(kotlin.Int{EnhancedNullability}){}
/* fake */ override fun foo(s: @EnhancedNullability Int): Unit
}
// CHECK:
// Mangled name: D
// Public signature: /D|null[0]
class D : Java3<Int?> {
// CHECK:
// Mangled name: D#<init>(){}
// Public signature: /D.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
// CHECK JVM_IR:
// Mangled name: D#bar(){}kotlin.Int?
// Public signature: /D.bar|793910862689138186[0]
// Public signature debug description: bar(){}kotlin.Int?
/* fake */ override fun bar(): Int?
// CHECK:
// Mangled name: D#foo(kotlin.Int?){}
// Public signature: /D.foo|-4109638554625433529[0]
// Public signature debug description: foo(kotlin.Int?){}
/* fake */ override fun foo(s: Int?): Unit
}
// CHECK:
// Mangled name: E
// Public signature: /E|null[0]
class E : Java3<Int> {
// CHECK:
// Mangled name: E#<init>(){}
// Public signature: /E.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
// CHECK JVM_IR:
// Mangled name: E#bar(){}kotlin.Int?
// Public signature: /E.bar|793910862689138186[0]
// Public signature debug description: bar(){}kotlin.Int?
/* fake */ override fun bar(): Int?
// CHECK:
// Mangled name: E#foo(kotlin.Int?){}
// Public signature: /E.foo|-4109638554625433529[0]
// Public signature debug description: foo(kotlin.Int?){}
/* fake */ override fun foo(s: Int?): Unit
}
// CHECK:
// Mangled name: F
// Public signature: /F|null[0]
class F : Java4<Int> {
// CHECK:
// Mangled name: F#<init>(){}
// Public signature: /F.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
// CHECK JVM_IR:
// Mangled name: F#bar(){}kotlin.Int{EnhancedNullability}
// Public signature: /F.bar|-8608075298013083950[0]
// Public signature debug description: bar(){}kotlin.Int{EnhancedNullability}
/* fake */ override fun bar(): @EnhancedNullability Int
// CHECK:
// Mangled name: F#foo(kotlin.Int{EnhancedNullability}){}
// Public signature: /F.foo|6054053236451526699[0]
// Public signature debug description: foo(kotlin.Int{EnhancedNullability}){}
/* fake */ override fun foo(s: @EnhancedNullability Int): Unit
}
// CHECK:
// Mangled name: G
// Public signature: /G|null[0]
class G<T : Number> : Java4<T> {
// CHECK:
// Mangled name: G#<init>(){}
// Public signature: /G.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
// CHECK JVM_IR:
// Mangled name: G#bar(){}1:0{EnhancedNullability}
// Public signature: /G.bar|582597716914558172[0]
// Public signature debug description: bar(){}1:0{EnhancedNullability}
/* fake */ override fun bar(): @EnhancedNullability T
// CHECK:
// Mangled name: G#foo(1:0{EnhancedNullability}){}
// Public signature: /G.foo|-5059967198211209740[0]
// Public signature debug description: foo(1:0{EnhancedNullability}){}
/* fake */ override fun foo(s: @EnhancedNullability T): Unit
}
// CHECK:
// Mangled name: #test(A;B<kotlin.String>;C;D;E;F;G<kotlin.Int>){}
// Public signature: /test|-5249852593213170382[0]
// Public signature debug description: test(A;B<kotlin.String>;C;D;E;F;G<kotlin.Int>){}
fun test(a: A, b: B<String>, c: C, d: D, e: E, f: F, g: G<Int>): Unit
@@ -1,4 +1,5 @@
// TARGET_BACKEND: JVM
// SEPARATE_SIGNATURE_DUMP_FOR_K2
// FILE: Java1.java
import org.jetbrains.annotations.NotNull;
@@ -0,0 +1,114 @@
FILE fqName:<root> fileName:/test.kt
CLASS CLASS name:Inv modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Inv<T of <root>.Inv>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:T of <root>.Inv visibility:private [final]
EXPRESSION_BODY
GET_VAR 'x: T of <root>.Inv declared in <root>.Inv.<init>' type=T of <root>.Inv origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:<root>.Inv<T of <root>.Inv>) returnType:T of <root>.Inv
correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Inv<T of <root>.Inv>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-x> (): T of <root>.Inv declared in <root>.Inv'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of <root>.Inv visibility:private [final]' type=T of <root>.Inv origin=null
receiver: GET_VAR '<this>: <root>.Inv<T of <root>.Inv> declared in <root>.Inv.<get-x>' type=<root>.Inv<T of <root>.Inv> origin=null
CONSTRUCTOR visibility:public <> (x:T of <root>.Inv) returnType:<root>.Inv<T of <root>.Inv> [primary]
VALUE_PARAMETER name:x index:0 type:T of <root>.Inv
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inv modality:FINAL visibility:public superTypes:[kotlin.Any]'
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
CLASS CLASS name:Test_1 modality:FINAL visibility:public superTypes:[<root>.JavaClass1<TT of <root>.Test_1>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test_1<TT of <root>.Test_1>
TYPE_PARAMETER name:TT index:0 variance: superTypes:[kotlin.Any?] reified:false
PROPERTY name:x visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:x type:TT of <root>.Test_1 visibility:private [final]
EXPRESSION_BODY
GET_VAR 'x: TT of <root>.Test_1 declared in <root>.Test_1.<init>' type=TT of <root>.Test_1 origin=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-x> visibility:public modality:FINAL <> ($this:<root>.Test_1<TT of <root>.Test_1>) returnType:TT of <root>.Test_1
correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val]
$this: VALUE_PARAMETER name:<this> type:<root>.Test_1<TT of <root>.Test_1>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-x> (): TT of <root>.Test_1 declared in <root>.Test_1'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:TT of <root>.Test_1 visibility:private [final]' type=TT of <root>.Test_1 origin=null
receiver: GET_VAR '<this>: <root>.Test_1<TT of <root>.Test_1> declared in <root>.Test_1.<get-x>' type=<root>.Test_1<TT of <root>.Test_1> origin=null
CONSTRUCTOR visibility:public <> (x:TT of <root>.Test_1) returnType:<root>.Test_1<TT of <root>.Test_1> [primary]
VALUE_PARAMETER name:x index:0 type:TT of <root>.Test_1
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.JavaClass1'
<T>: TT of <root>.Test_1
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test_1 modality:FINAL visibility:public superTypes:[<root>.JavaClass1<TT of <root>.Test_1>]'
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>.JavaClass1
$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 <root>.JavaClass1
$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>.JavaClass1
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test visibility:public modality:FINAL <> ($this:<root>.Test_1<TT of <root>.Test_1>, b:<root>.JavaClass1.B<TT of <root>.Test_1>) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Test_1<TT of <root>.Test_1>
VALUE_PARAMETER name:b index:0 type:<root>.JavaClass1.B<TT of <root>.Test_1>
BLOCK_BODY
CALL 'public open fun output (x: @[FlexibleNullability] T of <root>.JavaClass1?): kotlin.Unit declared in <root>.JavaClass1.B' type=kotlin.Unit origin=null
$this: GET_VAR 'b: <root>.JavaClass1.B<TT of <root>.Test_1> declared in <root>.Test_1.test' type=<root>.JavaClass1.B<TT of <root>.Test_1> origin=null
x: CALL 'public final fun <get-x> (): TT of <root>.Test_1 declared in <root>.Test_1' type=TT of <root>.Test_1 origin=GET_PROPERTY
$this: GET_VAR '<this>: <root>.Test_1<TT of <root>.Test_1> declared in <root>.Test_1.test' type=<root>.Test_1<TT of <root>.Test_1> origin=null
CLASS CLASS name:Test_2 modality:FINAL visibility:public superTypes:[<root>.JavaClass2<TT of <root>.Test_2, <root>.Inv<TT of <root>.Test_2>>]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Test_2<TT of <root>.Test_2>
TYPE_PARAMETER name:TT index:0 variance: superTypes:[kotlin.Any?] reified:false
CONSTRUCTOR visibility:public <> () returnType:<root>.Test_2<TT of <root>.Test_2> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.JavaClass2'
<T>: TT of <root>.Test_2
<R>: <root>.Inv<TT of <root>.Test_2>
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test_2 modality:FINAL visibility:public superTypes:[<root>.JavaClass2<TT of <root>.Test_2, <root>.Inv<TT of <root>.Test_2>>]'
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>.JavaClass2
$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 <root>.JavaClass2
$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>.JavaClass2
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:process visibility:public modality:FINAL <> ($this:<root>.Test_2<TT of <root>.Test_2>, b:<root>.JavaClass2.B<TT of <root>.Test_2, <root>.Inv<TT of <root>.Test_2>>) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Test_2<TT of <root>.Test_2>
VALUE_PARAMETER name:b index:0 type:<root>.JavaClass2.B<TT of <root>.Test_2, <root>.Inv<TT of <root>.Test_2>>
BLOCK_BODY
CALL 'public abstract fun output (output: @[FlexibleNullability] R of <root>.JavaClass2?): kotlin.Unit declared in <root>.JavaClass2.B' type=kotlin.Unit origin=null
$this: GET_VAR 'b: <root>.JavaClass2.B<TT of <root>.Test_2, <root>.Inv<TT of <root>.Test_2>> declared in <root>.Test_2.process' type=<root>.JavaClass2.B<TT of <root>.Test_2, <root>.Inv<TT of <root>.Test_2>> origin=null
output: CONSTRUCTOR_CALL 'public constructor <init> (x: T of <root>.Inv) declared in <root>.Inv' type=<root>.Inv<TT of <root>.Test_2> origin=null
<class: T>: TT of <root>.Test_2
x: CALL 'public abstract fun element (): @[FlexibleNullability] T of <root>.JavaClass2? declared in <root>.JavaClass2.B' type=@[FlexibleNullability] TT of <root>.Test_2? origin=null
$this: GET_VAR 'b: <root>.JavaClass2.B<TT of <root>.Test_2, <root>.Inv<TT of <root>.Test_2>> declared in <root>.Test_2.process' type=<root>.JavaClass2.B<TT of <root>.Test_2, <root>.Inv<TT of <root>.Test_2>> origin=null
FUN name:test_3 visibility:public modality:FINAL <R> (jb:<root>.JavaClass1.B<R of <root>.test_3>, r:R of <root>.test_3) returnType:kotlin.Unit
TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] reified:false
VALUE_PARAMETER name:jb index:0 type:<root>.JavaClass1.B<R of <root>.test_3>
VALUE_PARAMETER name:r index:1 type:R of <root>.test_3
BLOCK_BODY
CALL 'public open fun output (x: @[FlexibleNullability] T of <root>.JavaClass1?): kotlin.Unit declared in <root>.JavaClass1.B' type=kotlin.Unit origin=null
$this: GET_VAR 'jb: <root>.JavaClass1.B<R of <root>.test_3> declared in <root>.test_3' type=<root>.JavaClass1.B<R of <root>.test_3> origin=null
x: GET_VAR 'r: R of <root>.test_3 declared in <root>.test_3' type=R of <root>.test_3 origin=null
@@ -0,0 +1,46 @@
class Inv<T : Any?> {
val x: T
field = x
get
constructor(x: T) /* primary */ {
super/*Any*/()
/* <init>() */
}
}
class Test_1<TT : Any?> : JavaClass1<TT> {
val x: TT
field = x
get
constructor(x: TT) /* primary */ {
super/*JavaClass1*/<TT>()
/* <init>() */
}
fun test(b: B<TT>) {
b.output(x = <this>.<get-x>())
}
}
class Test_2<TT : Any?> : JavaClass2<TT, Inv<TT>> {
constructor() /* primary */ {
super/*JavaClass2*/<TT, Inv<TT>>()
/* <init>() */
}
fun process(b: B<TT, Inv<TT>>) {
b.output(output = Inv<TT>(x = b.element()))
}
}
fun <R : Any?> test_3(jb: B<R>, r: R) {
jb.output(x = r)
}
@@ -1,4 +1,3 @@
// FIR_IDENTICAL
// TARGET_BACKEND: JVM_IR
// ISSUE: KT-57022