[FIR] Generate java declarations for record components of java records
^KT-53964 Fixed
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
FILE fqName:<root> fileName:/recordPropertyAccess.kt
|
||||
FUN name:test_1 visibility:public modality:FINAL <> (rec:<root>.MyRec) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:rec index:0 type:<root>.MyRec
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun name (): @[FlexibleNullability] kotlin.String? declared in <root>.MyRec' type=@[FlexibleNullability] kotlin.String? origin=GET_PROPERTY
|
||||
$this: GET_VAR 'rec: <root>.MyRec declared in <root>.test_1' type=<root>.MyRec origin=null
|
||||
FUN name:test_2 visibility:public modality:FINAL <> (rec:<root>.MyRec) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:rec index:0 type:<root>.MyRec
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public final fun name (): @[FlexibleNullability] kotlin.String? declared in <root>.MyRec' type=@[FlexibleNullability] kotlin.String? origin=null
|
||||
$this: GET_VAR 'rec: <root>.MyRec declared in <root>.test_2' type=<root>.MyRec origin=null
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun test_1(rec: MyRec) {
|
||||
rec.name() /*~> Unit */
|
||||
}
|
||||
|
||||
fun test_2(rec: MyRec) {
|
||||
rec.name() /*~> Unit */
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
FILE fqName:<root> fileName:/recordPropertyAccess.kt
|
||||
FUN name:test_1 visibility:public modality:FINAL <> (rec:<root>.MyRec) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:rec index:0 type:<root>.MyRec
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public open fun name (): @[FlexibleNullability] kotlin.String? declared in <root>.MyRec' type=@[FlexibleNullability] kotlin.String? origin=GET_PROPERTY
|
||||
$this: GET_VAR 'rec: <root>.MyRec declared in <root>.test_1' type=<root>.MyRec origin=null
|
||||
FUN name:test_2 visibility:public modality:FINAL <> (rec:<root>.MyRec) returnType:kotlin.Unit
|
||||
VALUE_PARAMETER name:rec index:0 type:<root>.MyRec
|
||||
BLOCK_BODY
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
CALL 'public open fun name (): @[FlexibleNullability] kotlin.String? declared in <root>.MyRec' type=@[FlexibleNullability] kotlin.String? origin=null
|
||||
$this: GET_VAR 'rec: <root>.MyRec declared in <root>.test_2' type=<root>.MyRec origin=null
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// JDK_KIND: FULL_JDK_17
|
||||
// FILE: MyRec.java
|
||||
public record MyRec(String name) {}
|
||||
|
||||
// FILE: recordPropertyAccess.kt
|
||||
fun test_1(rec: MyRec) {
|
||||
rec.name
|
||||
}
|
||||
|
||||
fun test_2(rec: MyRec) {
|
||||
rec.name()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun test_1(rec: MyRec) {
|
||||
rec.name() /*~> Unit */
|
||||
}
|
||||
|
||||
fun test_2(rec: MyRec) {
|
||||
rec.name() /*~> Unit */
|
||||
}
|
||||
Reference in New Issue
Block a user