From dfcb6ec84d4389c9c1cce882c6e3db8c2ea161f3 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Wed, 11 Nov 2015 14:36:31 +0300 Subject: [PATCH] Implement serialization of inner types Original commit: 7500447e72fb5bc129a87e61fb271568ae8eb2ac --- .../jps/incremental/ProtoCompareGenerated.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/ProtoCompareGenerated.kt b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/ProtoCompareGenerated.kt index 74e6cbc514e..a4f9787fddf 100644 --- a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/ProtoCompareGenerated.kt +++ b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/incremental/ProtoCompareGenerated.kt @@ -355,6 +355,16 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi if (!checkStringEquals(old.typeParameterName, new.typeParameterName)) return false } + if (old.hasOuterType() != new.hasOuterType()) return false + if (old.hasOuterType()) { + if (!checkEquals(old.outerType, new.outerType)) return false + } + + if (old.hasOuterTypeId() != new.hasOuterTypeId()) return false + if (old.hasOuterTypeId()) { + if (old.outerTypeId != new.outerTypeId) return false + } + if (old.getExtensionCount(JvmProtoBuf.typeAnnotation) != new.getExtensionCount(JvmProtoBuf.typeAnnotation)) return false for(i in 0..old.getExtensionCount(JvmProtoBuf.typeAnnotation) - 1) { @@ -1043,6 +1053,14 @@ public fun ProtoBuf.Type.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (I hashCode = 31 * hashCode + stringIndexes(typeParameterName) } + if (hasOuterType()) { + hashCode = 31 * hashCode + outerType.hashCode(stringIndexes, fqNameIndexes) + } + + if (hasOuterTypeId()) { + hashCode = 31 * hashCode + outerTypeId + } + for(i in 0..getExtensionCount(JvmProtoBuf.typeAnnotation) - 1) { hashCode = 31 * hashCode + getExtension(JvmProtoBuf.typeAnnotation, i).hashCode(stringIndexes, fqNameIndexes) }