mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Skip verifying attributes when allowing errors
When allowing errors any attribute could be on any decl, so don't verify whether an attribute can appear on a decl. Note that these attributes aren't serialized anyway since they'll be set to invalid during typechecking and hence skipped.
This commit is contained in:
@@ -2012,6 +2012,8 @@ getStableSelfAccessKind(swift::SelfAccessKind MM) {
|
||||
# define DECL(KIND, PARENT)\
|
||||
LLVM_ATTRIBUTE_UNUSED \
|
||||
static void verifyAttrSerializable(const KIND ## Decl *D) {\
|
||||
if (D->Decl::getASTContext().LangOpts.AllowModuleWithCompilerErrors)\
|
||||
return;\
|
||||
for (auto Attr : D->getAttrs()) {\
|
||||
assert(Attr->canAppearOnDecl(D) && "attribute cannot appear on a " #KIND);\
|
||||
}\
|
||||
|
||||
Reference in New Issue
Block a user