[FIR2IR] Correctly map arguments of type alias constructor call

Previously, we applied type arguments as is when converting type alias
constructor calls to IR.
Now, we map them using the expansion of the type alias.

#KT-59743 Fixed
This commit is contained in:
Kirill Rakhman
2023-07-19 10:48:13 +02:00
committed by Space Team
parent b4335c86c8
commit e35a28d36d
16 changed files with 653 additions and 11 deletions
@@ -0,0 +1,148 @@
FILE fqName:<root> fileName:/TypeAliasConstructorParameterMapping.kt
TYPEALIAS name:OneToOne visibility:public expandedType:<root>.Box1<A of <root>.OneToOne>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPEALIAS name:OneToTwo visibility:public expandedType:<root>.Box2<A of <root>.OneToTwo, A of <root>.OneToTwo>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPEALIAS name:TwoToTwo visibility:public expandedType:<root>.Box2<A of <root>.TwoToTwo, B of <root>.TwoToTwo>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false
TYPEALIAS name:TwoToTwoReversed visibility:public expandedType:<root>.Box2<B of <root>.TwoToTwoReversed, A of <root>.TwoToTwoReversed>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false
TYPEALIAS name:TwoToOne visibility:public expandedType:<root>.Box1<A of <root>.TwoToOne>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false
TYPEALIAS name:OneToOneTransitive visibility:public expandedType:<root>.Box1<A of <root>.OneToOneTransitive>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPEALIAS name:TwoToTwoTransitive visibility:public expandedType:<root>.Box2<A of <root>.TwoToTwoTransitive, A of <root>.TwoToTwoTransitive>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false
TYPEALIAS name:TwoToTwoTransitive2 visibility:public expandedType:<root>.Box2<B of <root>.TwoToTwoTransitive2, B of <root>.TwoToTwoTransitive2>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false
CLASS CLASS name:Box1 modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Box1<T of <root>.Box1>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
CONSTRUCTOR visibility:public <> () returnType:<root>.Box1<T of <root>.Box1> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box1 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:Box2 modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Box2<T of <root>.Box2, R of <root>.Box2>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPE_PARAMETER name:R index:1 variance: superTypes:[kotlin.Any?] reified:false
CONSTRUCTOR visibility:public <> () returnType:<root>.Box2<T of <root>.Box2, R of <root>.Box2> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box2 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
PROPERTY name:test1 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test1 type:<root>.Box1<kotlin.Int> visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box1' type=<root>.Box1<kotlin.Int> origin=null
<class: T>: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1> visibility:public modality:FINAL <> () returnType:<root>.Box1<kotlin.Int>
correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): <root>.Box1<kotlin.Int> declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:<root>.Box1<kotlin.Int> visibility:private [final,static]' type=<root>.Box1<kotlin.Int> origin=null
PROPERTY name:test2 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test2 type:<root>.Box2<kotlin.Int, kotlin.Int> visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box2' type=<root>.Box2<kotlin.Int, kotlin.Int> origin=null
<class: T>: kotlin.Int
<class: R>: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test2> visibility:public modality:FINAL <> () returnType:<root>.Box2<kotlin.Int, kotlin.Int>
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): <root>.Box2<kotlin.Int, kotlin.Int> declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:<root>.Box2<kotlin.Int, kotlin.Int> visibility:private [final,static]' type=<root>.Box2<kotlin.Int, kotlin.Int> origin=null
PROPERTY name:test3 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test3 type:<root>.Box2<kotlin.Int, kotlin.String> visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box2' type=<root>.Box2<kotlin.Int, kotlin.String> origin=null
<class: T>: kotlin.Int
<class: R>: kotlin.String
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test3> visibility:public modality:FINAL <> () returnType:<root>.Box2<kotlin.Int, kotlin.String>
correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test3> (): <root>.Box2<kotlin.Int, kotlin.String> declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:<root>.Box2<kotlin.Int, kotlin.String> visibility:private [final,static]' type=<root>.Box2<kotlin.Int, kotlin.String> origin=null
PROPERTY name:test4 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test4 type:<root>.Box2<kotlin.String, kotlin.Int> visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box2' type=<root>.Box2<kotlin.String, kotlin.Int> origin=null
<class: T>: kotlin.String
<class: R>: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test4> visibility:public modality:FINAL <> () returnType:<root>.Box2<kotlin.String, kotlin.Int>
correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test4> (): <root>.Box2<kotlin.String, kotlin.Int> declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:<root>.Box2<kotlin.String, kotlin.Int> visibility:private [final,static]' type=<root>.Box2<kotlin.String, kotlin.Int> origin=null
PROPERTY name:test5 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test5 type:<root>.Box1<kotlin.Int> visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box1' type=<root>.Box1<kotlin.Int> origin=null
<class: T>: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test5> visibility:public modality:FINAL <> () returnType:<root>.Box1<kotlin.Int>
correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test5> (): <root>.Box1<kotlin.Int> declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:<root>.Box1<kotlin.Int> visibility:private [final,static]' type=<root>.Box1<kotlin.Int> origin=null
PROPERTY name:test6 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test6 type:<root>.Box1<kotlin.Int> visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box1' type=<root>.Box1<kotlin.Int> origin=null
<class: T>: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test6> visibility:public modality:FINAL <> () returnType:<root>.Box1<kotlin.Int>
correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test6> (): <root>.Box1<kotlin.Int> declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test6 type:<root>.Box1<kotlin.Int> visibility:private [final,static]' type=<root>.Box1<kotlin.Int> origin=null
PROPERTY name:test7 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test7 type:<root>.Box2<kotlin.Int, kotlin.Int> visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box2' type=<root>.Box2<kotlin.Int, kotlin.Int> origin=null
<class: T>: kotlin.Int
<class: R>: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test7> visibility:public modality:FINAL <> () returnType:<root>.Box2<kotlin.Int, kotlin.Int>
correspondingProperty: PROPERTY name:test7 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test7> (): <root>.Box2<kotlin.Int, kotlin.Int> declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test7 type:<root>.Box2<kotlin.Int, kotlin.Int> visibility:private [final,static]' type=<root>.Box2<kotlin.Int, kotlin.Int> origin=null
PROPERTY name:test8 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test8 type:<root>.Box2<kotlin.String, kotlin.String> visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box2' type=<root>.Box2<kotlin.String, kotlin.String> origin=null
<class: T>: kotlin.String
<class: R>: kotlin.String
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test8> visibility:public modality:FINAL <> () returnType:<root>.Box2<kotlin.String, kotlin.String>
correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test8> (): <root>.Box2<kotlin.String, kotlin.String> declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:<root>.Box2<kotlin.String, kotlin.String> visibility:private [final,static]' type=<root>.Box2<kotlin.String, kotlin.String> origin=null
@@ -0,0 +1,57 @@
typealias OneToOne<A : Any?> = Box1<A>
typealias OneToTwo<A : Any?> = Box2<A, A>
typealias TwoToTwo<A : Any?, B : Any?> = Box2<A, B>
typealias TwoToTwoReversed<A : Any?, B : Any?> = Box2<B, A>
typealias TwoToOne<A : Any?, B : Any?> = Box1<A>
typealias OneToOneTransitive<A : Any?> = Box1<A>
typealias TwoToTwoTransitive<A : Any?, B : Any?> = Box2<A, A>
typealias TwoToTwoTransitive2<A : Any?, B : Any?> = Box2<B, B>
class Box1<T : Any?> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
class Box2<T : Any?, R : Any?> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
val test1: Box1<Int>
field = Box1<Int>()
get
val test2: Box2<Int, Int>
field = Box2<Int, Int>()
get
val test3: Box2<Int, String>
field = Box2<Int, String>()
get
val test4: Box2<String, Int>
field = Box2<String, Int>()
get
val test5: Box1<Int>
field = Box1<Int>()
get
val test6: Box1<Int>
field = Box1<Int>()
get
val test7: Box2<Int, Int>
field = Box2<Int, Int>()
get
val test8: Box2<String, String>
field = Box2<String, String>()
get
@@ -0,0 +1,148 @@
FILE fqName:<root> fileName:/TypeAliasConstructorParameterMapping.kt
CLASS CLASS name:Box1 modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Box1<T of <root>.Box1>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
CONSTRUCTOR visibility:public <> () returnType:<root>.Box1<T of <root>.Box1> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box1 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:Box2 modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Box2<T of <root>.Box2, R of <root>.Box2>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPE_PARAMETER name:R index:1 variance: superTypes:[kotlin.Any?] reified:false
CONSTRUCTOR visibility:public <> () returnType:<root>.Box2<T of <root>.Box2, R of <root>.Box2> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box2 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
TYPEALIAS name:OneToOne visibility:public expandedType:<root>.Box1<A of <root>.OneToOne>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPEALIAS name:OneToTwo visibility:public expandedType:<root>.Box2<A of <root>.OneToTwo, A of <root>.OneToTwo>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPEALIAS name:TwoToTwo visibility:public expandedType:<root>.Box2<A of <root>.TwoToTwo, B of <root>.TwoToTwo>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false
TYPEALIAS name:TwoToTwoReversed visibility:public expandedType:<root>.Box2<B of <root>.TwoToTwoReversed, A of <root>.TwoToTwoReversed>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false
TYPEALIAS name:TwoToOne visibility:public expandedType:<root>.Box1<A of <root>.TwoToOne>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false
TYPEALIAS name:OneToOneTransitive visibility:public expandedType:<root>.Box1<A of <root>.OneToOneTransitive>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPEALIAS name:TwoToTwoTransitive visibility:public expandedType:<root>.Box2<A of <root>.TwoToTwoTransitive, A of <root>.TwoToTwoTransitive>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false
TYPEALIAS name:TwoToTwoTransitive2 visibility:public expandedType:<root>.Box2<B of <root>.TwoToTwoTransitive2, B of <root>.TwoToTwoTransitive2>
TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false
TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false
PROPERTY name:test1 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test1 type:<root>.Box1<kotlin.Int>{ <root>.OneToOne<kotlin.Int> } visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box1' type=<root>.Box1<kotlin.Int> origin=null
<class: T>: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1> visibility:public modality:FINAL <> () returnType:<root>.Box1<kotlin.Int>{ <root>.OneToOne<kotlin.Int> }
correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): <root>.Box1<kotlin.Int>{ <root>.OneToOne<kotlin.Int> } declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:<root>.Box1<kotlin.Int>{ <root>.OneToOne<kotlin.Int> } visibility:private [final,static]' type=<root>.Box1<kotlin.Int>{ <root>.OneToOne<kotlin.Int> } origin=null
PROPERTY name:test2 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test2 type:<root>.Box2<kotlin.Int, kotlin.Int>{ <root>.OneToTwo<kotlin.Int> } visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box2' type=<root>.Box2<kotlin.Int, kotlin.Int> origin=null
<class: T>: kotlin.Int
<class: R>: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test2> visibility:public modality:FINAL <> () returnType:<root>.Box2<kotlin.Int, kotlin.Int>{ <root>.OneToTwo<kotlin.Int> }
correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test2> (): <root>.Box2<kotlin.Int, kotlin.Int>{ <root>.OneToTwo<kotlin.Int> } declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:<root>.Box2<kotlin.Int, kotlin.Int>{ <root>.OneToTwo<kotlin.Int> } visibility:private [final,static]' type=<root>.Box2<kotlin.Int, kotlin.Int>{ <root>.OneToTwo<kotlin.Int> } origin=null
PROPERTY name:test3 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test3 type:<root>.Box2<kotlin.Int, kotlin.String>{ <root>.TwoToTwo<kotlin.Int, kotlin.String> } visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box2' type=<root>.Box2<kotlin.Int, kotlin.String> origin=null
<class: T>: kotlin.Int
<class: R>: kotlin.String
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test3> visibility:public modality:FINAL <> () returnType:<root>.Box2<kotlin.Int, kotlin.String>{ <root>.TwoToTwo<kotlin.Int, kotlin.String> }
correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test3> (): <root>.Box2<kotlin.Int, kotlin.String>{ <root>.TwoToTwo<kotlin.Int, kotlin.String> } declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:<root>.Box2<kotlin.Int, kotlin.String>{ <root>.TwoToTwo<kotlin.Int, kotlin.String> } visibility:private [final,static]' type=<root>.Box2<kotlin.Int, kotlin.String>{ <root>.TwoToTwo<kotlin.Int, kotlin.String> } origin=null
PROPERTY name:test4 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test4 type:<root>.Box2<kotlin.String, kotlin.Int>{ <root>.TwoToTwoReversed<kotlin.Int, kotlin.String> } visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box2' type=<root>.Box2<kotlin.String, kotlin.Int> origin=null
<class: T>: kotlin.String
<class: R>: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test4> visibility:public modality:FINAL <> () returnType:<root>.Box2<kotlin.String, kotlin.Int>{ <root>.TwoToTwoReversed<kotlin.Int, kotlin.String> }
correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test4> (): <root>.Box2<kotlin.String, kotlin.Int>{ <root>.TwoToTwoReversed<kotlin.Int, kotlin.String> } declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:<root>.Box2<kotlin.String, kotlin.Int>{ <root>.TwoToTwoReversed<kotlin.Int, kotlin.String> } visibility:private [final,static]' type=<root>.Box2<kotlin.String, kotlin.Int>{ <root>.TwoToTwoReversed<kotlin.Int, kotlin.String> } origin=null
PROPERTY name:test5 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test5 type:<root>.Box1<kotlin.Int>{ <root>.TwoToOne<kotlin.Int, kotlin.String> } visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box1' type=<root>.Box1<kotlin.Int> origin=null
<class: T>: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test5> visibility:public modality:FINAL <> () returnType:<root>.Box1<kotlin.Int>{ <root>.TwoToOne<kotlin.Int, kotlin.String> }
correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test5> (): <root>.Box1<kotlin.Int>{ <root>.TwoToOne<kotlin.Int, kotlin.String> } declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:<root>.Box1<kotlin.Int>{ <root>.TwoToOne<kotlin.Int, kotlin.String> } visibility:private [final,static]' type=<root>.Box1<kotlin.Int>{ <root>.TwoToOne<kotlin.Int, kotlin.String> } origin=null
PROPERTY name:test6 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test6 type:<root>.Box1<kotlin.Int>{ <root>.OneToOneTransitive<kotlin.Int> } visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box1' type=<root>.Box1<kotlin.Int> origin=null
<class: T>: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test6> visibility:public modality:FINAL <> () returnType:<root>.Box1<kotlin.Int>{ <root>.OneToOneTransitive<kotlin.Int> }
correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test6> (): <root>.Box1<kotlin.Int>{ <root>.OneToOneTransitive<kotlin.Int> } declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test6 type:<root>.Box1<kotlin.Int>{ <root>.OneToOneTransitive<kotlin.Int> } visibility:private [final,static]' type=<root>.Box1<kotlin.Int>{ <root>.OneToOneTransitive<kotlin.Int> } origin=null
PROPERTY name:test7 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test7 type:<root>.Box2<kotlin.Int, kotlin.Int>{ <root>.TwoToTwoTransitive<kotlin.Int, kotlin.String> } visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box2' type=<root>.Box2<kotlin.Int, kotlin.Int> origin=null
<class: T>: kotlin.Int
<class: R>: kotlin.Int
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test7> visibility:public modality:FINAL <> () returnType:<root>.Box2<kotlin.Int, kotlin.Int>{ <root>.TwoToTwoTransitive<kotlin.Int, kotlin.String> }
correspondingProperty: PROPERTY name:test7 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test7> (): <root>.Box2<kotlin.Int, kotlin.Int>{ <root>.TwoToTwoTransitive<kotlin.Int, kotlin.String> } declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test7 type:<root>.Box2<kotlin.Int, kotlin.Int>{ <root>.TwoToTwoTransitive<kotlin.Int, kotlin.String> } visibility:private [final,static]' type=<root>.Box2<kotlin.Int, kotlin.Int>{ <root>.TwoToTwoTransitive<kotlin.Int, kotlin.String> } origin=null
PROPERTY name:test8 visibility:public modality:FINAL [val]
FIELD PROPERTY_BACKING_FIELD name:test8 type:<root>.Box2<kotlin.String, kotlin.String>{ <root>.TwoToTwoTransitive2<kotlin.Int, kotlin.String> } visibility:private [final,static]
EXPRESSION_BODY
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Box2' type=<root>.Box2<kotlin.String, kotlin.String> origin=null
<class: T>: kotlin.String
<class: R>: kotlin.String
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test8> visibility:public modality:FINAL <> () returnType:<root>.Box2<kotlin.String, kotlin.String>{ <root>.TwoToTwoTransitive2<kotlin.Int, kotlin.String> }
correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [val]
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-test8> (): <root>.Box2<kotlin.String, kotlin.String>{ <root>.TwoToTwoTransitive2<kotlin.Int, kotlin.String> } declared in <root>'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:<root>.Box2<kotlin.String, kotlin.String>{ <root>.TwoToTwoTransitive2<kotlin.Int, kotlin.String> } visibility:private [final,static]' type=<root>.Box2<kotlin.String, kotlin.String>{ <root>.TwoToTwoTransitive2<kotlin.Int, kotlin.String> } origin=null
@@ -0,0 +1,23 @@
// WITH_STDLIB
// TARGET_BACKEND: JVM_IR
class Box1<T>()
class Box2<T, R>()
typealias OneToOne<A> = Box1<A>
typealias OneToTwo<A> = Box2<A, A>
typealias TwoToTwo<A, B> = Box2<A, B>
typealias TwoToTwoReversed<A, B> = Box2<B, A>
typealias TwoToOne<A, B> = Box1<A>
typealias OneToOneTransitive<A> = TwoToOne<A, A>
typealias TwoToTwoTransitive<A, B> = OneToTwo<A>
typealias TwoToTwoTransitive2<A, B> = OneToTwo<B>
val test1 = OneToOne<Int>()
val test2 = OneToTwo<Int>()
val test3 = TwoToTwo<Int, String>()
val test4 = TwoToTwoReversed<Int, String>()
val test5 = TwoToOne<Int, String>()
val test6 = OneToOneTransitive<Int>()
val test7 = TwoToTwoTransitive<Int, String>()
val test8 = TwoToTwoTransitive2<Int, String>()
@@ -0,0 +1,57 @@
class Box1<T : Any?> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
class Box2<T : Any?, R : Any?> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
typealias OneToOne<A : Any?> = Box1<A>
typealias OneToTwo<A : Any?> = Box2<A, A>
typealias TwoToTwo<A : Any?, B : Any?> = Box2<A, B>
typealias TwoToTwoReversed<A : Any?, B : Any?> = Box2<B, A>
typealias TwoToOne<A : Any?, B : Any?> = Box1<A>
typealias OneToOneTransitive<A : Any?> = Box1<A>
typealias TwoToTwoTransitive<A : Any?, B : Any?> = Box2<A, A>
typealias TwoToTwoTransitive2<A : Any?, B : Any?> = Box2<B, B>
val test1: Box1<Int>
field = Box1<Int>()
get
val test2: Box2<Int, Int>
field = Box2<Int, Int>()
get
val test3: Box2<Int, String>
field = Box2<Int, String>()
get
val test4: Box2<String, Int>
field = Box2<String, Int>()
get
val test5: Box1<Int>
field = Box1<Int>()
get
val test6: Box1<Int>
field = Box1<Int>()
get
val test7: Box2<Int, Int>
field = Box2<Int, Int>()
get
val test8: Box2<String, String>
field = Box2<String, String>()
get
@@ -0,0 +1,144 @@
// CHECK:
// Mangled name: {}test1
// Public signature: /test1|6005685442305498193[0]
// Public signature debug description: {}test1
val test1: Box1<Int>
// CHECK JVM_IR:
// Mangled name: #<get-test1>(){}Box1<kotlin.Int>
// Public signature: /test1.<get-test1>|-5747887246888681086[0]
// Public signature debug description: <get-test1>(){}Box1<kotlin.Int>
get
// CHECK:
// Mangled name: {}test2
// Public signature: /test2|2517758057000911509[0]
// Public signature debug description: {}test2
val test2: Box2<Int, Int>
// CHECK JVM_IR:
// Mangled name: #<get-test2>(){}Box2<kotlin.Int,kotlin.Int>
// Public signature: /test2.<get-test2>|-8093967936013127700[0]
// Public signature debug description: <get-test2>(){}Box2<kotlin.Int,kotlin.Int>
get
// CHECK:
// Mangled name: {}test3
// Public signature: /test3|7677556066983021166[0]
// Public signature debug description: {}test3
val test3: Box2<Int, String>
// CHECK JVM_IR:
// Mangled name: #<get-test3>(){}Box2<kotlin.Int,kotlin.String>
// Public signature: /test3.<get-test3>|7330124542622364329[0]
// Public signature debug description: <get-test3>(){}Box2<kotlin.Int,kotlin.String>
get
// CHECK:
// Mangled name: {}test4
// Public signature: /test4|-9115637610245762085[0]
// Public signature debug description: {}test4
val test4: Box2<String, Int>
// CHECK JVM_IR:
// Mangled name: #<get-test4>(){}Box2<kotlin.String,kotlin.Int>
// Public signature: /test4.<get-test4>|8274992131610048705[0]
// Public signature debug description: <get-test4>(){}Box2<kotlin.String,kotlin.Int>
get
// CHECK:
// Mangled name: {}test5
// Public signature: /test5|4734809624271551895[0]
// Public signature debug description: {}test5
val test5: Box1<Int>
// CHECK JVM_IR:
// Mangled name: #<get-test5>(){}Box1<kotlin.Int>
// Public signature: /test5.<get-test5>|-4135615187810921358[0]
// Public signature debug description: <get-test5>(){}Box1<kotlin.Int>
get
// CHECK:
// Mangled name: {}test6
// Public signature: /test6|-2606527149405855403[0]
// Public signature debug description: {}test6
val test6: Box1<Int>
// CHECK JVM_IR:
// Mangled name: #<get-test6>(){}Box1<kotlin.Int>
// Public signature: /test6.<get-test6>|4872700098972426138[0]
// Public signature debug description: <get-test6>(){}Box1<kotlin.Int>
get
// CHECK:
// Mangled name: {}test7
// Public signature: /test7|1362036650170262859[0]
// Public signature debug description: {}test7
val test7: Box2<Int, Int>
// CHECK JVM_IR:
// Mangled name: #<get-test7>(){}Box2<kotlin.Int,kotlin.Int>
// Public signature: /test7.<get-test7>|-3283424550561018351[0]
// Public signature debug description: <get-test7>(){}Box2<kotlin.Int,kotlin.Int>
get
// CHECK:
// Mangled name: {}test8
// Public signature: /test8|5640428216506241852[0]
// Public signature debug description: {}test8
val test8: Box2<String, String>
// CHECK JVM_IR:
// Mangled name: #<get-test8>(){}Box2<kotlin.String,kotlin.String>
// Public signature: /test8.<get-test8>|3315637717268921363[0]
// Public signature debug description: <get-test8>(){}Box2<kotlin.String,kotlin.String>
get
// CHECK:
// Mangled name: Box1
// Public signature: /Box1|null[0]
class Box1<T : Any?> {
// CHECK:
// Mangled name: Box1#<init>(){}
// Public signature: /Box1.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
}
// CHECK:
// Mangled name: Box2
// Public signature: /Box2|null[0]
class Box2<T : Any?, R : Any?> {
// CHECK:
// Mangled name: Box2#<init>(){}
// Public signature: /Box2.<init>|-5645683436151566731[0]
// Public signature debug description: <init>(){}
constructor() /* primary */
}
// CHECK:
// Mangled name: OneToOne
// Public signature: /OneToOne|null[0]
typealias OneToOne<A : Any?> = Box1<A>
// CHECK:
// Mangled name: OneToOneTransitive
// Public signature: /OneToOneTransitive|null[0]
typealias OneToOneTransitive<A : Any?> = Box1<A>
// CHECK:
// Mangled name: OneToTwo
// Public signature: /OneToTwo|null[0]
typealias OneToTwo<A : Any?> = Box2<A, A>
// CHECK:
// Mangled name: TwoToOne
// Public signature: /TwoToOne|null[0]
typealias TwoToOne<A : Any?, B : Any?> = Box1<A>
// CHECK:
// Mangled name: TwoToTwo
// Public signature: /TwoToTwo|null[0]
typealias TwoToTwo<A : Any?, B : Any?> = Box2<A, B>
// CHECK:
// Mangled name: TwoToTwoReversed
// Public signature: /TwoToTwoReversed|null[0]
typealias TwoToTwoReversed<A : Any?, B : Any?> = Box2<B, A>
// CHECK:
// Mangled name: TwoToTwoTransitive
// Public signature: /TwoToTwoTransitive|null[0]
typealias TwoToTwoTransitive<A : Any?, B : Any?> = Box2<A, A>
// CHECK:
// Mangled name: TwoToTwoTransitive2
// Public signature: /TwoToTwoTransitive2|null[0]
typealias TwoToTwoTransitive2<A : Any?, B : Any?> = Box2<B, B>