FIR checker: reproduce KT-42348
This commit is contained in:
committed by
Dmitriy Novozhilov
parent
be84110ada
commit
a154cf4c45
+5
@@ -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");
|
||||
|
||||
+16
@@ -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");
|
||||
|
||||
Generated
+5
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user