JVM_IR: Do not add redundant field initializers.
Initializers are "set field" expressions and are considered redundant when they are: 1. In the primary constructor; and 2. Set the field to `0`, `false`, or `null`; and 3. Have a `null` origin. I.e., not in an initializer block or constructor body, and therefore the field could not have been set by a prior expression.
This commit is contained in:
committed by
max-kammerer
parent
9e8972f1f9
commit
e91a16556c
@@ -329,6 +329,11 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
|
||||
runTest("compiler/testData/codegen/bytecodeText/redundantInitializerNumber.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("redundantValInitializer.kt")
|
||||
public void testRedundantValInitializer() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/redundantValInitializer.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("reifiedAsCheck.kt")
|
||||
public void testReifiedAsCheck() throws Exception {
|
||||
runTest("compiler/testData/codegen/bytecodeText/reifiedAsCheck.kt");
|
||||
|
||||
Reference in New Issue
Block a user