Prohibit using references to this from outer scope in contract declarations

This commit is contained in:
Dmitriy Novozhilov
2019-12-26 13:15:52 +03:00
parent f083edfac2
commit 9c1b68f839
7 changed files with 139 additions and 3 deletions
@@ -1175,6 +1175,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("accessToOuterThis.kt")
public void testAccessToOuterThis() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/accessToOuterThis.kt");
}
public void testAllFilesPresentInErrors() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@@ -1175,6 +1175,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("accessToOuterThis.kt")
public void testAccessToOuterThis() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/accessToOuterThis.kt");
}
public void testAllFilesPresentInErrors() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}