AST: Pick off some usages of GenericTypeParamType::getDecl()

This commit is contained in:
Slava Pestov
2024-07-05 17:20:17 -04:00
committed by Alejandro Alonso
parent a434126554
commit 1ff1b9479a
13 changed files with 47 additions and 50 deletions

View File

@@ -1657,10 +1657,8 @@ void Serializer::writeASTBlockEntity(GenericSignature sig) {
} else {
// Record the generic parameters.
for (auto *paramTy : sig.getGenericParams()) {
auto *decl = paramTy->getDecl();
// For a full environment, add the name and canonicalize the param type.
Identifier paramName = decl ? decl->getName() : Identifier();
Identifier paramName = paramTy->isCanonical() ? Identifier() : paramTy->getName();
rawParamIDs.push_back(addDeclBaseNameRef(paramName));
paramTy = paramTy->getCanonicalType()->castTo<GenericTypeParamType>();