[CS] Replace UnresolvedType with ErrorType in simplifyType/resolveType

This means we now either produce a bare ErrorType, or an ErrorType
with a generic parameter original type for a generic parameter hole.
We ought to further consolidate this logic by sinking the generic
parameter original type replacement into `simplifyType` itself, but
I'm leaving that for a future patch since it affects completion
results and I want to try keep this close to NFC.
This commit is contained in:
Hamish Knight
2025-10-01 22:30:46 +01:00
parent 21141f466c
commit 5171b84dba
11 changed files with 36 additions and 34 deletions

View File

@@ -56,7 +56,7 @@ swift::ide::getSelectedOverloadInfo(const Solution &S,
OverloadChoiceKind::KeyPathApplication) {
auto Params = Result.ValueTy->getAs<AnyFunctionType>()->getParams();
if (Params.size() == 1 &&
Params[0].getPlainType()->is<UnresolvedType>()) {
Params[0].getPlainType()->is<ErrorType>()) {
auto *KPDecl = CS.getASTContext().getKeyPathDecl();
Type KPTy =
KPDecl->mapTypeIntoContext(KPDecl->getDeclaredInterfaceType());