Allan Shortlidge
67d784fbaf
Sema: Diagnose invalid platform versions in @_originallyDefinedIn.
...
Part of rdar://155558161.
2025-07-14 16:40:09 -07:00
Hamish Knight
a3eed77738
[Parse] Fix isEditorPlaceholder checks in the parser
...
Factor out `Token::isEditorPlaceholder` and make sure we're checking
the token's raw text, ensuring we don't ignore backticks.
2025-06-30 21:16:22 +01:00
Alexis Laferrière
81a0f98783
Merge pull request #82194 from xymus/cdecl-parser
...
Parser: Accept `@cdecl` with an optional identifier for a custom C name
2025-06-27 15:06:11 -07:00
Alexis Laferrière
d9566c6c1e
ASTGen: Accept @cdecl
2025-06-11 12:42:38 -07:00
Meghana Gupta
44e05fa858
[NFC] Update tests and diagnostics
2025-06-07 12:49:01 -07:00
Pavel Yaskevich
e1e9f04398
Merge pull request #81863 from xedin/using-for-default-isolation-in-file-context
...
[AST/Sema] SE-0478: Implement `using` declaration under an experimental flag
2025-06-02 09:56:29 -07:00
Pavel Yaskevich
c246a7a372
[AST/Sema] Hide using declaration behind DefaultIsolationPerFile experimental feature
2025-05-31 10:49:50 -07:00
Pavel Yaskevich
4b5105df5e
[ASTGen] Implement bridging for using declaration
2025-05-30 15:52:09 -07:00
Hamish Knight
5d1f219acb
Change InlineArray sugar separator x -> of
2025-05-30 13:50:22 +01:00
Arnold Schwaighofer
13ff5abdb8
Introduce @specialized attribute
...
Implements SE-0460 -- the non-underscored version of @specialized.
It allows to specify "internal" (not abi affecting) specializations.
rdar://150033316
2025-05-23 13:12:47 -07:00
Pavel Yaskevich
17b8f7ef12
[Sema] Validate that @_inheritActorContext is used only on @Sendable/sending and async/@isolated(any) parameters
2025-05-14 20:08:00 -07:00
Pavel Yaskevich
c0aca5384b
[ASTGen] Transform @_inheritActorContext into a custom attribute with an optional modifier
2025-05-14 20:07:59 -07:00
Becca Royal-Gordon
01431b87b2
Make @abi non-experimental
...
This includes changing the feature name so that compilers with the experimental feature don’t accidentally pick up content that only works in the final version.
Resolves rdar://150065196.
2025-05-05 13:50:51 -07:00
Pavel Yaskevich
f1b3c7b604
[AST] Remove ExecutionAttribute experimental feature
...
SE-0461 has been accepted and `@concurrent` and `nonisolated(nonsending)`
can be make generally available now.
2025-04-11 15:59:25 -07:00
Pavel Yaskevich
07ff063ae3
[AST/ASTGen/Sema/Serialization] Remove @execution attribute
...
Complete the transition from `@execution` to `@concurrent` and `nonisolated(nonsending)`
2025-04-11 15:59:25 -07:00
Pavel Yaskevich
4b8c8e7d72
[AST/Sema] Replace @execution(concurrent) with @concurrent
2025-04-11 12:08:29 -07:00
Becca Royal-Gordon
3baba0b262
Type check @abi decls (sans attrs)
...
This commit compares the decl inside the `@abi` attribute to the decl it’s attached to, diagnosing ABI-incompatible differences. It does not yet cover attributes, which are a large undertaking.
2025-03-26 10:47:13 -07:00
Hamish Knight
f8ab391737
Introduce type sugar for InlineArray ( #80087 )
...
* [CS] Decline to handle InlineArray in shrink
Previously we would try the contextual type `(<int>, <element>)`,
which is wrong. Given we want to eliminate shrink, let's just bail.
* [Sema] Sink `ValueMatchVisitor` into `applyUnboundGenericArguments`
Make sure it's called for sugar code paths too. Also let's just always
run it since it should be a pretty cheap check.
* [Sema] Diagnose passing integer to non-integer type parameter
This was previously missed, though would have been diagnosed later
as a requirement failure.
* [Parse] Split up `canParseType`
While here, address the FIXME in `canParseTypeSimpleOrComposition`
and only check to see if we can parse a type-simple, including
`each`, `some`, and `any` for better recovery.
* Introduce type sugar for InlineArray
Parse e.g `[3 x Int]` as type sugar for InlineArray. Gated behind
an experimental feature flag for now.
2025-03-23 15:31:37 -07:00
Rintaro Ishizaki
92a6fece48
[ASTGen] ObjC improvements
...
* Generate `#selector(...)` expression
* Generate `#keyPath(...)` expression
* Implicit `@objc` attribute for `@_objcImplementation` attribute
2025-03-20 05:04:58 -07:00
Andrew Trick
64a48d08e1
Update tests for strict @lifetime type checking
2025-03-19 11:59:04 -07:00
Rintaro Ishizaki
202effd1a3
Merge pull request #80046 from rintaro/old-ownership-spellings
...
[ASTGen] map oldOwnershipOperatorSpellings feature flag
2025-03-17 14:55:31 -07:00
Rintaro Ishizaki
54da89e4a7
[ASTGen] Handle 'read' and 'modify' accessors
2025-03-16 17:41:21 -07:00
Rintaro Ishizaki
7add493002
[ASTGen] Generate '@_spi_available' attribute
2025-03-16 17:41:21 -07:00
Rintaro Ishizaki
607d122fe9
[ASTGen] Handle several missing syntax
...
* MissingExpr: Generate ErrorExpr with previous token location
* MissingType: Generate ErrorTypeRepr with previous token location
* MissingPattern: Generate implicit '_' pattern for recovery
2025-03-16 17:41:21 -07:00
Rintaro Ishizaki
ddd5b12661
[ASTGen] Handle trailing where clause in macro declarations
2025-03-16 17:41:21 -07:00
Rintaro Ishizaki
a7b427dea6
Feature oldOwnershipOperatorSpellings
2025-03-16 17:38:07 -07:00
Rintaro Ishizaki
a2e40d6c31
[ASTGen] Generate @_typeEraser attribute
2025-03-16 15:18:59 -07:00
Rintaro Ishizaki
d1f892cbdc
[ASTGen] Generate '@reasync' and '@rethrows'
...
Also, fallback 'shouldBeRejectedByParser' attribute names to
'CustomAttr'.
2025-03-16 15:14:27 -07:00
Rintaro Ishizaki
3d91c33c14
[ASTGen] Handle 'prefixed(_)' in macro introduced names
...
'_' is not a 'DeclReferenceExprSyntax', but a
'DiscardAssignmentExprSyntax'.
2025-03-16 15:09:07 -07:00
Rintaro Ishizaki
6a7aacd86c
[ASTGen] Fix '@differentiable' attribute
...
* Typo: '_liner' -> '_linear'
* Accept '@differentiable(_linear)' type attribute
2025-03-16 15:05:49 -07:00
Rintaro Ishizaki
c90768f36e
[ASTGen] Fix NamedOpaqueReturnTypeRepr
...
Generic parameter list was missing
2025-03-16 14:59:43 -07:00
Rintaro Ishizaki
bc668b6232
[ASTGen] Fix nullability
...
For 'arbitrary' macro names
2025-03-16 14:48:00 -07:00
Rintaro Ishizaki
925537180b
[ASTGen] Handle 'try' at the first element of SequenceExprSyntax
...
TryExpr must be hosted to wrap the whole sequence expression.
2025-03-16 14:39:01 -07:00
Rintaro Ishizaki
996e72061a
[ASTGen] Gnerate PlaceholderTypeRepr
2025-03-16 14:38:32 -07:00
Rintaro Ishizaki
ac80775201
[ASTGen] Generate miscellaneous builtin pound
...
`#error`, `#warning`, and `#assert`.
Also #_hasSymbol statement condition
2025-03-13 20:28:46 -07:00
Alejandro Alonso
d0513a7aec
Merge pull request #79665 from Azoy/value-generics-no-more-experiment
...
[AST] Make ValueGenerics feature always available
2025-03-10 15:14:34 -07:00
Rintaro Ishizaki
a506bae136
[ASTGen] Generate 'IsExpansionPattern' generic requirements
...
E.g. `where repeat each T: Comparable`
2025-03-07 10:28:47 -08:00
Rintaro Ishizaki
664ee9ab21
[ASTGen] Fix 'movesAsLike' in @_rawLayout attribute.
...
Typo: 'moveAsLike' -> 'movesAsLike'
2025-03-07 10:28:47 -08:00
Rintaro Ishizaki
017c0d98ec
[ASTGen] Generate AutoDiff attributes
...
`@differentiable`, `@derivative` and `@transpose`
2025-03-06 10:36:13 -08:00
Alejandro Alonso
c1bb143648
Make ValueGenerics feature always available
2025-02-27 10:03:37 -08:00
Rintaro Ishizaki
bdc953f418
Merge pull request #79629 from rintaro/astgen-rawlayout
...
[ASTGen] Generate '@_rawLayout' attribute
2025-02-26 15:13:25 -08:00
Rintaro Ishizaki
924e1e8bf1
[ASTGen] Generate '@_rawLayout' attribute
...
Introduce 'generateTypeRepr(expr:)'.
2025-02-26 10:20:51 -08:00
Rintaro Ishizaki
0c2309898f
[ASTGen] Rework type specifiers
...
Handle multiple specifiers. Hanle previously missing 'sending'
specifiers.
2025-02-26 04:39:38 -08:00
Rintaro Ishizaki
38bafb3872
Merge pull request #79513 from rintaro/astgen-macro-expanded-syntax
2025-02-24 15:06:24 -08:00
Rintaro Ishizaki
20f589c991
Merge pull request #79547 from rintaro/astgen-small-fixes2
2025-02-24 07:25:53 -08:00
Rintaro Ishizaki
2bf69742d1
[ASTGen] Fix ReferenceOwnershipAttr modifier
...
Similar to 7dd8944 . Modifier argument is not parsed as a keyword.
2025-02-21 18:38:24 -08:00
Rintaro Ishizaki
4160f101ad
[ASTGen] Generate @_unavailableInEmbedded attribute
...
Which is a sugar of '@available(*, unavailable)' when Embedded feature
is enabled.
2025-02-21 16:54:09 -08:00
Rintaro Ishizaki
efea164d04
[ASTGen] Generate from 'MissingTypeSyntax'
...
Just emit ErrorTypeRepr
2025-02-21 11:36:29 -08:00
Rintaro Ishizaki
f48282c92b
[ASTGen] Generate trailing where clause for SubscriptDecl
...
It was just missing.
2025-02-21 11:36:29 -08:00
Rintaro Ishizaki
c460947a73
[ASTGen] Wrap optional binding pattern with type annotation
2025-02-21 11:36:29 -08:00