Commits

Slava Pestov committed 7d2b4d8b6ae
Sema: Better fix for duplicate emission of accessors When compiling a module with multiple FileUnits (eg, while running swiftc without -whole-module-optimization), we emit all decls in the ExternalDeclarations list for every FileUnit, leading to duplicate symbols if any of those decls were public. Joe's workaround skipped decls on ExternalDefinitions that were already emitted in the current FileUnit, but that was not sufficient; the right fix is to not put stuff on ExternalDeclarations at all, if we're going to emit it as part of a decl inside our file. In this case, the synthesized _code accessors for an ErrorType conformance do not belong in ExternalDefinitions, because they're part of an ExtensionDecl that is in the current FileUnit. Finally add some tests for this stuff, because it appears our existing coverage was insufficient.