better error diagnostics
This commit is contained in:
@@ -343,6 +343,11 @@ public class TypeUtils {
|
||||
private static void fillInDeepSubstitutor(@NotNull JetType context, @NotNull TypeSubstitutor substitutor, @NotNull Map<TypeConstructor, TypeProjection> substitution, @Nullable Multimap<TypeConstructor, TypeProjection> fullSubstitution) {
|
||||
List<TypeParameterDescriptor> parameters = context.getConstructor().getParameters();
|
||||
List<TypeProjection> arguments = context.getArguments();
|
||||
|
||||
if (parameters.size() != arguments.size()) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
for (int i = 0; i < arguments.size(); i++) {
|
||||
TypeProjection argument = arguments.get(i);
|
||||
TypeParameterDescriptor typeParameterDescriptor = parameters.get(i);
|
||||
|
||||
+5
@@ -266,6 +266,11 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
||||
return false;
|
||||
}
|
||||
|
||||
// do not crash on error types
|
||||
if (ErrorUtils.isErrorType(actualType) || ErrorUtils.isErrorType(targetType)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
{
|
||||
Multimap<TypeConstructor, TypeProjection> typeSubstitutionMap =
|
||||
TypeUtils.buildDeepSubstitutionMultimap(targetType);
|
||||
|
||||
Reference in New Issue
Block a user