[FIR] Fix nullability of types produced by ConeRawScopeSubstitutor
#KT-66067 Fixed
This commit is contained in:
committed by
Space Team
parent
b6a6b12f0f
commit
5bca945d05
@@ -0,0 +1,56 @@
|
||||
FILE fqName:<root> fileName:/1.kt
|
||||
CLASS CLASS name:A modality:FINAL visibility:public superTypes:[<root>.Java2]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.A [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java2'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[<root>.Java2]'
|
||||
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>.Java2
|
||||
$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<kotlin.Any>, t:@[FlexibleNullability] kotlin.Number?) returnType:kotlin.Unit [fake_override]
|
||||
overridden:
|
||||
public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in <root>.Java2
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Java1<kotlin.Any>
|
||||
VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number?
|
||||
FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:<root>.Java2, t:@[FlexibleNullability] kotlin.Any?) returnType:kotlin.Unit [fake_override]
|
||||
overridden:
|
||||
public open fun foo (t: @[FlexibleNullability] kotlin.Any?): kotlin.Unit declared in <root>.Java2
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Java2
|
||||
VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] 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>.Java2
|
||||
$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>.Java2
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS CLASS name:KotlinClass modality:OPEN visibility:public superTypes:[<root>.Java1<T of <root>.KotlinClass>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.KotlinClass<T of <root>.KotlinClass>
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Number] reified:false
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.KotlinClass<T of <root>.KotlinClass> [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java1'
|
||||
<T>: T of <root>.KotlinClass
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KotlinClass modality:OPEN visibility:public superTypes:[<root>.Java1<T of <root>.KotlinClass>]'
|
||||
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
|
||||
$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<T of <root>.KotlinClass>, t:@[FlexibleNullability] T of <root>.KotlinClass?) returnType:kotlin.Unit [fake_override]
|
||||
overridden:
|
||||
public open fun foo (t: @[FlexibleNullability] T of <root>.Java1?): kotlin.Unit declared in <root>.Java1
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Java1<T of <root>.KotlinClass>
|
||||
VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of <root>.KotlinClass?
|
||||
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
|
||||
$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
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
@@ -0,0 +1,17 @@
|
||||
class A : Java2 {
|
||||
constructor() /* primary */ {
|
||||
super/*Java2*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
open class KotlinClass<T : Number> : Java1<T> {
|
||||
constructor() /* primary */ {
|
||||
super/*Java1*/<T>()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// CHECK:
|
||||
// Mangled name: A
|
||||
// Public signature: /A|null[0]
|
||||
class A : Java2 {
|
||||
// CHECK:
|
||||
// Mangled name: A#<init>(){}
|
||||
// Public signature: /A.<init>|-5645683436151566731[0]
|
||||
// Public signature debug description: <init>(){}
|
||||
constructor() /* primary */
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: A#foo(kotlin.Number?){}
|
||||
// Public signature: /A.foo|2831167016207060641[0]
|
||||
// Public signature debug description: foo(kotlin.Number?){}
|
||||
/* fake */ override fun foo(t: Number?): Unit
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: A#foo(kotlin.Any?){}
|
||||
// Public signature: /A.foo|-6211124056249407422[0]
|
||||
// Public signature debug description: foo(kotlin.Any?){}
|
||||
/* fake */ override fun foo(t: Any?): Unit
|
||||
|
||||
}
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: KotlinClass
|
||||
// Public signature: /KotlinClass|null[0]
|
||||
open class KotlinClass<T : Number> : Java1<T> {
|
||||
// CHECK:
|
||||
// Mangled name: KotlinClass#<init>(){}
|
||||
// Public signature: /KotlinClass.<init>|-5645683436151566731[0]
|
||||
// Public signature debug description: <init>(){}
|
||||
constructor() /* primary */
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: KotlinClass#foo(1:0?){}
|
||||
// Public signature: /KotlinClass.foo|-131141195414545503[0]
|
||||
// Public signature debug description: foo(1:0?){}
|
||||
/* fake */ override fun foo(t: T?): Unit
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
FILE fqName:<root> fileName:/1.kt
|
||||
CLASS CLASS name:A modality:FINAL visibility:public superTypes:[<root>.Java2]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.A [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java2'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[<root>.Java2]'
|
||||
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>.Java2
|
||||
$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>.Java2, t:@[FlexibleNullability] kotlin.Any?) returnType:kotlin.Unit [fake_override]
|
||||
overridden:
|
||||
public open fun foo (t: @[FlexibleNullability] kotlin.Any?): kotlin.Unit declared in <root>.Java2
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Java2
|
||||
VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:@[RawType] <root>.Java1<@[FlexibleNullability] kotlin.Number?>, t:@[FlexibleNullability] kotlin.Number?) returnType:kotlin.Unit [fake_override]
|
||||
overridden:
|
||||
public open fun foo (t: @[FlexibleNullability] kotlin.Number?): kotlin.Unit declared in <root>.Java2
|
||||
$this: VALUE_PARAMETER name:<this> type:@[RawType] <root>.Java1<@[FlexibleNullability] kotlin.Number?>
|
||||
VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] kotlin.Number?
|
||||
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>.Java2
|
||||
$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>.Java2
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS CLASS name:KotlinClass modality:OPEN visibility:public superTypes:[<root>.Java1<T of <root>.KotlinClass>]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.KotlinClass<T of <root>.KotlinClass>
|
||||
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Number] reified:false
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.KotlinClass<T of <root>.KotlinClass> [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Java1'
|
||||
<T>: @[FlexibleNullability] T of <root>.KotlinClass?
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KotlinClass modality:OPEN visibility:public superTypes:[<root>.Java1<T of <root>.KotlinClass>]'
|
||||
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
|
||||
$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<T of <root>.KotlinClass>, t:@[FlexibleNullability] T of <root>.KotlinClass?) returnType:kotlin.Unit [fake_override]
|
||||
overridden:
|
||||
public open fun foo (t: @[FlexibleNullability] T of <root>.Java1?): kotlin.Unit declared in <root>.Java1
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Java1<T of <root>.KotlinClass>
|
||||
VALUE_PARAMETER name:t index:0 type:@[FlexibleNullability] T of <root>.KotlinClass?
|
||||
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
|
||||
$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
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
@@ -0,0 +1,20 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// ISSUE: KT-66067
|
||||
// SCOPE_DUMP: A:foo
|
||||
// SEPARATE_SIGNATURE_DUMP_FOR_K2
|
||||
// FILE: Java1.java
|
||||
public class Java1<T extends Number> {
|
||||
public void foo(T t) {
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Java2.java
|
||||
public class Java2 extends KotlinClass {
|
||||
public void foo(Object t) {
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
class A : Java2() // Kotlin ← Java ← Kotlin ← Java
|
||||
|
||||
open class KotlinClass<T> : Java1<T>() where T: Number
|
||||
@@ -0,0 +1,17 @@
|
||||
class A : Java2 {
|
||||
constructor() /* primary */ {
|
||||
super/*Java2*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
open class KotlinClass<T : Number> : Java1<T> {
|
||||
constructor() /* primary */ {
|
||||
super/*Java1*/<@FlexibleNullability T?>()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
A:
|
||||
[Enhancement]: public open fun foo(t: R|kotlin/Any!|): R|kotlin/Unit| from Use site scope of /A [id: 0]
|
||||
[Enhancement]: public open fun foo(t: R|kotlin/Any!|): R|kotlin/Unit| from Java enhancement scope for /Java2 [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public open override fun foo(t: R|kotlin/Number!|): R|kotlin/Unit| from Use site scope of /A [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public open override fun foo(t: R|kotlin/Number!|): R|kotlin/Unit| from Java enhancement scope for /Java2 [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public open override fun foo(t: R|kotlin/Number!|): R|kotlin/Unit| from Substitution scope for [Use site scope of /KotlinClass] for type Java2 [id: 0]
|
||||
[SubstitutionOverride(DeclarationSite)]: public open override fun foo(t: R|ft<T & Any, T?>|): R|kotlin/Unit| from Use site scope of /KotlinClass [id: 1]
|
||||
[SubstitutionOverride(DeclarationSite)]: public open override fun foo(t: R|ft<T & Any, T?>|): R|kotlin/Unit| from Substitution scope for [Java enhancement scope for /Java1] for type KotlinClass<T> [id: 1]
|
||||
[Enhancement]: public open fun foo(t: R|ft<T & Any, T?>|): R|kotlin/Unit| from Java enhancement scope for /Java1 [id: 2]
|
||||
@@ -0,0 +1,42 @@
|
||||
// CHECK:
|
||||
// Mangled name: A
|
||||
// Public signature: /A|null[0]
|
||||
class A : Java2 {
|
||||
// CHECK:
|
||||
// Mangled name: A#<init>(){}
|
||||
// Public signature: /A.<init>|-5645683436151566731[0]
|
||||
// Public signature debug description: <init>(){}
|
||||
constructor() /* primary */
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: A#foo(kotlin.Any?){}
|
||||
// Public signature: /A.foo|-6211124056249407422[0]
|
||||
// Public signature debug description: foo(kotlin.Any?){}
|
||||
/* fake */ override fun foo(t: Any?): Unit
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: A#foo(kotlin.Number?){}
|
||||
// Public signature: /A.foo|2831167016207060641[0]
|
||||
// Public signature debug description: foo(kotlin.Number?){}
|
||||
/* fake */ override fun foo(t: Number?): Unit
|
||||
|
||||
}
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: KotlinClass
|
||||
// Public signature: /KotlinClass|null[0]
|
||||
open class KotlinClass<T : Number> : Java1<T> {
|
||||
// CHECK:
|
||||
// Mangled name: KotlinClass#<init>(){}
|
||||
// Public signature: /KotlinClass.<init>|-5645683436151566731[0]
|
||||
// Public signature debug description: <init>(){}
|
||||
constructor() /* primary */
|
||||
|
||||
// CHECK:
|
||||
// Mangled name: KotlinClass#foo(1:0?){}
|
||||
// Public signature: /KotlinClass.foo|-131141195414545503[0]
|
||||
// Public signature debug description: foo(1:0?){}
|
||||
/* fake */ override fun foo(t: T?): Unit
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user