Commit Graph

5 Commits

Author SHA1 Message Date
Doug Gregor
248ca75b8f [Type checking] A declaration in an overlay can shadow an imported declaration.
If a declaration provided in a Swift overlay has the same signature as
a declaration imported from the Clang module it overlays, or some
private framework that re-exports its interface through that Clang
module, the declaration provided in the Swift overlay shadows the one
imported from Clang.

To make this work for unqualified lookup, allow the shadowing rules to
kick in there as well. Make this a very narrow fix, because the
underlying problems that prevented us from doing this shadowing still
persist.

Fixes rdar://problem/35691030 and its several dupes.
2018-06-01 11:43:52 -07:00
Bruno Cardoso Lopes
8cb008481c [ClangImporter] Use appropriate link name for export_as
rdar://problem/38269782
2018-04-16 16:31:05 -07:00
Doug Gregor
e3207f753c [Serialization] Handle re-export of error enums mapped via import-as-member.
Thanks to Jordan for coming up with the right combination of features to
trigger this code path.
2017-09-15 16:58:26 -07:00
Doug Gregor
e4c653640f Improve testing for re-exported modules.
Test more kinds of entities, including through serialized SIL, and
verify that other combinations work (e.g., building the overlay
against the public module but using it with the private version).
2017-09-15 13:46:35 -07:00
Doug Gregor
e5ebb5854f Treat entities from (private) modules as members of the re-exported module.
A public C module can be expressed as the combination of several
private modules at build time, where that structure is "collapsed"
into a single public module for client use. In such cases, the symbols
associated with the public module can actually be seen as coming from
the private module (e.g. at the time the Swift overlay is built),
which fools our overlay-specific hacks. When a module states that it
is re-exported via another, public module, teach semantic analysis to
treat the entity "as if" it came from the re-exporting public module.

Part of rdar://problem/34438586.
2017-09-14 15:09:18 -07:00