Don't try parsing contract-like function not from kotlin package
Returning `null` from `doCheckContract` functions means that we have failed to parse contract function and should report an error, but if the called function isn't true contract, we shouldn't evaluate that code at all. #KT-27758 Fixed
This commit is contained in:
committed by
Dmitry Savvinov
parent
d82ca9ccd0
commit
bae3ff5211
+5
@@ -1112,6 +1112,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/contracts/dsl"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("callUsualContractFunction.kt")
|
||||
public void testCallUsualContractFunction() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("useBeforeDeclaration.kt")
|
||||
public void testUseBeforeDeclaration() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/useBeforeDeclaration.kt");
|
||||
|
||||
compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java
Generated
+5
@@ -1112,6 +1112,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/contracts/dsl"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("callUsualContractFunction.kt")
|
||||
public void testCallUsualContractFunction() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("useBeforeDeclaration.kt")
|
||||
public void testUseBeforeDeclaration() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/useBeforeDeclaration.kt");
|
||||
|
||||
Reference in New Issue
Block a user