[FIR2IR] Generate IR declarations in classes in strict order
Order is following: - declared declarations in declaration (in source) order - generated declarations in sorted order
This commit is contained in:
committed by
Space Team
parent
c961c15729
commit
839026b6fe
@@ -0,0 +1,84 @@
|
||||
FILE fqName:test fileName:/declarationOrder.kt
|
||||
CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:test.A
|
||||
CONSTRUCTOR visibility:public <> () returnType:test.A [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]'
|
||||
CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:test.A
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in test.A'
|
||||
FUN name:b visibility:public modality:FINAL <> ($this:test.A) returnType:kotlin.Unit
|
||||
$this: VALUE_PARAMETER name:<this> type:test.A
|
||||
BLOCK_BODY
|
||||
FUN name:a visibility:public modality:FINAL <> ($this:test.A) returnType:kotlin.Unit
|
||||
$this: VALUE_PARAMETER name:<this> type:test.A
|
||||
BLOCK_BODY
|
||||
PROPERTY name:b visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=1
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-b> visibility:public modality:FINAL <> ($this:test.A) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:b visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:test.A
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-b> (): kotlin.Int declared in test.A'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:b type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: test.A declared in test.A.<get-b>' type=test.A origin=null
|
||||
PROPERTY name:a visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
CONST Int type=kotlin.Int value=2
|
||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-a> visibility:public modality:FINAL <> ($this:test.A) returnType:kotlin.Int
|
||||
correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:test.A
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-a> (): kotlin.Int declared in test.A'
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
|
||||
receiver: GET_VAR '<this>: test.A declared in test.A.<get-a>' type=test.A origin=null
|
||||
CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:test.A
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.String
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in test.A'
|
||||
PROPERTY name:b visibility:public modality:FINAL [val]
|
||||
FUN name:<get-b> visibility:public modality:FINAL <> ($this:test.A, $receiver:kotlin.Int) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:b visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:test.A
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-b> (): kotlin.String declared in test.A'
|
||||
CONST String type=kotlin.String value="b"
|
||||
FUN name:b visibility:public modality:FINAL <> ($this:test.A, $receiver:kotlin.String) returnType:kotlin.Unit
|
||||
$this: VALUE_PARAMETER name:<this> type:test.A
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
|
||||
BLOCK_BODY
|
||||
PROPERTY name:a visibility:public modality:FINAL [val]
|
||||
FUN name:<get-a> visibility:public modality:FINAL <> ($this:test.A, $receiver:kotlin.Int) returnType:kotlin.String
|
||||
correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val]
|
||||
$this: VALUE_PARAMETER name:<this> type:test.A
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun <get-a> (): kotlin.String declared in test.A'
|
||||
CONST String type=kotlin.String value="a"
|
||||
FUN name:a visibility:public modality:FINAL <> ($this:test.A, $receiver:kotlin.String) returnType:kotlin.Unit
|
||||
$this: VALUE_PARAMETER name:<this> type:test.A
|
||||
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
|
||||
BLOCK_BODY
|
||||
CONSTRUCTOR visibility:public <> (x:kotlin.Double) returnType:test.A
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.Double
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in test.A'
|
||||
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 [operator] 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
|
||||
@@ -0,0 +1,19 @@
|
||||
// FIR_IDENTICAL
|
||||
// SKIP_KLIB_TEST
|
||||
// IGNORE_BACKEND_K1: JS_IR
|
||||
// Ignore reason: there is a js name clash between function `a()` and property `a`
|
||||
package test
|
||||
|
||||
class A() {
|
||||
constructor(x: Int) : this()
|
||||
fun b() {}
|
||||
fun a() {}
|
||||
val b: Int = 1
|
||||
val a: Int = 2
|
||||
constructor(x: String) : this()
|
||||
val Int.b: String get() = "b"
|
||||
fun String.b() {}
|
||||
val Int.a: String get() = "a"
|
||||
fun String.a() {}
|
||||
constructor(x: Double) : this()
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package test
|
||||
|
||||
class A {
|
||||
constructor() /* primary */ {
|
||||
super/*Any*/()
|
||||
/* <init>() */
|
||||
|
||||
}
|
||||
|
||||
constructor(x: Int) {
|
||||
this/*A*/()
|
||||
}
|
||||
|
||||
fun b() {
|
||||
}
|
||||
|
||||
fun a() {
|
||||
}
|
||||
|
||||
val b: Int
|
||||
field = 1
|
||||
get
|
||||
|
||||
val a: Int
|
||||
field = 2
|
||||
get
|
||||
|
||||
constructor(x: String) {
|
||||
this/*A*/()
|
||||
}
|
||||
|
||||
val Int.b: String
|
||||
get(): String {
|
||||
return "b"
|
||||
}
|
||||
|
||||
fun String.b() {
|
||||
}
|
||||
|
||||
val Int.a: String
|
||||
get(): String {
|
||||
return "a"
|
||||
}
|
||||
|
||||
fun String.a() {
|
||||
}
|
||||
|
||||
constructor(x: Double) {
|
||||
this/*A*/()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user