[IR] Split const folding into necessary one and for optimizations only
In this commit we have a lot of change in test data. This was caused by the way where we evaluate constants. We split constant evaluation into two distinct parts: only necessary evaluations for `fir2ir` (like const val and annotations) and optimizations for lowering. Now we don't do all constant evaluation on `fir2ir`, but IR dump is executed after this phase, so test data changed. #KT-58923
This commit is contained in:
+4
-2
@@ -139,10 +139,12 @@ FILE fqName:<root> fileName:/dataClassMembers.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in <root>.Test'
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
CONST String type=kotlin.String value="Test(x="
|
||||
CONST String type=kotlin.String value="Test("
|
||||
CONST String type=kotlin.String value="x="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:T of <root>.Test visibility:private [final]' type=T of <root>.Test origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test<T of <root>.Test> declared in <root>.Test.toString' type=<root>.Test<T of <root>.Test> origin=null
|
||||
CONST String type=kotlin.String value=", y="
|
||||
CONST String type=kotlin.String value=", "
|
||||
CONST String type=kotlin.String value="y="
|
||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test<T of <root>.Test> declared in <root>.Test.toString' type=<root>.Test<T of <root>.Test> origin=null
|
||||
CONST String type=kotlin.String value=")"
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ data class Test<T : Any?> {
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "Test(x=" + <this>.#x + ", y=" + <this>.#y + ")"
|
||||
return "Test(" + "x=" + <this>.#x + ", " + "y=" + <this>.#y + ")"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user