mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Replace remaining uses of Type::transform() with transformRec()
This commit is contained in:
@@ -91,11 +91,11 @@ public:
|
||||
// it means that this is an invalid external declaration
|
||||
// relative to this element's context.
|
||||
if (CS.simplifyType(type)->hasTypeVariable()) {
|
||||
auto transformedTy = type.transform([&](Type type) {
|
||||
auto transformedTy = type.transformRec([&](Type type) -> std::optional<Type> {
|
||||
if (auto *typeVar = type->getAs<TypeVariableType>()) {
|
||||
return ErrorType::get(CS.getASTContext());
|
||||
return Type(ErrorType::get(CS.getASTContext()));
|
||||
}
|
||||
return type;
|
||||
return std::nullopt;
|
||||
});
|
||||
|
||||
CS.setType(decl, transformedTy);
|
||||
|
||||
Reference in New Issue
Block a user