Adds a new DynamicMemberLookupSubscriptRequest type for evaluating and
caching the validity of a `SubscriptDecl`'s usage to fulfill a
`@dynamicMemberLookup` requirement for a specific usage.
`SubscriptDecl` exposes eligibility for `@dynamicMemberLookup`
requirements directly, so the `TypeChecker` interface for these members
can be replaced.
Ensure we correctly handle the case where you're overriding a witness
that should be `public`. Currently this is working as a side-effect
of conformance checking, but we ought to be able to compute it with
lazy type-checking. No test case since it will be covered once we
rip out the eager type-checking in a following commit.
Rather than relying on running the type-checker on the whole expression,
we can just run the `#keyPath` specific logic for computing the Obj-C
string, which fills in the type-checked components of the key path.
The erasing we're doing here is only for printing purposes, that
doesn't really matter for the replacement types and avoids running into
a crash where we incorrectly grab the wrong generic signature.
A protocol that's been reparented declares it
by writing `@reparented` in its inheirtance clause
for each new parent. You can introduce a `@reparented`
parent to a pre-existing ABI-stable protocol's
inheritance hierarchy.
Only protocols declared to be `@reparentable` can be
used to reparent other protocols. Adding or removing
the `@reparentable` attribute is ABI-breaking, as it
effects the type metadata layout. Thus, reparentable
protocols must be born as such to use them with
protocols that are already ABI-stable.
This set of changes does not include the actual
implementation of ABI-stable reparenting.
Properties used as subscript keys (e.g., `dictionary[key] = 42`) were
incorrectly indexed as writes, referencing setters instead of getters.
Fix by forcing subscript arguments to be treated as reads, except for
dynamic member lookup subscripts where the argument represents the
member being accessed.
Resolves#56541
Lexer should always set `Token.CommentLength` correctly because it
necessary for restoring to the token position with comments.
Otherwise, 'Token::isAtStartOfLine()' might not correctly set.
`printModuleInterfaceDecl` printes extensions right after the type
they are associated with is printed. Extensions associated with a
type that appears in the "target" module shouldn't be added to
`SwiftDecls` because that would lead to double printing them.
Remove the DeclContext parameter from ResolveMacroRequest, we can now
retrieve the DeclContext either from the CustomAttr or macro expansion
expr/decl directly.
This means we now either produce a bare ErrorType, or an ErrorType
with a generic parameter original type for a generic parameter hole.
We ought to further consolidate this logic by sinking the generic
parameter original type replacement into `simplifyType` itself, but
I'm leaving that for a future patch since it affects completion
results and I want to try keep this close to NFC.
The `_Concurrency` and `_StringProcessing` modules are implementation details of the standard library; to developers, their contents should behave as though they are declared directly within module `Swift`. This is the exact same behavior we expect of cross-import overlays, so treat these modules as though they are cross-import overlays with no bystanding module.
Because these modules don’t re-export the standard library, it’s also necessary to treat `Swift` as a separately imported overlay of itself; do so and make that actually work.
I missed this in my previous patch that moved extension binding until
after we've mutated the AST for IDE inspection, this ad-hoc extension
binding logic is no longer necessary.