Both of these functions are single-apply instance members,
even though their names could be compound the application
is still a regular call with like `next(isolation: ...)`
vs. `next(isolation:)(...)` it would have to be for a "compound"
application.
Operator references don't have a base type and could be found via
unqualified lookup, `adjustFunctionTypeForConcurrency` should handle
them specifically.
Resolves: rdar://131321053
This aims to help with cases like `_ = { x in x = 0 }` or `.test = 42`
which are currently supported because the member is eagerly bound to
an `@lvalue $T` during constraint generation.
The implementation of `#if` configuration evaluation assumed that the
SourceFile instance within the `Parser` contained all of the source ranges
for code parsed within that `Parser` instance. This is not always the case,
so avoid using the SourceFile directly and instead use the source buffer
that directly contains the condition.
Fixes https://github.com/swiftlang/swift/issues/76137. Big thank you
to Alex Hoppen and the stress tester for finding this.
Some invalid specializations were previously allowed by the compiler
and we found some existing code that used that (albeit invalid) syntax,
so we need to stage that error as a warning until Swift 6 language mode
to avoid source compatibility break.
Resolves: rdar://134740240
Also, move this rule from the computation of lowered captures in SIL,
to the computation of AST captures in Sema. This allows us to
correctly handle the case where an async function nests inside a
sync function. It also removes a special case that was added recently
to cope with a generic `self` type.
Fixes rdar://129366819.
Constraint generation uses a special pattern while generating
constraints for assignments to make sure that the source type
is convertible to r-value type of the destination.
`BindingSet::favoredOverDisjunction` needs to recognize this
pattern, where disjunction type variable is bound early, and
avoid prioritizing closure if it's connected to the "fixed type"
of the disjunction or risk losing annotations associated with
the member such as `@Sendable` or a global actor.
Resolves: rdar://131524246
We're not caching this now, but it lets us dodge annoying layering
issues because ASTGen (where this is available) sits on top of the C++
parser, which needs to call it.
Extending a protocol cannot introduce new conformances to other protocols, so
skip checking for associated conformances to public protocols when diagnosing
required availability on such an extension.
Resolves rdar://133873836.
Only constrain the availability of the synthesized typealias for an inferred
type witness by the availability of the associated type if the associated type
is less available than its protocol. Without this, source compatibility is
broken for some conformances. For example:
```
struct IdentifiableValue: Identifiable {
let id = 42
}
extension IdentifiableValue {
// error: 'ID' is only available in macOS 10.15 or newer
var nextID: ID {
return id + 1
}
}
```
Fixes a regression introduced by https://github.com/swiftlang/swift/pull/71496.
Resolves rdar://134584323
If an associated conformance comes from an associated type requirement, then
the associated conformance only needs to be as available as that associated
type.
Resolves rdar://133544161.
Previously this would result in a fallback diagnostic because
type mismatches associated with `ExistentialConstraintType`
locations weren't handled at all.
Code that wants to determine whether a given declaration should be considered
unavailable should use this new utility, which will take the unavailability of
the context of use into consideration.
NFC.
If a closure is passed as an argument to a not-fully concurrency
checked callee - require dynamic isolation checking.
This information is going to be used by SILGen to inject expected
executor precondition when necessary.
This is an important information for closures because the compiler
might need to emit dynamic actor isolation checks in some circumstances
(i.e. when a closure is isolated and passed to a not fully concurrency
checked API).
For macOS >= 11 the fixit for narrowing an availability check rather
than adding a new one should fire if the major version is the same, like
on other platforms.