Commit Graph

5 Commits

Author SHA1 Message Date
Slava Pestov
3b051a2b7b Convert tabs to spaces in test/Sema/conformance_availability.swift 2020-11-12 15:57:21 -05:00
Slava Pestov
0ff82ca051 Sema: Check conformance availability when ranking solutions
This completes the work on <rdar://problem/35158274>, and also
adds a test case for <rdar://problem/50627401>.
2020-11-10 17:52:51 -05:00
Slava Pestov
db394c5428 Sema: Don't emit 'add @available attribute' fixit on implicit declarations 2020-11-09 23:44:40 -05:00
Slava Pestov
972cd5c9b6 Sema: Check associated conformance availability
This replaces the old exportability check with a call into the
new general conformance availability check entry point.

Part of <rdar://problem/35158274>.
2020-11-09 23:44:40 -05:00
Slava Pestov
ceb8675ad1 Sema: (Mostly) check conformance availability
If a conformance is defined in an extension, we now look for
references to the conformance in types and expressions and
respect's the extension's availability (or deprecation, etc).

The conformance checker itself still needs to check conformance
availability of associated conformances and the like; that will
be a separate change.

Note that conformances defined on types don't require any
special handling, since they are as available as the
intersection of the conforming type and the protocol.

By default, we diagnose conformance availability violations
where the OS version is not sufficiently new as warnings, to
avoid breaking source compatibility. Stricter behavior where
these violations are diagnosed as errors is enabled by passing
the -enable-conformance-availability-errors flag. There are
test cases that run both with and without this flag. In the
future, we hope to make the stricter behavior the default,
since after all, violations here can result in link errors and
runtime crashes.

Uses of completely unavailable conformances are still always
diagnosed as errors, even when this flag is not passed in.

Progress on <rdar://problem/35158274>.
2020-11-05 17:51:45 -05:00