Commit Graph

2017 Commits

Author SHA1 Message Date
Luciano Almeida
90c5dfa9ed [Parse] Track whether an let _: pattern is an async let pattern 2022-04-17 14:06:39 -03:00
Hamish Knight
5a8dff0a76 [Parse] Emit error on prefix operator containing /
When forward slash regex is enabled, start emitting
an error on prefix operators containing the
`/` character.
2022-04-12 16:03:48 +01:00
Slava Pestov
1bf248e374 Enable parameterized protocols by default, and add new staging flag for parameterized existentials 2022-04-06 17:30:10 -04:00
Alex Hoppen
9456fa12ed Merge pull request #41922 from ahoppen/pr/migrage-accessorbeginning-solver-based
[CodeCompletion] Migrate AccessorBeginning to solver-based
2022-04-05 17:50:48 +02:00
Slava Pestov
8c47cd75fd Sema: The primary associated type list references existing associated types instead of declaring new ones 2022-04-03 22:03:49 -04:00
Alex Hoppen
8cd5bbd5e6 [CodeCompletion] Migrate AccessorBeginning to solver-based 2022-04-03 16:46:23 +02:00
Evan Wilde
aa51bdf17a Add noasync availability kind to available attr
This patch adds the `noasync` availability kind to `@available`. The
spelling is `@available(*, noasync)`.
2022-03-22 15:12:51 -07:00
Allan Shortlidge
0c5cc38615 Parse: Add fix-its for 'before:' label parse errors in the @_backDeploy attribute. 2022-03-18 12:28:19 -07:00
Allan Shortlidge
2a646dc438 Parse: Require a "before: " label in the first item of the list in the @_backDeploy attribute in order to match the pitched syntax for the attribute. Refactor existing comma separated list parsing code to take advantage of part of it in the attribute parsing. 2022-03-18 11:31:34 -07:00
Robert Widmann
aa82a857f0 Merge pull request #41848 from CodaFi/parse-tial-credit 2022-03-17 15:35:11 -07:00
Robert Widmann
cc0bc22dcb Correct The Parsing of Primary Associated Type Clauses in Protocols
The prior syntax tree did not take into account that the clause itself should own the angle brackets.
2022-03-16 17:28:45 -07:00
Robert Widmann
363954a416 Put Variadic Generics Behind a Flag 2022-03-16 14:22:03 -07:00
Konrad `ktoso` Malawski
13cc8b3157 [Distributed] Enable no-longer-experimental distributed by default 2022-03-11 22:14:49 +09:00
Allan Shortlidge
b29251219a Parse: Add availability macro support to @_backDeploy attribute parsing. Consolidate parsing code shared between @_originallyDefinedIn and @_backDeploy. 2022-03-08 14:13:10 -08:00
Xi Ge
3ca3e05377 Share string literal for spi_available attribute name 2022-03-05 19:23:00 -08:00
Xi Ge
ce07ce2dbc frontend: add basic support for @_spi_available 2022-03-04 21:26:56 -08:00
Slava Pestov
a013cd2076 AST: Replace PrimaryAssociatedTypeAttr with AssociatedTypeDecl::isPrimary() flag 2022-03-03 10:15:02 -05:00
Slava Pestov
7dfc2a20fb Parse: New syntax for primary associated types 2022-03-03 00:08:00 -05:00
Allan Shortlidge
24613134de SILGen: Add a SILGen test for the @_backDeploy attribute and fix parsing for the attribute so that -verify-syntax-tree passes. The SILGen test doesn't verify anything special yet since we're not emitting thunks yet at call sites. 2022-02-11 14:47:48 -08:00
Allan Shortlidge
ebfb94e710 Parse: Refactor platform version tuple list parsing for @_backDeploy into a separate function and improve diagnostics. 2022-02-08 10:36:41 -08:00
Allan Shortlidge
b860e762b2 AST: Introduce the @_backDeploy function attribute:
- Parse the attribute and diagnose parsing issues
- Serialize the attribute
2022-02-08 10:11:04 -08:00
Doug Gregor
7149702d12 Rename @_predatesConcurrency to @preconcurrency.
Introduce the `@preconcurrency` attribute name for `@_predatesConcurrency`,
which has been the favored name in the pitch thread so far. Retain the
old name for now to help smooth migration.
2022-01-26 08:39:01 -08:00
Erik Eckstein
beb2bd2a96 AST: support @_effects attribute with custom strings.
In addition to the predefined cases,  like "readnone", "readonly", etc. support providing a custom string, which will be parsed later.
Also, allow multiple effects attributes to be put onto a function.
2022-01-25 11:29:23 +01:00
Erik Eckstein
5fd941eb67 Add the @exclusivity attribute.
The `@exclusivity(unchecked)` attribute can be used on variables to selectively disable exclusivity checking.
For completeness, also the `@exclusivity(checked)` variant is supported: it turns on exclusivity checking for specific variables if exclusivity enforcement is disabled by the command line option.

This new attribute is a missing implementation part of SE-0176 (https://github.com/apple/swift-evolution/blob/main/proposals/0176-enforce-exclusive-access-to-memory.md).

rdar://31121356
2022-01-25 08:06:45 +01:00
Angela Laar
54a738b0bb Merge branch 'main' into smooth_operator 2022-01-20 12:17:09 -08:00
Angela Laar
3eb2b1c67b Fix error definition 2022-01-13 13:53:50 -08:00
Angela Laar
68ec09b7e2 [Parser] Check for postfix operator in import paths
Add diagnostic and remove operator from path
Fixes rdar://87159294
2022-01-12 18:18:16 -08:00
Luciano Almeida
91966deeb7 Merge pull request #40705 from LucianoPAlmeida/SR-15657-diag-enum-cp
[Sema] Avoid misleading diagnostics for incomplete enum computed properties
2022-01-11 09:25:19 -03:00
Doug Gregor
43324e8130 Merge pull request #40710 from DougGregor/structural-opaque-result-types 2022-01-04 20:51:14 -08:00
LucianoAlmeida
29879ea822 [Parser] Improving wording for invalid empty computed properties and subscripts 2022-01-04 23:46:09 -03:00
Doug Gregor
b2aa85183d Use TypeRepr::hasOpaque() consistently.
Replace shallow checks for `OpaqueReturnTypeRepr` with calls to
`hasOpaque`, which ensures that we consider opaque result types in
structural positions.
2021-12-27 20:11:40 -08:00
Evan Wilde
319672d084 Merge pull request #40668 from etcwilde/ewilde/an-actor-for-your-thoughts
Fix miss-parse diagnostic to say "actor"
2021-12-22 08:16:59 -08:00
Rintaro Ishizaki
7c92a8e555 [SourceKit] Add a request to generate object files in SourceKit
Add 'request.compile'
2021-12-21 14:35:38 -08:00
Evan Wilde
c61ae352b1 Fix miss-parse diagnostic to say "actor"
Diagnostic for miss-parsing actors for missing '{' and '}' would say
"class" instead of "actor". This patch fixes it.
2021-12-21 14:00:14 -08:00
Evan Wilde
b15adeab4f Merge pull request #40601 from etcwilde/ewilde/no-main-in-sil
Don't emit `@main` into SIL
2021-12-17 07:21:22 -08:00
Evan Wilde
86d4f83de9 Make @main non-simple
We want to control when the attribute gets emitted so we need to make
the attribute non-simple.
2021-12-16 16:31:15 -08:00
Robert Widmann
6f8f19e17f Use Recovery-Provided Variable When Parsing 'async' 2021-12-13 12:26:03 -08:00
Evan Wilde
aa9085a3d8 Handle attr parse failures
Adding nice error messages for when things go wrong.
2021-12-08 09:39:24 -08:00
Evan Wilde
3a13721eae Add optional message to unavailablefromasync
Adding the ability to add an optional message to the unavailable from
async attribute. This can be used to indicate other possible API to use,
or help explain why it's unavailable.
2021-12-08 09:39:24 -08:00
Saleem Abdulrasool
349af3707d Merge pull request #40305 from compnerd/semitruck
gardening: make c++98-compat-extra-semi an error
2021-11-30 08:18:36 -08:00
Saleem Abdulrasool
910fbee14e gardening: make c++98-compat-extra-semi an error
This cleans up 90 instances of this warning and reduces the build spew
when building on Linux.  This helps identify actual issues when
building which can get lost in the stream of warning messages.  It also
helps restore the ability to build the compiler with gcc.
2021-11-27 11:40:17 -08:00
Xi Ge
06e63896cd ModuleInterface: consume _const keyword at var and parameter decls and keep them in textual/binary modules
This is to ensure users can start adding these annotations. Type checker supports will come in later commits.

Related to pitch: https://forums.swift.org/t/pitch-compile-time-constant-values/53606

rdar://85268028
2021-11-19 22:13:23 -08:00
Doug Gregor
5cc00c289d Remove the @_unsafeSendable/@_unsafeMainActor attributes.
These have been subsumed by @_predatesConcurrency. Leave in minimal
parser support that warns about the removal, so we don't fully break
existing source code.
2021-11-18 11:21:03 -08:00
Ellie Shin
89fb5ff3fc Merge branch 'main' into es-param 2021-11-08 17:55:25 -08:00
Ellie Shin
06683cda43 Add module alias lookup option enum
Pass the enum param to ASTContext::getRealModuleName
2021-11-08 17:51:27 -08:00
Robert Widmann
f807dfe9e3 Parse @_typeSequence in Generic Parameter Position
Stage in the parsing for this attribute, nothing else.

Motivated by two important reasons:

1) The pitch for variadic generics does not lay down a concrete syntax
   for variadic generic parameters.
2) Paring T... and T* needlessly complicate the lexer as we must now
   disambiguate them with respect to other internal operator characters
   (e.g. `T...>` must lex as `(T...)>` and not `T ...>`

Which itself adds another motivation

3) We need to start parsing this attribute *now* to avoid condfail'ing
   ourselves later.
2021-11-02 14:42:12 -07:00
Ellie Shin
b294fe94f2 Merge pull request #39929 from apple/es-src
Module Aliasing: do not allow module real names to appear in source files (only allow module aliases).
Resolves rdar://83592084
2021-11-01 17:50:49 -07:00
Karoy Lorentey
8ea88b7582 [Parse] Register a syntax context while parsing availability macros 2021-10-31 17:14:35 -07:00
Ellie Shin
66d64b610d Updates params to ASTContext::getRealModuleName 2021-10-29 01:52:33 -07:00
elsh
daf07c0306 Update getRealModuleName
Assert map is empty in setModuleAliases
Update doc comments
2021-10-28 23:43:16 -07:00