Increment metadata version and improve message for error type

Follow-up of 617bed1b
This commit is contained in:
Mikhail Zarechenskiy
2019-02-26 15:33:23 +03:00
parent f7428e7161
commit 892fb9f39e
3 changed files with 7 additions and 3 deletions
@@ -25,6 +25,7 @@ class TypeDeserializer(
private val parent: TypeDeserializer?, private val parent: TypeDeserializer?,
typeParameterProtos: List<ProtoBuf.TypeParameter>, typeParameterProtos: List<ProtoBuf.TypeParameter>,
private val debugName: String, private val debugName: String,
private val containerPresentableName: String,
var experimentalSuspendFunctionTypeEncountered: Boolean = false var experimentalSuspendFunctionTypeEncountered: Boolean = false
) { ) {
private val classDescriptors: (Int) -> ClassDescriptor? = c.storageManager.createMemoizedFunctionWithNullableValues { fqNameIndex -> private val classDescriptors: (Int) -> ClassDescriptor? = c.storageManager.createMemoizedFunctionWithNullableValues { fqNameIndex ->
@@ -112,7 +113,9 @@ class TypeDeserializer(
proto.hasClassName() -> (classDescriptors(proto.className) ?: notFoundClass(proto.className)).typeConstructor proto.hasClassName() -> (classDescriptors(proto.className) ?: notFoundClass(proto.className)).typeConstructor
proto.hasTypeParameter() -> proto.hasTypeParameter() ->
typeParameterTypeConstructor(proto.typeParameter) typeParameterTypeConstructor(proto.typeParameter)
?: ErrorUtils.createErrorTypeConstructor("Unknown type parameter ${proto.typeParameter}") ?: ErrorUtils.createErrorTypeConstructor(
"Unknown type parameter ${proto.typeParameter}. Please try recompiling module containing \"$containerPresentableName\""
)
proto.hasTypeParameterName() -> { proto.hasTypeParameterName() -> {
val container = c.containingDeclaration val container = c.containingDeclaration
val name = c.nameResolver.getString(proto.typeParameterName) val name = c.nameResolver.getString(proto.typeParameterName)
@@ -80,7 +80,8 @@ class DeserializationContext(
) { ) {
val typeDeserializer: TypeDeserializer = TypeDeserializer( val typeDeserializer: TypeDeserializer = TypeDeserializer(
this, parentTypeDeserializer, typeParameters, this, parentTypeDeserializer, typeParameters,
"Deserializer for ${containingDeclaration.name}" "Deserializer for \"${containingDeclaration.name}\"",
containerSource?.presentableString ?: "[container not found]"
) )
val memberDeserializer: MemberDeserializer = MemberDeserializer(this) val memberDeserializer: MemberDeserializer = MemberDeserializer(this)
@@ -27,7 +27,7 @@ class JvmMetadataVersion(versionArray: IntArray, val isStrictSemantics: Boolean)
companion object { companion object {
@JvmField @JvmField
val INSTANCE = JvmMetadataVersion(1, 1, 13) val INSTANCE = JvmMetadataVersion(1, 1, 14)
@JvmField @JvmField
val INVALID_VERSION = JvmMetadataVersion() val INVALID_VERSION = JvmMetadataVersion()