Commit Graph

1958 Commits

Author SHA1 Message Date
Kavon Farvardin
49b0e25fa5 fix the isolation of the self param in ctors and dtors
The isolation of `self` was missing on its ParamDecl of ctors
of an actor, leading to situations where closures that should
inherit the isolation of the ctor, not actually inheriting it
because they only inspect the ParamDecl.

This patch makes it so that both inits and deinits also
get their `self` isolation by making a query in the
type checker.

resolves rdar://84682865
2021-11-04 19:04:13 -07:00
Robert Widmann
1fe2e4b3e7 Relax Restrictions on Placeholder Types Appearing in Interface Types
These restrictions are meant to keep placeholder types from escaping TypeCheckType. But there's really no harm in that happening as long as we diagnose it on the way out in the places it's banned. (We also need to make sure we're only diagnosing things in primaries, but that's a minor issue). The end result is that we lose information because a lot of the AST that has placeholders in it becomes filled with error types instead.

Lift the restriction on placeholders appearing in the interface type, teach the mangler to treat them as unresolved types, and teach serialization to treat them as error types.
2021-11-03 10:29:15 -07:00
Pavel Yaskevich
09f160aabf Merge pull request #40001 from salinas-miguel/cf-cgfloat
Allow CoreFoundation to declare CGFloat
2021-11-02 13:44:49 -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
Miguel Salinas
055edaf0df allow CoreFoundation to declare CGFloat 2021-11-01 16:08:34 -07:00
Slava Pestov
0d167a435c AST: Move GenericSignatureBuilder.h from include/swift/AST/ to lib/AST/ 2021-10-30 00:35:59 -04:00
Slava Pestov
f38f25a3de AST: Factor out AbstractGenericSignatureRequest into a new buildGenericSignature() function
This is slightly cleaner.
2021-10-30 00:35:59 -04: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
elsh
10a96dff57 Module Aliasing: do not allow module real names to appear in source files / only allow aliases
Resolves rdar://83592084
2021-10-28 02:36:59 -07:00
Mishal Shah
c2fd49cebb Merge pull request #39473 from apple/rebranch
Update swift:main to support llvm-project:stable/20210726 changes (Rebranch merge)
2021-10-11 09:00:51 -07:00
elsh
daa335c42f Merge pull request #39533 from apple/es-mod3
[Module Aliasing] Modify module loaders to use module 'real name' (physical name on-disk) when loading, since it can be different from 'name' if module aliasing is used. Also use the 'real name' to add/retrieve loaded modules in ASTContext. Resolves rdar://83591943.
2021-10-06 22:19:37 -07:00
Slava Pestov
2335116aee Merge pull request #39606 from slavapestov/rqm-requirement-signature-minimization
RequirementMachine: More progress toward computing protocol requirement signatures
2021-10-06 13:19:08 -04:00
swift-ci
3f8fea8508 Merge remote-tracking branch 'origin/main' into rebranch 2021-10-06 10:17:29 -07:00
Slava Pestov
c3270742dc RequirementMachine: Compute strongly connected components from the protocol dependency graph 2021-10-05 21:30:57 -04:00
elsh
55b9fa11d8 Load modules using real names if module aliases are used
rdar://83591943
2021-10-05 10:55:22 -07:00
Meghana Gupta
f458d9b490 Fix unnecessary one-time recompile of stdlib with -enable-ossa-flag (#39516)
* Fix unnecessary one-time recompile of stdlib with -enable-ossa-flag

This includes a bit in the module format to represent if the module was
compiled with -enable-ossa-modules flag. When compiling a client module
with -enable-ossa-modules flag, all dependent modules are checked for this bit,
if not on, recompilation is triggered with -enable-ossa-modules.

* Updated tests
2021-10-04 18:46:40 -07:00
swift-ci
c51550f30e Merge remote-tracking branch 'origin/main' into rebranch 2021-09-30 15:11:41 -07:00
elsh
6b4951e31e Rename lookupModuleAlias to getRealModuleName 2021-09-30 13:29:02 -07:00
elsh
fc420d04e2 Modify setModuleAliases and lookup
Add examples to documentation comment
2021-09-29 16:40:22 -07:00
elsh
0e05d10308 Add module alias map and lookup func to ASTContext
Set module underlying name in ModuleDecl if a module alias exists
rdar://83682112
2021-09-29 16:40:22 -07:00
Slava Pestov
47ab4a9f28 AST: GenericSignatures point directly to their RequirementMachine
This avoids a hashtable lookup when performing queries.
2021-09-27 21:36:45 -04:00
swift-ci
d12197f488 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-21 08:33:46 -07:00
Artem Chikin
131a081699 Merge pull request #39326 from artemcm/MultiTargetScan
[Dependency Scanning] Make dependency scanner cache specific to a given target triple.
2021-09-21 08:16:40 -07:00
swift-ci
8fba532a11 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-20 18:33:34 -07:00
Robert Widmann
980fde2ede Lift requirementsNotSatisfiedBy Into GenericSignature 2021-09-20 15:29:51 -07:00
Artem Chikin
e64a40451b [Dependency Scanning] Model main module as separate dependency kind: SwiftSource
These kinds of modules differ from `SwiftTextual` modules in that they do not have an interface and have source-files.
It is cleaner to enforce this distinction with types, instead of checking for interface optionality everywhere.
2021-09-15 09:31:20 -07:00
swift-ci
b56685ee37 Merge remote-tracking branch 'origin/main' into rebranch 2021-09-10 13:35:21 -07:00
Hamish Knight
cab39bf26c [CS] Formalize param flag handling for imploding params
By default avoid imploding params that have parameter
flags, but carve out exceptions for ownership flags,
which can be thunked, and `@_nonEphemeral` which can
be freely dropped without issue.
2021-09-09 21:46:31 +01:00
Hamish Knight
af14bba276 [AST] Simplify AnyFunctionType::composeTuple
Remove the canonicalVararg parameter and
CanParamArrayRef wrapper. Almost none of the
callers want canonicalVararg, and the one that
does calls `getCanonicalType` on the result
anyway.
2021-09-09 21:46:31 +01:00
swift-ci
cb32b553de Merge remote-tracking branch 'origin/main' into rebranch 2021-09-04 11:32:57 -07:00
Hamish Knight
01a082a058 [AST] Adopt ArgumentList
Switch out the representation of argument lists
in various AST nodes with ArgumentList.
2021-09-01 18:40:23 +01:00
swift-ci
c6178125d9 Merge remote-tracking branch 'origin/main' into rebranch 2021-08-25 20:33:27 -07:00
Konrad `ktoso` Malawski
7c1ed4069e [Distributed] the distributed module may not be available 2021-08-26 09:46:13 +09:00
swift-ci
a18dcf3511 Merge remote-tracking branch 'origin/main' into rebranch 2021-08-24 11:34:00 -07:00
Slava Pestov
b201d482f4 Merge pull request #39015 from slavapestov/override-generics-checking
Sema: Fix generics invariant violations in override checking
2021-08-24 14:32:55 -04:00
swift-ci
2d774b0fdc Merge remote-tracking branch 'origin/main' into rebranch 2021-08-24 01:14:28 -07:00
Konrad `ktoso` Malawski
c916c0a394 [Distributed] decode init for DistributedActor (#38998)
* Revert "Revert "Merge pull request #38938 from drexin/wip-dist-resolve" (#38994)"

This reverts commit f6ae9f3387.

* [Distributed] decode init for DistributedActor
2021-08-24 17:00:58 +09:00
Slava Pestov
7c29aaf3e2 Sema: Fix generics invariant violations in override checking
Override checking checks if the derived declaration's generic
signature is compatible with the base, but it does this after
doing a bunch of other checks which feed potentially invalid
type parameters to generic signature queries.

Now that the requirement machine is stricter about this kind
of this, re-organize some code to get around this.

Unfortunately this regresses a diagnostic, because we reject
candidates with mismatched generic requirements earlier in
the process.
2021-08-23 21:52:55 -04:00
swift-ci
c74499c1e4 Merge remote-tracking branch 'origin/main' into rebranch 2021-08-20 11:14:10 -07:00
Becca Royal-Gordon
c517b45bb4 Merge pull request #38948 from beccadax/the-copypasta-is-stale
[NFC] Factor out ASTContext `operator new`s
2021-08-20 11:04:56 -07:00
Becca Royal-Gordon
59bb325e4b [NFC] Factor out ASTContext operator news
Many, many, many types in the Swift compiler are intended to only be allocated in the ASTContext. We have previously implemented this by writing several `operator new` and `operator delete` implementations into these types. Factor those out into a new base class instead.
2021-08-19 11:19:52 -07:00
swift-ci
a24a4f0339 Merge remote-tracking branch 'origin/main' into rebranch 2021-08-12 06:13:43 -07:00
Konrad `ktoso` Malawski
e1dcd776c5 [Distributed] Implement assigning address in SIL 2021-08-12 14:04:50 +09:00
swift-ci
8e11ea0ae8 Merge remote-tracking branch 'origin/main' into rebranch 2021-08-06 16:13:41 -07:00
Robert Widmann
592e90af9b Add Sugar for Variadics
We used to represent the interface type of variadic parameters directly
with ArraySliceType. This was awfully convenient for the constraint
solver since it could just canonicalize and open [T] to Array<$T>
wherever it saw a variadic parameter. However, this both destroys the
sugaring of T... and locks the representation to Array<T>. In the
interest of generalizing this in the future, introduce
VariadicSequenceType. For now, it canonicalizes to Array<T> just like
the old representation. But, as you can guess, this is a new staging
point for teaching the solver how to munge variadic generic type bindings.

rdar://81628287
2021-08-06 12:51:39 -07:00
swift-ci
f5abfc2c53 Merge remote-tracking branch 'origin/main' into rebranch 2021-08-05 18:54:12 -07:00
Arnold Schwaighofer
5a83172a55 Merge remote-tracking branch 'upstream/main' into rebranch 2021-08-05 12:04:56 -07:00
Slava Pestov
6dc9ef88d7 AST: GenericSignatures don't contain type variables 2021-08-05 14:39:07 -04:00
willtunnels
319b3e64aa Add support for opaque result types in structural positions (#38392)
* [TypeResolver][TypeChecker] Add support for structural opaque result types

* [TypeResolver][TypeChecker] Clean up changes that add structural opaque result types
2021-08-03 23:45:02 -04:00