Serialize/deserialize annotations on type parameters

Original commit: 25b40455ad
This commit is contained in:
Svetlana Isakova
2015-10-16 21:55:18 +03:00
parent 3f18729d01
commit 9f2f66b3b8
@@ -308,6 +308,12 @@ open class ProtoCompareGenerated(public val oldNameResolver: NameResolver, publi
if (!checkEqualsTypeParameterUpperBoundId(old, new)) return false
if (old.getExtensionCount(JvmProtoBuf.typeParameterAnnotation) != new.getExtensionCount(JvmProtoBuf.typeParameterAnnotation)) return false
for(i in 0..old.getExtensionCount(JvmProtoBuf.typeParameterAnnotation) - 1) {
if (!checkEquals(old.getExtension(JvmProtoBuf.typeParameterAnnotation, i), new.getExtension(JvmProtoBuf.typeParameterAnnotation, i))) return false
}
return true
}
@@ -995,6 +1001,10 @@ public fun ProtoBuf.TypeParameter.hashCode(stringIndexes: (Int) -> Int, fqNameIn
hashCode = 31 * hashCode + getUpperBoundId(i)
}
for(i in 0..getExtensionCount(JvmProtoBuf.typeParameterAnnotation) - 1) {
hashCode = 31 * hashCode + getExtension(JvmProtoBuf.typeParameterAnnotation, i).hashCode(stringIndexes, fqNameIndexes)
}
return hashCode
}