Commit Graph

4 Commits

Author SHA1 Message Date
Allan Shortlidge
082f0ac4b5 Tests: Use a more natural spelling for ABI triple lit substitutions.
`%target-swift-5.8-abi-triple` instead of `%target-swift-abi-5.8-triple`, for
example.
2024-10-18 10:11:36 -07:00
Allan Shortlidge
43ce0dfe5b Sema: Record a default witness for requirements with satisfied Obj-C siblings.
Rather than just skipping requirements with satisfied Obj-C siblings during
`resolveValueWitnesses()`, proactively record a default witness for these
requirements. This prevents lazy value witness resolution from giving the
skipped requirements a default witness after the conformance is already marked
complete, which causes an assertion to fail.

Resolves rdar://119435253
2024-03-11 14:46:19 -07:00
Allan Shortlidge
e057b686a5 Sema: Effectively revert https://github.com/apple/swift/pull/70569.
The fix caused a source break that is now captured as an additional test case
in `objc_async_conformance.swift`.

Resolves rdar://121527977
2024-02-20 22:54:33 -08:00
Allan Shortlidge
950c5e98e7 AST: Improve handling of missing @objc async protocol witnesses.
Serialization now enumerates the value witnesses of conformances with a
resolver in order to facilitate lazy type checking
(https://github.com/apple/swift/pull/68262). This change in behavior introduced
an assertion failure when compiling modules from swiftinterface when the
interface contains a conformance to an `@objc` protocol that has a requirement
that is imported with an `async` variant. The `forEachValueWitness()`
invocation during serialization was causing the missing witness for an objc
async protocol requirement to be resolved after conformance check was already
marked "complete". This witness had not been previously resolved because
`ConformanceChecker::resolveValueWitnesses()` had special logic to skip objc
protocol requirements with witnessed siblings, whereas `forEachValueWitness()`
did not.

There are multiple potential solutions to this problem, but the one that seemed
least disruptive to me was to stop skipping resolution of these sibling
witnesses during `ConformanceChecker::resolveValueWitnesses()`. When I looked
into why they were being skipped, I discovered that this seemed to be a
concession to bugs in the logic for pruning missing witnesses. When I adjusted
the pruning logic it no longer became necessary to skip witnesses in
`ConformanceChecker::resolveValueWitnesses()` in order to avoid incorrect
diagnostics.

Resolves rdar://119435253
2024-01-01 09:42:47 -08:00