Commit Graph

464 Commits

Author SHA1 Message Date
Holly Borla
f15ef1a055 [Concurrency] Allow isolated parameters to have optional type. 2024-01-09 21:37:24 -08:00
Sophia Poirier
073f541734 [Concurrency] promote GlobalConcurrency from experimental to future feature 2024-01-06 19:07:23 -08:00
Ben Barham
d51c58a6f9 [Basic] hasFeature should succeed for promoted language features
Merge `$<Feature>` and `hasFeature` implementations.
  - `$<Feature>` did not support upcoming language features.
  - `hasFeature` did not support promoted language features and also
    didn't take into account `Options` in `Features.def`.

Remove `Options` entirely, it was always one of three cases:
  - `true`
  - `langOpts.hasFeature`
  - `hasSwiftSwiftParser`

Since `LangOptions::hasFeature` should always be used anyway, it's no
longer necessary. `hasSwiftSwiftParser` can be special cased when adding
the default promoted language features (by removing those features).

Resolves rdar://117917456.
2024-01-05 10:26:13 -08:00
Doug Gregor
baaa8f3e5b Merge pull request #70677 from DougGregor/se-0413-typed-throws
Enable SE-0413 "Typed Throws" by default
2024-01-04 16:11:26 -08:00
Doug Gregor
b9c5aca15f Enable SE-0413 "Typed Throws" by default 2024-01-02 15:34:07 -08:00
Michael Gottesman
abba624f6e Add an experimental option TransferringArgsAndResults.
Just splitting off a larger commit to make this easier to review.
2024-01-02 15:03:05 -08:00
Angela Laar
c1af52c2f2 Merge pull request #70419 from angela-laar/group-actor-isolation-errors
Group actor isolation errors
2023-12-18 08:42:26 -08:00
Andrew Trick
ace9937e95 Rename NonesapableTypes feature
Follow the feature flag convention for capitalization and be
consistent with the related NoncopyableGenerics feature.

This is a new feature that no wild Swift code has used it yet:

commit e99ce1cc5d
Author: Kavon Farvardin <kfarvardin@apple.com>
Date:   Tue Dec 5 23:25:09 2023

    [NCGenerics] add `~Escapable`

    Basic implementation of `~Escapable` in the type system.
2023-12-14 11:32:03 -08:00
Erik Eckstein
88173948d9 make FixedArrays feature available in non-assert compiler builds 2023-12-13 17:06:25 +01:00
Angela Laar
4d2b01b0be Group Actor Isolation errors
The number of errors in a function scope can scale exponentially,
making it hard to root cause and resolve unless we group them into
a single error. Grouping the error diagnostics will considerably
improve the concurrency user experience.
2023-12-12 16:23:10 -08:00
Konrad `ktoso` Malawski
828f589be4 Initial Task Executor implementation Task(on:), addTask(on:) etc. (#68793)
Co-authored-by: John McCall <rjmccall@gmail.com>
2023-12-12 17:14:24 +09:00
eeckstein
484fc77a8c Merge pull request #70301 from eeckstein/fixed-array
Add experimental support for fixed arrays
2023-12-11 09:36:29 +01:00
Erik Eckstein
a0f8d65be7 AST: add feature flag "FixedArrays" 2023-12-09 18:49:57 +01:00
Erik Eckstein
dd9ce40ba1 add the allocVector builtin 2023-12-09 18:49:57 +01:00
Slava Pestov
335d6ffea1 Frontend: Add -disable-experimental-associated-type-inference flag 2023-12-08 13:39:10 -05:00
nate-chandler
54a152f284 Merge pull request #69938 from nate-chandler/rdar96919870/1/bitwise-copyable-protocol
[BitwiseCopyable] Add a marker protocol.
2023-12-01 06:57:11 -08:00
Holly Borla
2aa8d56997 Merge pull request #70123 from hborla/swift-6-upcoming-features
[Features] Update upcoming feature flags for Swift 6.
2023-11-30 19:00:20 -08:00
Nate Chandler
b266abe5c0 [BitwiseCopyable] Add a marker protocol.
Behind the experimental feature BitwiseCopyable.
2023-11-30 15:25:46 -08:00
Holly Borla
575514e906 [Feataures] Add an upcoming feature flag for complete concurrency checking. 2023-11-29 22:09:37 -08:00
Zhiyu Zhu/朱智语
9d1a92eb72 [Compile Time Constant Extraction] Add @extractConstantsFromMembers (#69944)
Add @extractConstantsFromMembers attribute under ExtractConstantsFromMembers experimental feature flag
2023-11-29 08:49:57 -08:00
Holly Borla
7cb9880b04 [Features] Gate SE-0383 behind an upcoming feature flag. 2023-11-29 07:35:37 -08:00
Holly Borla
d135ce7ce4 [Features] Don't enable ExistentialAny by default in Swift 6. 2023-11-28 09:47:14 -08:00
Doug Gregor
0eb71d1c03 Merge pull request #70034 from DougGregor/function-body-macros
Function body macros
2023-11-28 09:43:40 -08:00
Alejandro Alonso
e214ba5092 Merge pull request #69735 from Azoy/static-exclusive-only
Introduce @_staticExclusiveOnly
2023-11-27 21:24:56 -08:00
Doug Gregor
36a2dcd927 Implement function body macros
Function body macros allow one to introduce a function body for a
particular function, either providing a body for a function that
doesn't have one, or wholesale replacing the body of a function that
was written with a new one.
2023-11-27 17:04:55 -08:00
Ben Rimmington
badac8fd10 [SE-0413] Update Features.def (#70038)
* Fix SE-number of `FullTypedThrows` feature.
* Fix copyright years.
2023-11-27 18:33:33 +00:00
Alejandro Alonso
7da7c73c71 Introduce @_staticExclusiveOnly 2023-11-27 09:11:13 -08:00
Rintaro Ishizaki
f3f4b19776 [ASTGen] Remove ASTGenTypes experimental feature
There's no reason to generate only TypeRepr using ASTGen anymore.
Use ParserASTGen feature to test test/ASTGen/types.swift because
ASTGen now can generate the whole test file for type checking.
2023-11-12 21:43:09 -08:00
Angela Laar
eb277d9ee7 Merge pull request #67498 from angela-laar/implicit-sendable-for-methods
[Sema] Implicitly add @Sendable attribute to partial methods
2023-11-07 16:46:16 -08:00
Angela Laar
c09ec72e85 [Constraint System] Always add Sendable to unapplied function applications 2023-11-07 13:37:24 -08:00
Yuta Saito
79b3d2d626 Add underscore prefix to extern attribute
It's already guarded by a feature flag, but it would be nice to signal
users that it's not stable yet by adding an underscore prefix.
2023-11-07 02:01:02 +00:00
Michael Gottesman
cb46851194 [region-isolation] Rename the experimental feature to RegionBasedIsolation.
This ensures that the pass is called TransferNonSendable but the experimental
feature is RegionBasedIsolation.
2023-10-26 12:01:44 -07:00
Michael Gottesman
0bad8f9b67 [region-isolation] Rename SendNonSendable.cpp -> TransferNonSendable.cpp. 2023-10-26 12:01:44 -07:00
Angela Laar
de3b4bad43 [Constraint System] Exclude 'Single' and 'Double' function application from Sendable Inference 2023-10-25 17:02:29 -07:00
Angela Laar
34ca702031 [Frontend] Feature flag for InferredSendableMethods 2023-10-25 12:30:24 -07:00
Yuta Saito
4f0e3bf3ea Merge pull request #69207 from kateinoigakukun/yt/cdecl-without-body
Introduce `@extern(c)` to declare C function without Clang module
2023-10-23 12:48:12 -07:00
Harlan Haskins
4ac34a40ea @retroactive conformance syntax and checking (#36068) 2023-10-20 14:27:03 -07:00
Yuta Saito
69479933df [c-interop] Rename @_extern to @extern
Now the feature is gated by experimental feature flag.
It's not shipped in any language release, so this rename should be fine.
2023-10-20 17:37:43 +00:00
Yuta Saito
03ed46aa74 [c-interop] Gate @_extern behind experimental feature flag 2023-10-20 17:04:36 +00:00
Joe Groff
7dbab5e929 Enable MoveOnlyResilientTypes feature. 2023-10-19 11:46:08 -07:00
Andrew Trick
681a2b72e0 Merge pull request #69164 from atrick/nonescapable_attr
Add a temporary @_nonEscapable and @_hasUnsafeNonEscapableResult attribute
2023-10-17 21:39:10 -07:00
Alexis Laferrière
64cd96e629 Merge pull request #69210 from xymus/export-as-module-interface-by-default
ModuleInterface: Always ignore export-as for printing references in private swiftinterfaces
2023-10-17 16:41:37 -07:00
Andrew Trick
1f521cd7f1 Add -experimental-feature NonEscapableTypes 2023-10-17 12:45:00 -07:00
Doug Gregor
083333f17f [Typed throws] Add upcoming feature FullTypedThrows
Introduce the upcoming feature `FullTypedThrows`. When enabled, infer
the error type of a `throw` statement based on its original type,
instead of always being `any Error`. This is technically a
source-breaking change, hence the upcoming feature flag.
2023-10-16 23:14:41 -07:00
Alexis Laferrière
6f1a774e7d [ModuleInterface] Always ignore export-as in private swiftinterfaces
Always print the real module name for references in private
swiftinterfaces, ignoring export-as declarations. Keep using the
export-as name for the public swiftinterface only.

The flag `ModuleInterfaceExportAs` used to enable this behavior and
we're removing it to make it the default.

rdar://115922907
2023-10-16 13:19:55 -07:00
Alexis Laferrière
322ada60c8 [Sema] Intro flag to default imports to internal, the Swift 6 mode
The feature InternalImportsByDefault makes imports default to internal instead
of public. Applying the Swift 6 behavior of SE-0409 in Swift 5.

Let's use only that flag to track the Swift 6 behavior as well instead
of separately checking for the language version.
2023-10-10 09:09:21 -07:00
Hamish Knight
042ccdda01 Merge pull request #68344 from hamishknight/do-it 2023-10-10 10:26:12 +01:00
Holly Borla
5a81c00b3e [Concurrency] Rename IsolatedDefaultArguments to IsolatedDefaultValues. 2023-10-06 16:59:41 -07:00
Hamish Knight
33f94bc874 Introduce do expressions 2023-10-06 11:17:48 +01:00
Holly Borla
95a7107872 [Concurrency] Allow default arguments to require actor isolation.
Type checking a default argument expression will compute the required
actor isolation for evaluating that argument value synchronously. Actor
isolation checking is deferred to the caller; it is an error to use a
default argument from across isolation domains.

Currently gated behind -enable-experimental-feature IsolatedDefaultArguments.
2023-10-04 13:12:11 -07:00