Fix a bunch of minor issues with read accessors.

This commit is contained in:
John McCall
2018-11-05 20:57:58 -05:00
parent 534bdc4083
commit 90ca9fe8b4
5 changed files with 58 additions and 13 deletions

View File

@@ -300,7 +300,8 @@ static AccessorDecl *createSetterPrototype(TypeChecker &TC,
// Always add the setter to the context immediately after the getter.
if (!getter) getter = storage->getGetter();
assert(getter && "always synthesize setter prototype after getter");
if (!getter) getter = storage->getReadCoroutine();
assert(getter && "always synthesize setter prototype after get/read");
addMemberToContextIfNeeded(setter, storage->getDeclContext(), getter);
return setter;