Support type aliases in incremental compilation
#KT-12871 Fixed
This commit is contained in:
@@ -57,6 +57,7 @@ internal val MessageLite.isPrivate: Boolean
|
|||||||
is ProtoBuf.Constructor -> Flags.VISIBILITY.get(flags)
|
is ProtoBuf.Constructor -> Flags.VISIBILITY.get(flags)
|
||||||
is ProtoBuf.Function -> Flags.VISIBILITY.get(flags)
|
is ProtoBuf.Function -> Flags.VISIBILITY.get(flags)
|
||||||
is ProtoBuf.Property -> Flags.VISIBILITY.get(flags)
|
is ProtoBuf.Property -> Flags.VISIBILITY.get(flags)
|
||||||
|
is ProtoBuf.TypeAlias -> Flags.VISIBILITY.get(flags)
|
||||||
else -> error("Unknown message: $this")
|
else -> error("Unknown message: $this")
|
||||||
}))
|
}))
|
||||||
|
|
||||||
@@ -65,6 +66,7 @@ private fun MessageLite.name(nameResolver: NameResolver): String {
|
|||||||
is ProtoBuf.Constructor -> "<init>"
|
is ProtoBuf.Constructor -> "<init>"
|
||||||
is ProtoBuf.Function -> nameResolver.getString(name)
|
is ProtoBuf.Function -> nameResolver.getString(name)
|
||||||
is ProtoBuf.Property -> nameResolver.getString(name)
|
is ProtoBuf.Property -> nameResolver.getString(name)
|
||||||
|
is ProtoBuf.TypeAlias -> nameResolver.getString(name)
|
||||||
else -> error("Unknown message: $this")
|
else -> error("Unknown message: $this")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,6 +143,7 @@ private abstract class DifferenceCalculator() {
|
|||||||
is ProtoBuf.Constructor -> hashCode(stringIndexes, fqNameIndexes)
|
is ProtoBuf.Constructor -> hashCode(stringIndexes, fqNameIndexes)
|
||||||
is ProtoBuf.Function -> hashCode(stringIndexes, fqNameIndexes)
|
is ProtoBuf.Function -> hashCode(stringIndexes, fqNameIndexes)
|
||||||
is ProtoBuf.Property -> hashCode(stringIndexes, fqNameIndexes)
|
is ProtoBuf.Property -> hashCode(stringIndexes, fqNameIndexes)
|
||||||
|
is ProtoBuf.TypeAlias -> hashCode(stringIndexes, fqNameIndexes)
|
||||||
else -> error("Unknown message: $this")
|
else -> error("Unknown message: $this")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,6 +153,7 @@ private abstract class DifferenceCalculator() {
|
|||||||
old is ProtoBuf.Constructor && new is ProtoBuf.Constructor -> checkEquals(old, new)
|
old is ProtoBuf.Constructor && new is ProtoBuf.Constructor -> checkEquals(old, new)
|
||||||
old is ProtoBuf.Function && new is ProtoBuf.Function -> checkEquals(old, new)
|
old is ProtoBuf.Function && new is ProtoBuf.Function -> checkEquals(old, new)
|
||||||
old is ProtoBuf.Property && new is ProtoBuf.Property -> checkEquals(old, new)
|
old is ProtoBuf.Property && new is ProtoBuf.Property -> checkEquals(old, new)
|
||||||
|
old is ProtoBuf.TypeAlias && new is ProtoBuf.TypeAlias -> checkEquals(old, new)
|
||||||
else -> error("Unknown message: $this")
|
else -> error("Unknown message: $this")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -261,9 +265,10 @@ private class DifferenceCalculatorForPackageFacade(oldData: ProtoMapValue, newDa
|
|||||||
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getFunctionList))
|
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getFunctionList))
|
||||||
ProtoBufPackageKind.PROPERTY_LIST ->
|
ProtoBufPackageKind.PROPERTY_LIST ->
|
||||||
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getPropertyList))
|
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getPropertyList))
|
||||||
|
ProtoBufPackageKind.TYPE_ALIAS_LIST ->
|
||||||
|
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getTypeAliasList))
|
||||||
ProtoBufPackageKind.TYPE_TABLE,
|
ProtoBufPackageKind.TYPE_TABLE,
|
||||||
ProtoBufPackageKind.PACKAGE_MODULE_NAME,
|
ProtoBufPackageKind.PACKAGE_MODULE_NAME -> {
|
||||||
ProtoBufPackageKind.TYPE_ALIAS_LIST -> {
|
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
else -> throw IllegalArgumentException("Unsupported kind: $kind")
|
else -> throw IllegalArgumentException("Unsupported kind: $kind")
|
||||||
|
|||||||
+24
@@ -205,6 +205,18 @@ public class ExperimentalIncrementalJpsTestGenerated extends AbstractExperimenta
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("addMemberTypeAlias")
|
||||||
|
public void testAddMemberTypeAlias() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/addMemberTypeAlias/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("addTopLevelTypeAlias")
|
||||||
|
public void testAddTopLevelTypeAlias() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/addTopLevelTypeAlias/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("allConstants")
|
@TestMetadata("allConstants")
|
||||||
public void testAllConstants() throws Exception {
|
public void testAllConstants() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/allConstants/");
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/allConstants/");
|
||||||
@@ -839,6 +851,18 @@ public class ExperimentalIncrementalJpsTestGenerated extends AbstractExperimenta
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("removeMemberTypeAlias")
|
||||||
|
public void testRemoveMemberTypeAlias() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/removeMemberTypeAlias/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("removeTopLevelTypeAlias")
|
||||||
|
public void testRemoveTopLevelTypeAlias() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/removeTopLevelTypeAlias/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("renameClass")
|
@TestMetadata("renameClass")
|
||||||
public void testRenameClass() throws Exception {
|
public void testRenameClass() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/renameClass/");
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/renameClass/");
|
||||||
|
|||||||
+24
@@ -205,6 +205,18 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("addMemberTypeAlias")
|
||||||
|
public void testAddMemberTypeAlias() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/addMemberTypeAlias/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("addTopLevelTypeAlias")
|
||||||
|
public void testAddTopLevelTypeAlias() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/addTopLevelTypeAlias/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("allConstants")
|
@TestMetadata("allConstants")
|
||||||
public void testAllConstants() throws Exception {
|
public void testAllConstants() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/allConstants/");
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/allConstants/");
|
||||||
@@ -839,6 +851,18 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("removeMemberTypeAlias")
|
||||||
|
public void testRemoveMemberTypeAlias() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/removeMemberTypeAlias/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("removeTopLevelTypeAlias")
|
||||||
|
public void testRemoveTopLevelTypeAlias() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/removeTopLevelTypeAlias/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("renameClass")
|
@TestMetadata("renameClass")
|
||||||
public void testRenameClass() throws Exception {
|
public void testRenameClass() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/renameClass/");
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/pureKotlin/renameClass/");
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package a
|
||||||
|
|
||||||
|
class Outer {
|
||||||
|
inner class B(x: String)
|
||||||
|
|
||||||
|
fun A1(x: Any) = x
|
||||||
|
fun A2(x: Any) = x
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package a
|
||||||
|
|
||||||
|
class Outer {
|
||||||
|
inner class B(x: String)
|
||||||
|
|
||||||
|
typealias A1 = B
|
||||||
|
private typealias A2 = B
|
||||||
|
|
||||||
|
fun A1(x: Any) = x
|
||||||
|
fun A2(x: Any) = x
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package usage
|
||||||
|
|
||||||
|
fun bar() {
|
||||||
|
a.Outer().A1("")
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package usage
|
||||||
|
|
||||||
|
fun baz() {
|
||||||
|
a.Outer().A2("")
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
================ Step #1 =================
|
||||||
|
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/a/Outer$B.class
|
||||||
|
out/production/module/a/Outer.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a.kt
|
||||||
|
End of files
|
||||||
|
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||||
|
------------------------------------------
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/usage/A1UsageKt.class
|
||||||
|
out/production/module/usage/A2UsageKt.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a1Usage.kt
|
||||||
|
src/a2Usage.kt
|
||||||
|
End of files
|
||||||
|
Exit code: OK
|
||||||
|
------------------------------------------
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
================ Step #1 =================
|
||||||
|
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/a/Outer$B.class
|
||||||
|
out/production/module/a/Outer.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a.kt
|
||||||
|
End of files
|
||||||
|
Marked as dirty by Kotlin:
|
||||||
|
src/a1Usage.kt
|
||||||
|
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||||
|
------------------------------------------
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/usage/A1UsageKt.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a1Usage.kt
|
||||||
|
End of files
|
||||||
|
Exit code: OK
|
||||||
|
------------------------------------------
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package a
|
||||||
|
|
||||||
|
class B(x: String)
|
||||||
|
|
||||||
|
fun A1(x: Any) = x
|
||||||
|
fun A2(x: Any) = x
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package a
|
||||||
|
|
||||||
|
class B(x: String)
|
||||||
|
typealias A1 = B
|
||||||
|
private typealias A2 = B
|
||||||
|
|
||||||
|
fun A1(x: Any) = x
|
||||||
|
fun A2(x: Any) = x
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package usage
|
||||||
|
|
||||||
|
fun bar() {
|
||||||
|
a.A1("")
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package usage
|
||||||
|
|
||||||
|
fun baz() {
|
||||||
|
a.A2("")
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
================ Step #1 =================
|
||||||
|
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/a/AKt.class
|
||||||
|
out/production/module/a/B.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a.kt
|
||||||
|
End of files
|
||||||
|
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||||
|
------------------------------------------
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/usage/A1UsageKt.class
|
||||||
|
out/production/module/usage/A2UsageKt.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a1Usage.kt
|
||||||
|
src/a2Usage.kt
|
||||||
|
End of files
|
||||||
|
Exit code: OK
|
||||||
|
------------------------------------------
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
================ Step #1 =================
|
||||||
|
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/a/AKt.class
|
||||||
|
out/production/module/a/B.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a.kt
|
||||||
|
End of files
|
||||||
|
Marked as dirty by Kotlin:
|
||||||
|
src/a1Usage.kt
|
||||||
|
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||||
|
------------------------------------------
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/usage/A1UsageKt.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a1Usage.kt
|
||||||
|
End of files
|
||||||
|
Exit code: OK
|
||||||
|
------------------------------------------
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package a
|
||||||
|
|
||||||
|
class Outer {
|
||||||
|
inner class B(x: String)
|
||||||
|
|
||||||
|
typealias A1 = B
|
||||||
|
private typealias A2 = B
|
||||||
|
|
||||||
|
fun A1(x: Any) = x
|
||||||
|
fun A2(x: Any) = x
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package a
|
||||||
|
|
||||||
|
class Outer {
|
||||||
|
inner class B(x: String)
|
||||||
|
|
||||||
|
fun A1(x: Any) = x
|
||||||
|
fun A2(x: Any) = x
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package usage
|
||||||
|
|
||||||
|
fun bar() {
|
||||||
|
a.Outer().A1("")
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package usage
|
||||||
|
|
||||||
|
fun baz() {
|
||||||
|
a.Outer().A2("")
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
================ Step #1 =================
|
||||||
|
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/a/Outer$B.class
|
||||||
|
out/production/module/a/Outer.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a.kt
|
||||||
|
End of files
|
||||||
|
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||||
|
------------------------------------------
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/usage/A1UsageKt.class
|
||||||
|
out/production/module/usage/A2UsageKt.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a1Usage.kt
|
||||||
|
src/a2Usage.kt
|
||||||
|
End of files
|
||||||
|
Exit code: OK
|
||||||
|
------------------------------------------
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
================ Step #1 =================
|
||||||
|
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/a/Outer$B.class
|
||||||
|
out/production/module/a/Outer.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a.kt
|
||||||
|
End of files
|
||||||
|
Marked as dirty by Kotlin:
|
||||||
|
src/a1Usage.kt
|
||||||
|
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||||
|
------------------------------------------
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/usage/A1UsageKt.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a1Usage.kt
|
||||||
|
End of files
|
||||||
|
Exit code: OK
|
||||||
|
------------------------------------------
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package a
|
||||||
|
|
||||||
|
class B(x: String)
|
||||||
|
|
||||||
|
typealias A1 = B
|
||||||
|
private typealias A2 = B
|
||||||
|
|
||||||
|
fun A1(x: Any) = x
|
||||||
|
fun A2(x: Any) = x
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package a
|
||||||
|
|
||||||
|
class B(x: String)
|
||||||
|
|
||||||
|
fun A1(x: Any) = x
|
||||||
|
fun A2(x: Any) = x
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package usage
|
||||||
|
|
||||||
|
fun bar() {
|
||||||
|
a.A1("")
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package usage
|
||||||
|
|
||||||
|
fun baz() {
|
||||||
|
a.A2("")
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
================ Step #1 =================
|
||||||
|
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/a/AKt.class
|
||||||
|
out/production/module/a/B.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a.kt
|
||||||
|
End of files
|
||||||
|
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||||
|
------------------------------------------
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/usage/A1UsageKt.class
|
||||||
|
out/production/module/usage/A2UsageKt.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a1Usage.kt
|
||||||
|
src/a2Usage.kt
|
||||||
|
End of files
|
||||||
|
Exit code: OK
|
||||||
|
------------------------------------------
|
||||||
Vendored
+23
@@ -0,0 +1,23 @@
|
|||||||
|
================ Step #1 =================
|
||||||
|
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/a/AKt.class
|
||||||
|
out/production/module/a/B.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a.kt
|
||||||
|
End of files
|
||||||
|
Marked as dirty by Kotlin:
|
||||||
|
src/a1Usage.kt
|
||||||
|
Exit code: ADDITIONAL_PASS_REQUIRED
|
||||||
|
------------------------------------------
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/usage/A1UsageKt.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/a1Usage.kt
|
||||||
|
End of files
|
||||||
|
Exit code: OK
|
||||||
|
------------------------------------------
|
||||||
Reference in New Issue
Block a user