From ccbade663b81528ffc54d54d25f7d95077f9bca7 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Wed, 8 Jun 2016 16:13:03 +0300 Subject: [PATCH] Do not perform type alias expansion for error types. --- .../src/org/jetbrains/kotlin/resolve/TypeAliasExpander.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeAliasExpander.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeAliasExpander.kt index 5e01e42d82d..1d5308a54f6 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeAliasExpander.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/TypeAliasExpander.kt @@ -113,13 +113,15 @@ class TypeAliasExpander( ): TypeProjection { val type = originalProjection.type - if (!type.requiresTypeAliasExpansion()) { + if (type.isError || !type.requiresTypeAliasExpansion()) { return originalProjection } val typeConstructor = type.constructor val typeDescriptor = typeConstructor.declarationDescriptor + assert(typeConstructor.parameters.size == type.arguments.size) { "Unexpected malformed type: $type" } + when (typeDescriptor) { is TypeParameterDescriptor -> { return originalProjection