FIR checker: reproduce KT-42348

This commit is contained in:
Jinseong Jeon
2020-09-30 23:06:51 -07:00
committed by Dmitriy Novozhilov
parent be84110ada
commit a154cf4c45
6 changed files with 50 additions and 0 deletions
@@ -3839,6 +3839,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/assignedInFinally.kt");
}
@TestMetadata("assignedInIfElse.kt")
public void testAssignedInIfElse() throws Exception {
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/assignedInIfElse.kt");
}
@TestMetadata("assignmentInLocalsInConstructor.kt")
public void testAssignmentInLocalsInConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/assignmentInLocalsInConstructor.kt");
@@ -0,0 +1,16 @@
fun foo(arg: Boolean) {
val x : Int
if (arg) {
x = 4
} else {
x = 2
}
x.hashCode()
class Local {
fun bar() {
<!UNINITIALIZED_VARIABLE!>x<!>.hashCode()
}
}
}
@@ -0,0 +1,16 @@
fun foo(arg: Boolean) {
val x : Int
if (arg) {
x = 4
} else {
x = 2
}
x.hashCode()
class Local {
fun bar() {
x.hashCode()
}
}
}
@@ -0,0 +1,3 @@
package
public fun foo(/*0*/ arg: kotlin.Boolean): kotlin.Unit
@@ -3846,6 +3846,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/assignedInFinally.kt");
}
@TestMetadata("assignedInIfElse.kt")
public void testAssignedInIfElse() throws Exception {
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/assignedInIfElse.kt");
}
@TestMetadata("assignmentInLocalsInConstructor.kt")
public void testAssignmentInLocalsInConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/assignmentInLocalsInConstructor.kt");
@@ -3841,6 +3841,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/assignedInFinally.kt");
}
@TestMetadata("assignedInIfElse.kt")
public void testAssignedInIfElse() throws Exception {
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/assignedInIfElse.kt");
}
@TestMetadata("assignmentInLocalsInConstructor.kt")
public void testAssignmentInLocalsInConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/assignmentInLocalsInConstructor.kt");