Commit Graph

10 Commits

Author SHA1 Message Date
Slava Pestov
57c4dc3831 Evolution: Stylistic fixes for tests 2018-12-03 20:36:03 -05:00
Slava Pestov
57979d1f7c IRGen: Use @_weakLinked to test backward deployment of resilient protocols
Get the attribute working for more link entity kinds, which addresses
all the FIXME:s in the original test case.

Now the protocol resilience tests can be updated to use @_weakLinked
for all newly-added protocol requirements and default implementations.

This allows the tests to pass in the backward deployment test scenario
as well.

Eventually this will be based on availability instead of a special
attribute.

This completes <rdar://problem/29888071>.
2018-10-31 19:55:01 -04:00
Doug Gregor
3ed69d4ee7 [Runtime] Instantiate witness tables even with no resilient witnesses.
The witness table for an empty, resilient protocol might need to be
instantiated, if a newer version of the protocol contains defaulted
associated type requirements. In such cases, we would either fail to
instantiate or assert in the runtime. Replace the assertion with a
proper check (to require instantiation in such cases) and cope with
filling in defaults even when the provided generic witness table has
no resilient witnesses.
2018-09-19 14:00:28 -07:00
Doug Gregor
fb62977c2b [IRGen] Emit default associated conformance witnesses.
For a resilient protocol that has defaulted associated types, emit
default associated conformance witnesses that compute associated
conformances based on that default witness.

This completes the implementation of resilience protocols that
add new, defaulted associated types, rdar://problem/44167982.
2018-09-19 10:56:20 -07:00
Doug Gregor
2ef9363bd1 [ABI] Add default associated type witnesses to resilient protocols.
When an associated type witness has a default, record that as part of
the protocol and emit a default associated type metadata accessor into the
default witness table. This allows a defaulted associated type to be
added to a protocol resiliently.

This is another part of rdar://problem/44167982, but it’s still very
limiting because the new associated type cannot have any conformances.
2018-09-15 22:04:46 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Slava Pestov
c846ca3939 Add library evolution tests for constructor, computed property, subscript default implementations 2016-03-11 11:27:06 -08:00
Ben Langmuir
5ca1c72381 Revert "Add library evolution tests for constructor, computed property, subscript default implementations"
This reverts commit a504d57e85.
2016-03-10 11:37:52 -08:00
Slava Pestov
a504d57e85 Add library evolution tests for constructor, computed property, subscript default implementations 2016-03-09 22:55:53 -08:00
Slava Pestov
6bf9ab19ff Add preliminary library evolution test for resiliently adding a new protocol requirement
This test ensures that the runtime correctly instantiates resilient conformances,
and that IRGen emits the correct metadata, allowing a conformance that was
compiled before a new requirement was added to present a default implementation
of this requirement.

For now, this runs with --no-backward-deployment, so we only test before/before,
before/after and after/after cases.

Getting after/before working is also an expected capability here, but requires
IRGen witness table emission to know which requirements were satisfied by
defaults, so that they can be dropped if they appear at the end of a witness
table. In turn, this requires serializing SILDefaultWitnessTables. This will
be added in a subsequent patch.

In addition to fixing the above case, I need to write additional tests and
possibly fix bugs related to more elaborate cases involving generics, as well as
default witnesses for properties and subscripts.
2016-03-03 07:37:00 -08:00