Teach loadAllMembers() implementations to add the members themselves.

The contract for LazyResolver::loadAllMembers() was that the caller
would handle actually adding the members, since it was an iterable
declaration context and could centralize that (simple) logic. However,
this fails in the Clang importer in rare but amusing ways when some of
the deferred actions (e.g., finishing a protocol conformance) depend
on having the members already set. The deferred action occurs after
the member list is complete in ClangImporter's loadAllMembers(), but
before its caller actual set the member list, leaving incomplete
conformances. Fixes rdar://problem/18884272.

Swift SVN r25630
This commit is contained in:
Doug Gregor
2015-02-28 01:03:41 +00:00
parent 5fed3c4b60
commit bce5c20c25
7 changed files with 41 additions and 23 deletions

View File

@@ -574,9 +574,8 @@ public:
/// Has no effect in NDEBUG builds.
void verify() const;
virtual void loadAllMembers(const Decl *D,
virtual void loadAllMembers(Decl *D,
uint64_t contextData,
SmallVectorImpl<Decl *> &Members,
bool *ignored) override;
virtual void