[FIR TEST] Add problematic test describing KT-36881
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
class Some
|
||||||
|
|
||||||
|
fun foo(): () -> Boolean {
|
||||||
|
val s = Some()
|
||||||
|
if (true) {
|
||||||
|
return { if (s is Some) true else false }
|
||||||
|
} else {
|
||||||
|
return { true }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
FILE: typesInLocalFunctions.kt
|
||||||
|
public final class Some : R|kotlin/Any| {
|
||||||
|
public constructor(): R|Some| {
|
||||||
|
super<R|kotlin/Any|>()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public final fun foo(): R|() -> kotlin/Boolean| {
|
||||||
|
lval s: R|Some| = R|/Some.Some|()
|
||||||
|
when () {
|
||||||
|
Boolean(true) -> {
|
||||||
|
^foo fun <implicit>.<anonymous>(): <implicit> {
|
||||||
|
when () {
|
||||||
|
(s# is Some) -> {
|
||||||
|
Boolean(true)
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
Boolean(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
^foo fun <implicit>.<anonymous>(): <implicit> {
|
||||||
|
Boolean(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+5
@@ -1303,6 +1303,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
|
|||||||
public void testJavaAccessorConversion() throws Exception {
|
public void testJavaAccessorConversion() throws Exception {
|
||||||
runTest("compiler/fir/resolve/testData/resolve/problems/javaAccessorConversion.kt");
|
runTest("compiler/fir/resolve/testData/resolve/problems/javaAccessorConversion.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("typesInLocalFunctions.kt")
|
||||||
|
public void testTypesInLocalFunctions() throws Exception {
|
||||||
|
runTest("compiler/fir/resolve/testData/resolve/problems/typesInLocalFunctions.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/fir/resolve/testData/resolve/references")
|
@TestMetadata("compiler/fir/resolve/testData/resolve/references")
|
||||||
|
|||||||
Generated
+5
@@ -1303,6 +1303,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
|||||||
public void testJavaAccessorConversion() throws Exception {
|
public void testJavaAccessorConversion() throws Exception {
|
||||||
runTest("compiler/fir/resolve/testData/resolve/problems/javaAccessorConversion.kt");
|
runTest("compiler/fir/resolve/testData/resolve/problems/javaAccessorConversion.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("typesInLocalFunctions.kt")
|
||||||
|
public void testTypesInLocalFunctions() throws Exception {
|
||||||
|
runTest("compiler/fir/resolve/testData/resolve/problems/typesInLocalFunctions.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/fir/resolve/testData/resolve/references")
|
@TestMetadata("compiler/fir/resolve/testData/resolve/references")
|
||||||
|
|||||||
Reference in New Issue
Block a user