AST: Replace remaining uses of Type::transform() with transformRec()

This commit is contained in:
Slava Pestov
2024-08-12 14:00:33 -04:00
parent d35af38ce4
commit b601c294ac
22 changed files with 154 additions and 174 deletions

View File

@@ -21,11 +21,11 @@ using namespace swift::refactoring;
static Type sanitizeType(Type Ty) {
// Transform lvalue type to inout type so that we can print it properly.
return Ty.transform([](Type Ty) {
return Ty.transformRec([](Type Ty) -> std::optional<Type> {
if (Ty->is<LValueType>()) {
return Type(InOutType::get(Ty->getRValueType()->getCanonicalType()));
}
return Ty;
return std::nullopt;
});
}