Recompile all enum usages when new entry is added
Original commit: 0cf2928761
This commit is contained in:
@@ -201,8 +201,9 @@ private class DifferenceCalculatorForClass(oldData: ProtoMapValue, newData: Prot
|
|||||||
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Class::getFunctionList))
|
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Class::getFunctionList))
|
||||||
ProtoBufClassKind.PROPERTY_LIST ->
|
ProtoBufClassKind.PROPERTY_LIST ->
|
||||||
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Class::getPropertyList))
|
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Class::getPropertyList))
|
||||||
ProtoBufClassKind.ENUM_ENTRY_LIST ->
|
ProtoBufClassKind.ENUM_ENTRY_LIST -> {
|
||||||
names.addAll(calcDifferenceForNames(oldProto.enumEntryList.map { it.name }, newProto.enumEntryList.map { it.name }))
|
isClassSignatureChanged = true
|
||||||
|
}
|
||||||
ProtoBufClassKind.TYPE_TABLE -> {
|
ProtoBufClassKind.TYPE_TABLE -> {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|||||||
+12
@@ -1075,6 +1075,18 @@ public class ExperimentalIncrementalJpsTestGenerated extends AbstractExperimenta
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("enumEntryAdded")
|
||||||
|
public void testEnumEntryAdded() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/classHierarchyAffected/enumEntryAdded/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("enumMemberChanged")
|
||||||
|
public void testEnumMemberChanged() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/classHierarchyAffected/enumMemberChanged/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("flagsAndMemberInDifferentClassesChanged")
|
@TestMetadata("flagsAndMemberInDifferentClassesChanged")
|
||||||
public void testFlagsAndMemberInDifferentClassesChanged() throws Exception {
|
public void testFlagsAndMemberInDifferentClassesChanged() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/classHierarchyAffected/flagsAndMemberInDifferentClassesChanged/");
|
String fileName = KotlinTestUtils.navigationMetadata("jps-plugin/testData/incremental/classHierarchyAffected/flagsAndMemberInDifferentClassesChanged/");
|
||||||
|
|||||||
+1
-2
@@ -1,2 +1 @@
|
|||||||
changes in test/EnumClassWithChanges: MEMBERS
|
changes in test/EnumClassWithChanges: CLASS_SIGNATURE
|
||||||
[CONST_2, CONST_3, CONST_4]
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
enum class Enum {
|
||||||
|
A,
|
||||||
|
B
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
enum class Enum {
|
||||||
|
A,
|
||||||
|
B,
|
||||||
|
C
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
Cleaning output files:
|
||||||
|
out/production/module/Enum.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/Enum.kt
|
||||||
|
End of files
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/GetRandomEnumEntryKt.class
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/UseKt.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/getRandomEnumEntry.kt
|
||||||
|
src/use.kt
|
||||||
|
End of files
|
||||||
|
COMPILATION FAILED
|
||||||
|
'when' expression must be exhaustive or contain an 'else' branch
|
||||||
|
|
||||||
|
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/Enum.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/Enum.kt
|
||||||
|
src/getRandomEnumEntry.kt
|
||||||
|
src/use.kt
|
||||||
|
End of files
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
import java.util.Random
|
||||||
|
|
||||||
|
fun getRandomEnumEntry() =
|
||||||
|
with (Enum.values()) {
|
||||||
|
get(Random().nextInt(size))
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import Enum.*
|
||||||
|
|
||||||
|
fun use(e: Enum): String =
|
||||||
|
when (e) {
|
||||||
|
A -> "A"
|
||||||
|
B -> "B"
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import Enum.*
|
||||||
|
|
||||||
|
fun use(e: Enum): String =
|
||||||
|
when (e) {
|
||||||
|
A -> "A"
|
||||||
|
B -> "B"
|
||||||
|
C -> "C"
|
||||||
|
}
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
fun useImplicit() {
|
||||||
|
println(use(getRandomEnumEntry()))
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
enum class Enum(x: String) {
|
||||||
|
A("a"),
|
||||||
|
B("b");
|
||||||
|
|
||||||
|
val becameNullable: Any = x
|
||||||
|
val unchanged: Any = x
|
||||||
|
}
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
enum class Enum(x: String) {
|
||||||
|
A("a"),
|
||||||
|
B("b");
|
||||||
|
|
||||||
|
val becameNullable: Any? = x
|
||||||
|
val unchanged: Any = x
|
||||||
|
}
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
Cleaning output files:
|
||||||
|
out/production/module/Enum.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/Enum.kt
|
||||||
|
End of files
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/META-INF/module.kotlin_module
|
||||||
|
out/production/module/UseBecameNullableKt.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/useBecameNullable.kt
|
||||||
|
End of files
|
||||||
|
COMPILATION FAILED
|
||||||
|
Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type kotlin.Any?
|
||||||
|
|
||||||
|
|
||||||
|
Cleaning output files:
|
||||||
|
out/production/module/Enum.class
|
||||||
|
End of files
|
||||||
|
Compiling files:
|
||||||
|
src/Enum.kt
|
||||||
|
src/useBecameNullable.kt
|
||||||
|
End of files
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import Enum.*
|
||||||
|
|
||||||
|
fun useBecameNullable(e: Enum) {
|
||||||
|
println(e.becameNullable.hashCode())
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import Enum.*
|
||||||
|
|
||||||
|
fun useBecameNullable(e: Enum) {
|
||||||
|
println(e.becameNullable?.hashCode())
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import Enum.*
|
||||||
|
|
||||||
|
fun useUnchanged(e: Enum) {
|
||||||
|
println(e.unchanged.hashCode())
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user