Skip to content

Commit 1828c7e

Browse files
committed
AST: Build the right kind of ErrorType inside subst() instead of getTypeWitness()
1 parent 8b1514c commit 1828c7e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/AST/TypeSubstitution.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,10 @@ Type TypeSubstituter::transformDependentMemberType(DependentMemberType *dependen
443443
IFS.lookupConformance(origBase->getCanonicalType(), substBase,
444444
proto, level);
445445

446-
return conformance.getTypeWitness(substBase, assocType, IFS.getOptions());
446+
auto result = conformance.getTypeWitness(substBase, assocType, IFS.getOptions());
447+
if (result->is<ErrorType>())
448+
return DependentMemberType::get(ErrorType::get(substBase), assocType);
449+
return result;
447450
}
448451

449452
SubstitutionMap TypeSubstituter::transformSubstitutionMap(SubstitutionMap subs) {

0 commit comments

Comments
 (0)