Commit Graph

4090 Commits

Author SHA1 Message Date
Slava Pestov 40cb62fb54 Merge pull request #88480 from slavapestov/additional-dynamicmemberlookup-args-v2
[Sema] Support additional args in @dynamicMemberLookup subscripts 2.0
2026-05-11 17:56:52 -04:00
Slava Pestov 6b84857d6f AST: Remove useDC parameter from getDynamicMemberLookupKind() 2026-05-08 15:46:20 -04:00
Slava Pestov b062b8a285 Convert SubscriptDecl @dynamicMemberLookup checking to request
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.
2026-05-08 15:46:17 -04:00
Slava Pestov e4f99cc3be Use SubscriptDecl interface for @dynamicMemberLookup checks
`SubscriptDecl` exposes eligibility for `@dynamicMemberLookup`
requirements directly, so the `TypeChecker` interface for these members
can be replaced.
2026-05-08 15:46:17 -04:00
hectar-glitches ec2880a101 [NFC] Replace interleave(..., ", ") with interleaveComma in CompletionLookup 2026-05-07 09:49:12 -04:00
Konrad Malawski 003028c17c more rename followups for isNonisolated and the enum change 2026-04-28 09:21:23 -07:00
Konrad Malawski 77ac31d946 Rename to ActorIsolation::Kind::Nonisolated*Concurrent* 2026-04-28 09:21:23 -07:00
Konrad Malawski 3beefe5bd8 Rename CallerIsolationInheriting -> NonisolatedNonsending 2026-04-28 09:21:23 -07:00
Hamish Knight bc81852693 [Completion] Disable an assertion for now
We ought to re-enable this once we're able to rollback completion state
when backtracking in the parser.
2026-02-19 10:02:14 +00:00
Hamish Knight 48872d2dd3 [Completion] Remove old type-checking logic
All expression completions are now solver-based, so we don't need this
anymore.
2026-02-16 11:18:49 +00:00
Hamish Knight 03675896f9 [Completion] Remove some redundant #selector logic
Both of these cases are already handled in `PostfixCompletionCallback`.
2026-02-16 11:18:49 +00:00
Hamish Knight ff60f5365c [Completion] Explicitly handle witness overrides that should be public
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.
2026-02-16 11:18:49 +00:00
Hamish Knight 8bac988a63 [Completion] Use ObjCKeyPathStringRequest for #keyPath completion
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.
2026-02-16 11:18:49 +00:00
Hamish Knight 905e8a04c3 [IDE] Avoid erasing opaque replacement types
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.
2026-02-12 11:34:47 +00:00
Slava Pestov 7cd06a5088 Sema: Split off TypeVariableType.h/.cpp 2026-02-05 09:19:01 -05:00
Kavon Farvardin 4a7cedcf1e Reparenting: introduce new attributes
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.
2026-02-03 16:39:19 -08:00
Elsa Keirouz f7c21941b8 [AST] ForEachStmt: rename sequence getter/setter 2026-01-23 15:17:29 +00:00
Elsa Keirouz d54a572f7f [Sema] desugar ForEachStmt at AST level 2026-01-23 15:17:29 +00:00
Ian Leitch 2d803ef3d2 [IDE] Reference appendInterpolation calls in string interpolation (#86166)
Fix missing references to `appendInterpolation` functions called
implicitly in string interpolations.

Fixes #56189
2026-01-10 19:45:44 -08:00
Ian Leitch bbeac5b8c2 [Index] Fix incorrect setter references for subscript keys (#86119)
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
2026-01-10 17:34:33 -08:00
Rintaro Ishizaki dffd88ee51 [Parser] Eliminate 'CommentRetentionMode::None' in Lexer
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.
2025-12-10 10:10:51 -08:00
Pavel Yaskevich d8549ec6da Merge pull request #85501 from xedin/prevent-printModuleInterface-from-printing-extensions-twice
[IDE] Avoid printing some Swift extensions twice in mixed source fram…
2025-11-14 07:12:27 -08:00
Pavel Yaskevich 700d9fd669 [IDE] Avoid printing some Swift extensions twice in mixed source frameworks
`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.
2025-11-13 15:03:35 -08:00
Slava Pestov 819738c83e AST: Rename mapTypeIntoContext() => mapTypeIntoEnvironment(), mapTypeOutOfContext() => mapTypeOutOfEnvironment() 2025-11-12 14:48:19 -05:00
Anthony Latsis bda6edb85c AST: Rename GenericContext::isGeneric to hasGenericParamList
`isGeneric` is a misleading name because this method checks for the
existence of a `GenericParamList`, which is not implied by genericity.
2025-11-11 15:55:16 +00:00
Allan Shortlidge 9b7c531fd8 AST/IDE/Sema: Remove unnecessary AvailabilityInference.h includes.
NFC.
2025-10-24 16:14:49 -07:00
Hamish Knight 364eba482d [AST] Use CustomAttr's DeclContext for ResolveMacroRequest
Remove the DeclContext parameter from ResolveMacroRequest, we can now
retrieve the DeclContext either from the CustomAttr or macro expansion
expr/decl directly.
2025-10-16 11:21:54 +01:00
Becca Royal-Gordon 60b3b088d5 Merge pull request #84358 from beccadax/common-concurrency 2025-10-07 12:21:50 -07:00
Hamish Knight 5171b84dba [CS] Replace UnresolvedType with ErrorType in simplifyType/resolveType
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.
2025-10-03 09:50:42 +01:00
Becca Royal-Gordon 3abbfaa9cb Introduce separately-imported stdlib overlays
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.
2025-10-02 12:05:12 -07:00
swift-ci 499f4ff714 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-29 06:15:20 -07:00
Hamish Knight a7dd04ed6f Merge pull request #84403 from a7medev/refactor/signature-help-to-ide
[IDE] Move signature help formatting to IDE instead of SourceKit
2025-09-29 14:05:02 +01:00
Ahmed Mahmoud 6f6b9d8a61 [IDE] Simplify createSignatureString parameters 2025-09-26 22:39:46 +03:00
swift-ci 6b28979fb4 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-25 16:24:58 -07:00
Allan Shortlidge 2467b931a7 ConstraintSystem: Move key path type utilities to AST. 2025-09-25 07:13:17 -07:00
swift-ci 06fb7384ce Merge remote-tracking branch 'origin/main' into rebranch 2025-09-23 03:14:56 -07:00
Hamish Knight 14a125c2ca [IDE] Use consistent PrintOptions in swift-ide-test
Use the same set of PrintOptions when printing the results for
different requests.
2025-09-21 23:19:06 +01:00
Ahmed Mahmoud 0b123340ba [IDE] Move CodeCompletionStringBuilder.h to lib/IDE 2025-09-19 21:24:30 +03:00
Ahmed Mahmoud 2f6064675e [IDE] Move signature help formatting to IDE instead of SourceKit 2025-09-19 18:24:57 +03:00
swift-ci 781d0fdfd9 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-11 08:37:41 -07:00
Hamish Knight 9beb2e3e36 [Completion] Simplify opened function type in tryResolveDoubleAppliedFunction 2025-09-11 10:31:46 +01:00
swift-ci 95736f8e88 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-10 01:39:11 -07:00
Hamish Knight d3be024a54 [IDE] Introduce ReadyForTypeCheckingCallback
This avoids the layering violation of calling `bindExtensions` from
parser code.
2025-09-09 23:18:52 +01:00
Hamish Knight 92f2acaa67 [IDE] Remove redundant extension binding logic
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.
2025-09-09 23:18:52 +01:00
Anthony Latsis e1450e011e Manually merge remote-tracking branch 'origin/main' into rebranch
Conflicts:
*	utils/build_swift/build_swift/defaults.py
2025-09-04 14:07:50 +01:00
Ahmed Elrefaey 9d1436c1c8 [IDE] [Signature Help] Add basic signature help request to SourceKit (#83378) 2025-09-04 10:09:02 +01:00
Ahmed Elrefaey 1bc96857a8 Merge pull request #82464 from a7medev/feat/full-documentation-in-code-completion
[IDE] Add full documentation to code completion result
2025-09-04 10:06:21 +01:00
swift-ci 35ae6d8866 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-01 03:14:00 -07:00
Hamish Knight 0c3be92c10 Merge pull request #83652 from a7medev/feat/generalize-erase-archetypes
[IDE] Erase archetypes without declaration generic signature
2025-09-01 11:01:54 +01:00
swift-ci 69e3469a9f Merge remote-tracking branch 'origin/main' into rebranch 2025-08-31 03:55:05 -07:00