Implement serialization of inner types

Original commit: 7500447e72
This commit is contained in:
Denis Zharkov
2015-11-11 14:36:31 +03:00
parent 084df28a14
commit dfcb6ec84d
@@ -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)
}