Skip to content

Commit dc7688e

Browse files
committed
Sema: Make applyGenericArguments() idempotent
If we call TypeRepr::setInvalid() we need to return an ErrorType, because we'll return an ErrorType if this same TypeRepr is resolved again. This just makes the RequirementMachine's behavior match the GenericSignatureBuilder on some highly-invalid compiler_crashers.
1 parent 7e733c4 commit dc7688e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ static Type applyGenericArguments(Type type, TypeResolution resolution,
679679

680680
generic->setInvalid();
681681
}
682-
return type;
682+
return ErrorType::get(ctx);
683683
}
684684

685685
auto *unboundType = type->castTo<UnboundGenericType>();

0 commit comments

Comments
 (0)