diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsKlibCompilerWithScopeExpansionRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsKlibCompilerWithScopeExpansionRunnerTestGenerated.java index 837c552caad..bde87d51121 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsKlibCompilerWithScopeExpansionRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJsKlibCompilerWithScopeExpansionRunnerTestGenerated.java @@ -891,4 +891,53 @@ public class IncrementalJsKlibCompilerWithScopeExpansionRunnerTestGenerated exte } } } + + @TestMetadata("jps-plugin/testData/incremental/scopeExpansion") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ScopeExpansion extends AbstractIncrementalJsKlibCompilerWithScopeExpansionRunnerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInScopeExpansion() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/scopeExpansion"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true); + } + + @TestMetadata("changeTypeAliasAndUsage") + public void testChangeTypeAliasAndUsage() throws Exception { + runTest("jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/"); + } + + @TestMetadata("protectedBecomesPublicAccessedTroughChild") + public void testProtectedBecomesPublicAccessedTroughChild() throws Exception { + runTest("jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/"); + } + + @TestMetadata("jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ChangeTypeAliasAndUsage extends AbstractIncrementalJsKlibCompilerWithScopeExpansionRunnerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInChangeTypeAliasAndUsage() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true); + } + } + + @TestMetadata("jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ProtectedBecomesPublicAccessedTroughChild extends AbstractIncrementalJsKlibCompilerWithScopeExpansionRunnerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInProtectedBecomesPublicAccessedTroughChild() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true); + } + } + } } diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 51f3c96ff63..52588e116fe 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -1234,6 +1234,7 @@ fun main(args: Array) { model("incremental/pureKotlin", extension = null, recursive = false) model("incremental/classHierarchyAffected", extension = null, recursive = false) model("incremental/js", extension = null, excludeParentDirs = true) + model("incremental/scopeExpansion", extension = null, excludeParentDirs = true) } testClass { diff --git a/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/Foo.kt b/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/Foo.kt new file mode 100644 index 00000000000..f613d2ee4ff --- /dev/null +++ b/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/Foo.kt @@ -0,0 +1,3 @@ +interface Foo { + val value: TypeAlias +} \ No newline at end of file diff --git a/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/FooImpl.kt b/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/FooImpl.kt new file mode 100644 index 00000000000..4ce00aeb8f7 --- /dev/null +++ b/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/FooImpl.kt @@ -0,0 +1,4 @@ +class FooImpl : Foo { + override val value: TypeAlias + get() = "0" +} \ No newline at end of file diff --git a/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/FooImpl.kt.new b/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/FooImpl.kt.new new file mode 100644 index 00000000000..9f9ec1932b8 --- /dev/null +++ b/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/FooImpl.kt.new @@ -0,0 +1,4 @@ +class FooImpl : Foo { + override val value: TypeAlias + get() = 1 +} \ No newline at end of file diff --git a/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/TypeAlias.kt b/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/TypeAlias.kt new file mode 100644 index 00000000000..e22dbc2bfd6 --- /dev/null +++ b/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/TypeAlias.kt @@ -0,0 +1 @@ +typealias TypeAlias = String \ No newline at end of file diff --git a/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/TypeAlias.kt.new b/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/TypeAlias.kt.new new file mode 100644 index 00000000000..b40d921b9ec --- /dev/null +++ b/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/TypeAlias.kt.new @@ -0,0 +1 @@ +typealias TypeAlias = Int \ No newline at end of file diff --git a/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/build.log b/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/build.log new file mode 100644 index 00000000000..52215592293 --- /dev/null +++ b/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/build.log @@ -0,0 +1,9 @@ +================ Step #1 ================= + +Compiling files: + src/Foo.kt + src/FooImpl.kt + src/TypeAlias.kt +End of files +Exit code: OK +------------------------------------------ diff --git a/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/dummy.kt b/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/dummy.kt new file mode 100644 index 00000000000..3f0c1c77242 --- /dev/null +++ b/jps-plugin/testData/incremental/scopeExpansion/changeTypeAliasAndUsage/dummy.kt @@ -0,0 +1 @@ +fun dummy() {} \ No newline at end of file diff --git a/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/a.kt b/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/a.kt new file mode 100644 index 00000000000..ddc96ccbc5c --- /dev/null +++ b/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/a.kt @@ -0,0 +1,5 @@ +package test + +open class A { + protected open fun foo(): Int = 0 +} \ No newline at end of file diff --git a/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/a.kt.new b/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/a.kt.new new file mode 100644 index 00000000000..54d474ee211 --- /dev/null +++ b/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/a.kt.new @@ -0,0 +1,5 @@ +package test + +open class A { + open fun foo(): Int = 0 +} \ No newline at end of file diff --git a/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/b.kt b/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/b.kt new file mode 100644 index 00000000000..00418a633c9 --- /dev/null +++ b/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/b.kt @@ -0,0 +1,5 @@ +package test + +open class B : A() { + override fun foo(): Int = 1 +} \ No newline at end of file diff --git a/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/build.log b/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/build.log new file mode 100644 index 00000000000..3dda9a306e1 --- /dev/null +++ b/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/build.log @@ -0,0 +1,9 @@ +================ Step #1 ================= + +Compiling files: + src/a.kt + src/b.kt + src/usage.kt +End of files +Exit code: OK +------------------------------------------ diff --git a/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/other.kt b/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/other.kt new file mode 100644 index 00000000000..2ff821a2d52 --- /dev/null +++ b/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/other.kt @@ -0,0 +1,3 @@ +package other + +fun other() = "other" \ No newline at end of file diff --git a/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/usage.kt b/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/usage.kt new file mode 100644 index 00000000000..cdc32d3de7f --- /dev/null +++ b/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/usage.kt @@ -0,0 +1,5 @@ +package test + +fun main(args: Array) { + +} \ No newline at end of file diff --git a/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/usage.kt.new b/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/usage.kt.new new file mode 100644 index 00000000000..8e6c3e1570b --- /dev/null +++ b/jps-plugin/testData/incremental/scopeExpansion/protectedBecomesPublicAccessedTroughChild/usage.kt.new @@ -0,0 +1,5 @@ +package test + +fun main(args: Array) { + B().foo() +} \ No newline at end of file