Delay the validaton of storage accessors until finalization.

The base mutability of storage is part of the signature, so be sure
to compute that during validation.  Also, serialize it as part of
the storage declaration, and fix some places that synthesize
declarations to set it correctly.
This commit is contained in:
John McCall
2017-09-08 19:09:26 -04:00
parent 16122cef58
commit 2d3d6addc0
22 changed files with 453 additions and 322 deletions

View File

@@ -2894,6 +2894,8 @@ void Serializer::writeDecl(const Decl *D) {
var->isStatic(),
getRawStableVarDeclSpecifier(var->getSpecifier()),
var->hasNonPatternBindingInit(),
var->isGetterMutating(),
var->isSetterMutating(),
(unsigned) accessors.Kind,
addTypeRef(ty),
addDeclRef(accessors.Get),
@@ -3047,6 +3049,8 @@ void Serializer::writeDecl(const Decl *D) {
contextID,
subscript->isImplicit(),
subscript->isObjC(),
subscript->isGetterMutating(),
subscript->isSetterMutating(),
(unsigned) accessors.Kind,
addGenericEnvironmentRef(
subscript->getGenericEnvironment()),