K2: add test confirming successful work of KT-56261
This commit is contained in:
committed by
Space Team
parent
314784f435
commit
2405f28e64
+6
@@ -2866,6 +2866,12 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/localVariable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("localVariableInSecondaryConstructor.kt")
|
||||
public void testLocalVariableInSecondaryConstructor() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/localVariableInSecondaryConstructor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("manyLocalVariables.kt")
|
||||
public void testManyLocalVariables() throws Exception {
|
||||
|
||||
+5
@@ -2512,6 +2512,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/localVariable.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("localVariableInSecondaryConstructor.kt")
|
||||
public void testLocalVariableInSecondaryConstructor() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/localVariableInSecondaryConstructor.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("manyLocalVariables.kt")
|
||||
public void testManyLocalVariables() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/manyLocalVariables.kt");
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
FILE: localVariableInSecondaryConstructor.kt
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
lval localVariable: R|kotlin/Int| = Int(0)
|
||||
local final class LocalClass : R|kotlin/Any| {
|
||||
public constructor(arg: R|kotlin/Int|): R|LocalClass| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val arg: R|kotlin/Int| = R|<local>/arg|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
public constructor(): R|LocalClass| {
|
||||
this<R|LocalClass|>(R|<local>/localVariable|)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
R|/LocalClass.LocalClass|().R|<local>/arg|
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
fun main() {
|
||||
|
||||
val localVariable = 0
|
||||
|
||||
class LocalClass(val arg: Int) {
|
||||
constructor() : this(localVariable)
|
||||
}
|
||||
|
||||
LocalClass().arg
|
||||
}
|
||||
+6
@@ -2866,6 +2866,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/localVariable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("localVariableInSecondaryConstructor.kt")
|
||||
public void testLocalVariableInSecondaryConstructor() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/localVariableInSecondaryConstructor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("manyLocalVariables.kt")
|
||||
public void testManyLocalVariables() throws Exception {
|
||||
|
||||
+6
@@ -2866,6 +2866,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/localVariable.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("localVariableInSecondaryConstructor.kt")
|
||||
public void testLocalVariableInSecondaryConstructor() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/localVariableInSecondaryConstructor.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("manyLocalVariables.kt")
|
||||
public void testManyLocalVariables() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user