Allow `@_section` and `@_used` to be used in fully constrained extensions.
This aligns with the existing behavior of static properties of generic types. The following is valid:
```swift
extension Array where Element == Int {
static let specificConstant = 41
}
```
However, adding `@_section` or `@_used` to the above property, will result in an error diagnostic.
This change updates the logic of `@_section`/`@_used` to allow their use when the generic context is fully concrete.
The changes to support `& Sendable` composition with key path
types adjusted `buildKeyPathDynamicMemberArgExpr` to support
that but the use-site erroneously still cast index type or
`BoundGenericType` as before.
Resolves: https://github.com/swiftlang/swift/issues/75244
Resolves: rdar://131768785
When inside the concurrency library, suppress the diagnostics about use
of the (deprecated) `@_unsafeInheritExecutor` for functions whose names
start with the "_unsafeInheritExecutor_" prefix that's used for
compatibility. This focuses the diagnostic on those places in the
concurrency library that might still need to introduce this hack.
flag.
This is just a proactive source compatibility measure, because isolation
inference changes like this can break source compatibility in language
modes < 6.
Previously we could end up with a
ContextualMismatch fix and a MissingConformance fix
for different elements of the `matchTypes` disjunction,
leading to an ambiguity. Instead, avoid recording
the ContextualMismatch if we're matching an
existential, and tweak the MissingConformance
failure to have a custom diagnostic for
EnumElementPattern matching.
We were previously checking the optional type,
which would never say that parens were needed.
Unwrap the type before checking, ensuring we
correctly handle e.g protocol compositions.
This is done by diagnosing captures of `self` in escaping `sending` or
`@Sendable` closures inside a deinit, which almost certainly means `self`
will outlive deinit at runtime, which is a fatal error. This is a common
mistake to make when creating isolated tasks inside nonisolated deinits
to workaround the lack of synchrnous isolated deinits in Swift 6.
defining module, and diagnose redundant Sendable conformances.
We still allow re-stating inherited unchecked Sendable conformances in
subclasses because inherited Sendable conformances are surprising when
they opt out of static checking. Otherwise, warning on redundant Sendable
conformances nudges programmers toward cleaning up unnecessary retroactive
Sendable conformances over time as libraries incrementally add the
conformances directly.
It should no longer be necessary to provide an `@_alwaysEmitIntoClient` version
of `_diagnoseUnavailableCodeReached()`. This workaround was originally added to
provide compatibility with projects that were misconfigured to compile against
a newer stdlib but link against an older one.
Resolves rdar://119892482.
Control enforcement of member import visibility requirements via a new option,
instead of piggy-backing on the existing IgnoreAccessControl option. Adopt the
option when doing fallback lookups for unviable members so that the compiler
can diagnose the reason that a member is inaccessible more reliably.
Previously, with MemberImportVisibility enabled decls with the package access
level could be mis-diagnosed as inaccessible due to their access level when
really they were inaccessible due to a missing import.
Resolves rdar://131501862.