From 3a09f69f9b3c8f93a4740947866d3fd97e57d0e4 Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Wed, 25 Jan 2012 21:28:46 +0400 Subject: [PATCH] fix attempt to create JetTypeImpl with ErrorScope ErrorScope is created here if any typeParameterDescriptor upper bounds scope is ErrorScope --- .../jet/lang/resolve/TypeResolver.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java index 071b75180e3..d7de32ca75b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/TypeResolver.java @@ -80,13 +80,18 @@ public class TypeResolver { trace.record(BindingContext.REFERENCE_TARGET, referenceExpression, typeParameterDescriptor); - result[0] = new JetTypeImpl( - annotations, - typeParameterDescriptor.getTypeConstructor(), - nullable || TypeUtils.hasNullableLowerBound(typeParameterDescriptor), - Collections.emptyList(), - getScopeForTypeParameter(typeParameterDescriptor) - ); + JetScope scopeForTypeParameter = getScopeForTypeParameter(typeParameterDescriptor); + if (scopeForTypeParameter instanceof ErrorUtils.ErrorScope) { + result[0] = ErrorUtils.createErrorType("?"); + } else { + result[0] = new JetTypeImpl( + annotations, + typeParameterDescriptor.getTypeConstructor(), + nullable || TypeUtils.hasNullableLowerBound(typeParameterDescriptor), + Collections.emptyList(), + scopeForTypeParameter + ); + } resolveTypeProjections(scope, ErrorUtils.createErrorType("No type").getConstructor(), type.getTypeArguments()); }