[Sema] Handle PlaceholderTypes in associated type inference

Avoid attempting to infer an associatedtype as a type that contains
placeholders.
This commit is contained in:
Hamish Knight
2025-09-17 15:23:08 +01:00
parent d1b8084bc1
commit aa9aa58cea
4 changed files with 11 additions and 5 deletions

View File

@@ -117,6 +117,12 @@ private:
#define SINGLETON_TYPE(SHORT_ID, ID) TRIVIAL_CASE(ID##Type)
#include "swift/AST/TypeNodes.def"
bool visitPlaceholderType(CanPlaceholderType firstType, Type secondType,
Type sugaredFirstType) {
// Placeholder types never match.
return mismatch(firstType.getPointer(), secondType, sugaredFirstType);
}
bool visitUnresolvedType(CanUnresolvedType firstType, Type secondType,
Type sugaredFirstType) {
// Unresolved types never match.