Merge pull request #59141 from hamishknight/wrapping-paper

[AST] Remove ParenType
This commit is contained in:
Hamish Knight
2024-11-01 16:52:23 +00:00
committed by GitHub
69 changed files with 158 additions and 368 deletions

View File

@@ -587,10 +587,9 @@ Expected<Pattern *> ModuleFile::readPattern(DeclContext *owningDC) {
auto result = ParenPattern::createImplicit(getContext(), subPattern);
if (Type interfaceType = subPattern->getDelayedInterfaceType())
result->setDelayedInterfaceType(ParenType::get(getContext(),
interfaceType), owningDC);
result->setDelayedInterfaceType(interfaceType, owningDC);
else
result->setType(ParenType::get(getContext(), subPattern->getType()));
result->setType(subPattern->getType());
restoreOffset.reset();
return result;
}
@@ -6974,19 +6973,6 @@ Expected<Type> DESERIALIZE_TYPE(NOMINAL_TYPE)(
return NominalType::get(nominal, parentTy.get(), MF.getContext());
}
Expected<Type> DESERIALIZE_TYPE(PAREN_TYPE)(ModuleFile &MF,
SmallVectorImpl<uint64_t> &scratch,
StringRef blobData) {
TypeID underlyingID;
decls_block::ParenTypeLayout::readRecord(scratch, underlyingID);
auto underlyingTy = MF.getTypeChecked(underlyingID);
if (!underlyingTy)
return underlyingTy.takeError();
return ParenType::get(MF.getContext(), underlyingTy.get());
}
Expected<Type> DESERIALIZE_TYPE(TUPLE_TYPE)(ModuleFile &MF,
SmallVectorImpl<uint64_t> &scratch,
StringRef blobData) {