Commit Graph

19 Commits

Author SHA1 Message Date
Karoy Lorentey
9ecfac21ff [test] Adjust tests now that Optional supports nonescapable use
`Optional` is now depending on `$NonescapableTypes`, and thus the compiler no longer generates `#else` branches to allow suppressing that feature.
2025-03-24 12:15:57 -07:00
Karoy Lorentey
4ff38db976 [test] Adjust for Optional relying on $NonescapableTypes now 2025-03-24 12:15:50 -07:00
Michael Gottesman
ccb6c665f3 Add REQUIRES: asserts to a test that needs asserts. 2024-11-06 17:08:25 -08:00
Daniel Rodríguez Troitiño
ba68faaed5 [test] Mark tests that use experimental/upcoming features as such
Find all the usages of `--enable-experimental-feature` or
`--enable-upcoming-feature` in the tests and replace some of the
`REQUIRES: asserts` to use `REQUIRES: swift-feature-Foo` instead, which
should correctly apply to depending on the asserts/noasserts mode of the
toolchain for each feature.

Remove some comments that talked about enabling asserts since they don't
apply anymore (but I might had miss some).

All this was done with an automated script, so some formatting weirdness
might happen, but I hope I fixed most of those.

There might be some tests that were `REQUIRES: asserts` that might run
in `noasserts` toolchains now. This will normally be because their
feature went from experimental to upcoming/base and the tests were not
updated.
2024-11-02 11:46:46 -07:00
Hamish Knight
2d7500eda6 [AST] Remove ParenType
Today ParenType is used:

1. As the type of ParenExpr
2. As the payload type of an unlabeled single
   associated value enum case (and the type of
   ParenPattern).
3. As the type for an `(X)` TypeRepr

For 1, this leads to some odd behavior, e.g the
type of `(5.0 * 5).squareRoot()` is `(Double)`. For
2, we should be checking the arity of the enum case
constructor parameters and the presence of
ParenPattern respectively. Eventually we ought to
consider replacing Paren/TuplePattern with a
PatternList node, similar to ArgumentList.

3 is one case where it could be argued that there's
some utility in preserving the sugar of the type
that the user wrote. However it's really not clear
to me that this is particularly desirable since a
bunch of diagnostic logic is already stripping
ParenTypes. In cases where we care about how the
type was written in source, we really ought to be
consulting the TypeRepr.
2024-10-31 11:32:40 +00:00
Allan Shortlidge
c02fc4724d Tests: Remove -disable-availability-checking from many Concurrency tests.
Instead, use the `%target-swift-5.1-abi-triple` substitution to compile the tests
for deployment to the minimum OS versions required for use of _Concurrency APIs.
2024-10-18 16:21:51 -07:00
Michael Gottesman
63146bcbcd [sending] Change suppression to use __owned instead of consuming.
The reason why I am doing this is that consuming could cause no implicit
copy errors. Instead __owned will just potentially cause an error if
someone assigns into sending.

rdar://131066640
2024-07-10 12:43:33 -07:00
Allan Shortlidge
363b875117 Tests: Update sending_conditional_suppression.swift. 2024-07-09 15:53:43 -07:00
Allan Shortlidge
b85da32707 AST: Promote OptionalIsolatedParameters feature to baseline. 2024-07-09 14:28:29 -07:00
Allan Shortlidge
365d26e323 AST: Promote ExpressionMacroDefaultArguments feature to baseline. 2024-07-09 14:28:29 -07:00
Michael Gottesman
fdd435a782 [sending] Replace sending with consuming when suppressing sending from arguments in swiftinterface files.
Previously we would just not print sending. This causes problems since sending
implies a +1 parameter and by removing it we convert the parameter to a +0
parameter, breaking ABI. In this commit, I make it so that when we suppress
sending from argument parameters, we just replace it with consuming so that we
preserve ABI even for callers who do not support sending.

rdar://131066640
2024-07-08 12:34:18 -07:00
Michael Gottesman
af82326855 Mark an -Xllvm flag with -Xllvm... 2024-05-31 10:01:59 -07:00
Michael Gottesman
bfb5096e81 [sending] Add some code coverage for globals. 2024-05-30 22:19:11 -07:00
Michael Gottesman
f7bbbbeea2 [ast] Add an asserts only option that causes the AST printer to print out an increasing ID for all suppressed statements.
I am using this to better test out suppression statements. I am finding that
FileCheck runs into issues with some of the '#if' lines I am trying to match. I
am able to use this option with my asserts only test to uniquely identify a '#if
...' statement and thus have the pattern matching work. I needed this to get the
test in the next commit to pass testing.
2024-05-30 22:19:11 -07:00
Michael Gottesman
11f86a5488 [sending] Teach sending how to suppress sending from functions passed to inits.
rdar://129045783
2024-05-30 22:19:11 -07:00
Michael Gottesman
14c4576889 [sending] Make it so that we suppress fields of Nominal Types in API notes.
rdar://129045783
2024-05-30 22:19:11 -07:00
Michael Gottesman
97710b4773 [sending] Add some more test coverage for public/internal methods of NominalTypes.
These already worked... I am just adding the code coverage before I fix a
different issue in the next commit. This will make it clearer what I am actually
fixing in the next commit when one reads the tests.
2024-05-30 22:12:09 -07:00
Michael Gottesman
521a70f416 [ast] Always emit compiler(>= 5.3) when emitting guards for suppressable features to guard against parser errors.
The code here was assuming that if we already emitted a compiler guard for
non-Suppressable features, we could avoid doing it for suppressable
features. The problem with this is that compiler() does more than just check for
compiler versions... it also tells the compiler that parser errors in the if
block should be ignored when if evaluates to false.

rdar://129045783
2024-05-30 22:12:09 -07:00
Michael Gottesman
20a3589763 [sending] Enable sending whenever region isolation is enabled and make SE-0430 an upcoming feature.
I also added support for expressing suppressable upcoming features.

rdar://128216574
2024-05-17 19:56:29 -07:00