FIR: fix contract deserialization for assertIs<T>
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
|||||||
|
FILE: assertIs.kt
|
||||||
|
public final fun foo(arg: R|kotlin/Any|): R|kotlin/Unit| {
|
||||||
|
R|kotlin/test/assertIs|<R|kotlin/String|>(R|<local>/arg|, String())
|
||||||
|
R|<local>/arg|.R|kotlin/String.length|
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import kotlin.test.*
|
||||||
|
|
||||||
|
fun foo(arg: Any) {
|
||||||
|
assertIs<String>(arg, "")
|
||||||
|
arg.length
|
||||||
|
}
|
||||||
+6
@@ -5445,6 +5445,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("assertIs.kt")
|
||||||
|
public void testAssertIs() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts/assertIs.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("tryWithLambdaInside.kt")
|
@TestMetadata("tryWithLambdaInside.kt")
|
||||||
public void testTryWithLambdaInside() throws Exception {
|
public void testTryWithLambdaInside() throws Exception {
|
||||||
|
|||||||
+6
@@ -5445,6 +5445,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("assertIs.kt")
|
||||||
|
public void testAssertIs() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts/assertIs.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("tryWithLambdaInside.kt")
|
@TestMetadata("tryWithLambdaInside.kt")
|
||||||
public void testTryWithLambdaInside() throws Exception {
|
public void testTryWithLambdaInside() throws Exception {
|
||||||
|
|||||||
+1
@@ -426,6 +426,7 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
|||||||
versionRequirementsTable = c.versionRequirementTable
|
versionRequirementsTable = c.versionRequirementTable
|
||||||
}
|
}
|
||||||
if (proto.hasContract()) {
|
if (proto.hasContract()) {
|
||||||
|
val contractDeserializer = if (proto.typeParameterList.isEmpty()) this.contractDeserializer else FirContractDeserializer(local)
|
||||||
val contractDescription = contractDeserializer.loadContract(proto.contract, simpleFunction)
|
val contractDescription = contractDeserializer.loadContract(proto.contract, simpleFunction)
|
||||||
if (contractDescription != null) {
|
if (contractDescription != null) {
|
||||||
simpleFunction.replaceContractDescription(contractDescription)
|
simpleFunction.replaceContractDescription(contractDescription)
|
||||||
|
|||||||
+6
@@ -5445,6 +5445,12 @@ public class DiagnosisCompilerFirTestdataTestGenerated extends AbstractDiagnosis
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("assertIs.kt")
|
||||||
|
public void testAssertIs() throws Exception {
|
||||||
|
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts/assertIs.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("tryWithLambdaInside.kt")
|
@TestMetadata("tryWithLambdaInside.kt")
|
||||||
public void testTryWithLambdaInside() throws Exception {
|
public void testTryWithLambdaInside() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user