Commit Graph

46922 Commits

Author SHA1 Message Date
Pavel Yaskevich
c9eac2215a Merge pull request #37292 from xedin/rdar-77022842
[CSBindings] Don't infer subtypes/supertype bindings for a closure type
2021-05-07 10:41:06 -07:00
Mishal Shah
cd64eb1eca LIT argument --incremental is deprecated
```
WARNING: --incremental is deprecated. Failing tests now always run first.
```
2021-05-07 10:36:54 -07:00
fwcd
8d35ed0fe9 Update diags in SourceKit tests to include key.id
- Update SourceKit/DocumentStructure tests
- Update SourceKit/CursorInfo tests
- Update SourceKit/SyntaxMapData tests
- Update SourceKit/Sema tests
- Update SourceKit/CompileNotifications tests
2021-05-07 19:32:04 +02:00
Artem Chikin
6f44ba4ff1 Merge pull request #37122 from artemcm/BringBackNewDriver
Revert "Merge pull request #37114 from apple/revert-36377-NewDriverDefault"
2021-05-07 09:42:38 -07:00
QuietMisdreavus
4b068acf23 Merge pull request #37248 from apple/QuietMisdreavus/synthesized-sourceOrigin
[SymbolGraph] add sourceOrigin for synthesized symbols even if no docs exist
2021-05-07 10:20:40 -06:00
Arnold Schwaighofer
970034441a Disable executor_deinit1.swift test in optimized mode
It fails on some bots.

rdar://77658743
2021-05-07 09:17:00 -07:00
Slava Pestov
0bc6cfe84b Merge pull request #37296 from slavapestov/cleaner-conformance-access-path
GSB: Rewrite getConformanceAccessPath(), again
2021-05-07 12:16:02 -04:00
Erik Eckstein
2a17d9a480 ArrayBoundCheckOpts: introduce a limit for the maximum dominator tree recursion depth
This is a quick fix for a stack overflow in case of very large functions.
TODO: Ideally this algorithm would be implemented as an iterative worklist algorithm.

rdar://77563057
2021-05-07 18:13:08 +02:00
Andrew Trick
05e1284852 Merge pull request #37285 from atrick/fix-self-capture
Fix an assert in exclusivity diagnostics when inouts escape.
2021-05-07 09:03:07 -07:00
Holly Borla
0999deac07 [SILGen] Don't pass down the context when emitting the r-value of the wrapped
or projected value in RValueEmitter::visitAppliedPropertyWrapperExpr
2021-05-07 08:51:47 -07:00
Arnold Schwaighofer
7bc446ed99 Disable test stdlib/PrintFloat.swift.gyb on arm64_32 watchos
It fails on a bot.

rdar://77087867
2021-05-07 07:53:25 -07:00
Doug Gregor
49edef8dd4 Merge pull request #37304 from DougGregor/revert-nonisolated
[Concurrency] Revert 'nonisolated let' change.
2021-05-07 07:49:03 -07:00
Doug Gregor
40c7341603 Merge pull request #37306 from DougGregor/async-let-family
Reinstate "async let", with "spawn let" as an alias.
2021-05-07 07:48:35 -07:00
Arnold Schwaighofer
ed987685ee Disable batch-mode-llvmIRHash-consistency test
It fails multiple bots.

rdar://77654695
2021-05-07 06:46:38 -07:00
Alex Hoppen
6f46ba6899 Merge pull request #36943 from ahoppen/pr/conforming-methods-in-closure
[Sema] Don’t allow unresolved type variables if `LeaveBraceStmtBodyUnchecked` is `true`
2021-05-07 14:08:25 +02:00
Hamish Knight
61be047b05 Merge pull request #37295 from hamishknight/extra-extensions
[IDE] Fix superclass constraint handling for extension merging
2021-05-07 10:49:53 +01:00
Doug Gregor
220e29d674 Reinstate "async let", with "spawn let" as an alias. 2021-05-07 00:13:56 -07:00
Doug Gregor
06dc77ddf3 Revert "[Concurrency] Resyntax 'async let' as 'spawn let'."
This reverts commit 41f42fabbf.
2021-05-06 22:18:36 -07:00
Rintaro Ishizaki
b348bf60e1 [CodeCompletion] Complete pattern introducer for 'for'
After 'for', suggest 'try', 'await', 'var' and 'case'.

rdar://76355581
2021-05-06 18:13:43 -07:00
Rintaro Ishizaki
df89d28e10 Merge pull request #37280 from rintaro/ide-completon-se0293-rdar76355405
[CodeCompletion] Update for SE-0293 Property Wrappers for func params
2021-05-06 18:10:14 -07:00
Doug Gregor
052cc7d022 [Concurrency] Revert 'nonisolated let' change.
The change made to SE-0306 to require 'nonisolated let' is undercutting
the effectiveness of the model. Revert while we work on a better
solution.
2021-05-06 17:30:11 -07:00
Ben Barham
8b3147c345 Merge pull request #37235 from bnbarham/async-refactoring-mixed-optional
[Refactoring] Only unwrap optionals if the handler has an optional error
2021-05-07 08:20:20 +10:00
Slava Pestov
e6ff771d59 GSB: Rewrite getConformanceAccessPath(), again
The new approach is to not look at RequirementSources at all. Instead,
we exhaustively enumerate all conformance access paths, beginning
from the root conformance requirements in the signature, then doing
all conformance requirements from those protocols' requirement
signatures, and so on.

We enumerate conformance access paths in breadth first order by
length until we find the one we want. The results are memoized.

This fixes a regression with another change I'm working on. The
test case does not fail with this PR alone, but I'm adding it now
anyway.
2021-05-06 17:55:43 -04:00
Hamish Knight
be39edfa7b [IDE] Fix superclass constraint handling for extension merging
For a case like:

```
public class C<T> {}
public class D {}

extension C where T : D {
  public func foo() {}
}
```

We would indadvertedly drop the extension for `C`
in the doc info, as the superclass constraint would
fail the `isBindableToSuperclassOf` check.
Instead, map the subject type of the constraint
into the context and check if it could be bound to
the superclass. In the example above, this is
trivially true, but for cases where we're mirroring
a protocol extension onto the type, this will
disregard those that don't fulfil the requirements.

Resolves rdar://76868074
2021-05-06 22:22:17 +01:00
Alexis Laferrière
3310a55682 [Test] Use the SwiftStdlib 5.5 macro in Concurrency tests 2021-05-06 13:48:49 -07:00
Alexis Laferrière
6a78e2aba9 [Test] Define availability macro SwiftStdlib 5.5 for all tests 2021-05-06 13:48:49 -07:00
Arnold Schwaighofer
34af877651 Disable IDE/import_as_member_objc.swift test
It fails on a bot in the tv simulator

rdar://77558075
2021-05-06 13:40:46 -07:00
Pavel Yaskevich
3c0388d945 [CSBindings] Don't infer subtypes/supertype bindings for a closure type
A type representing a closure expression is always bound to its
"inferred" type based on the body, so contextual bindings just
serve as a trigger to "resolve" a closure. Let's not attempt any
subtype/supertype inference for a type variable representing a
closure since if "direct" bindings have failed, it wouldn't be bound
to such types regardless.

Resolves: rdar://problem/77022842
2021-05-06 13:35:45 -07:00
Rintaro Ishizaki
a01a3ad530 [CodeCompletion] Update for SE-0293 Property Wrappers for func params
rdar://76355405
2021-05-06 13:21:27 -07:00
Pavel Yaskevich
187a43fea3 Merge pull request #37178 from xedin/rdar-75514153
[Diagnostics] Handle ambiguities related to use of `nil` literal
2021-05-06 11:52:56 -07:00
Dario Rexin
44a2bb3a9d Disable lto-autolink test on linux-aarch64 (#37277) 2021-05-06 10:28:21 -07:00
Argyrios Kyrtzidis
c417464359 Merge pull request #37252 from ahoppen/pr/missing-module-map
[ClangImporter] Load the stdlib even if there is a `-fmodule-map-file` argument pointing to a missing file
2021-05-06 09:02:22 -07:00
Robert Widmann
4c0e67cca0 Merge pull request #37283 from CodaFi/time-for-tee
Re-Enable IR Hash Test
2021-05-06 08:16:44 -07:00
Max Desiatov
7be99e4cbf Merge pull request #37084 from kateinoigakukun/katei/share-fatalerror-concurrency
Rename duplicated `swift::fatalError` in `swiftRuntime` and `swift_Concurrency`.

Both `swiftRuntime` and `swift_Concurrency` had `swift::fatalError` implementation, but it causes symbol conflict with the `-static-stdlib` flag.

This patch removes one of the implementations in `swift_Concurrency` to avoid conflicts. Also added a test case to ensure that linking the Concurrency module with `-static-stdlib` works.

This issue was found by SwiftWasm test cases.
2021-05-06 09:46:15 +01:00
Alex Hoppen
aef9d5147f [ClangImporter] Load the stdlib even if there is a -fmodule-map-file argument pointing to a missing file
If there is a `-fmodule-map-file` argument whose file doesn’t exist and SwiftShims is not in the module cache, we fail to build it, because clang throws an error about the missing module map. This causes SourceKit to drop all semantic functionality, even if the missing module map isn’t required.

To work around this, drop all `-fmodule-map-file` arguments with missing files from the clang importer’s arguments, reporting the eror that `clang` would throw manually.

Fixes rdar://77449671
2021-05-06 10:23:58 +02:00
Alex Hoppen
74ff6923a1 [Sema] Don’t allow unresolved type variables if LeaveBraceStmtBodyUnchecked is true
According to Pavel, we want to eliminate allowing unresolved variables as much as possible. Removing this flag doesn’t break any test cases (at least not in a meaningful way) and fixes a crasher, so it seems reasonable to remove it.

Fixes rdar://76686564
2021-05-06 10:19:05 +02:00
Owen Voorhees
9c02fd1d58 Merge pull request #37236 from owenv/serialize-digester-diag-flag
[APIDigester] Provide a category when serializing diagnostics representing API/ABI breakage
2021-05-05 20:12:09 -07:00
Robert Widmann
a4eed800e7 Re-Enable IR Hash Test
This was disabled due to timing issues on the bots. Now that everything
is on APFS/ext/NTFS, we should have the resolution necessary to turn
this back on.

rdar://62338337
2021-05-05 19:50:01 -07:00
Emily Shi
1e6a5f496e Merge pull request #37275 from apple/emily/reenable-test
[test] reenable sanitizer driver tests
2021-05-05 18:07:23 -07:00
Ben Barham
398124c61a [Refactoring] Only unwrap optionals if the handler has an optional error
Resolves rdar://73973459
2021-05-06 10:27:34 +10:00
Ben Barham
058613dd42 [Refactoring] Add tests for convert to async
Convert to async and add async alternative differ when there is no/an
invalid completion handler. In those cases, also check convert to async.
2021-05-06 10:27:34 +10:00
Arnold Schwaighofer
201ccd4d3a Merge pull request #37268 from aschwaighofer/disable_import_as_member_test
Disable IDE/import_as_member.swift on the tv simulator
2021-05-05 17:26:40 -07:00
Andrew Trick
b0dc18dd04 Fix an assert in exclusivity diagnostics when inouts escape.
An error found in DiagnoseInvalidEscapingCaptures can indicate invalid
SIL, which will cause DiagnoseStaticExclusivity to assert during SIL
verification. When the source-level closure captures an inout
argument, it appears in SIL to be a non-escaping closure. The SIL
verification then fails because the "nonescaping" closure actually
escapes.

Ensure that capture diagnostics run on closures before exclusivity
enforcement runs on the parent function. Bypass the SIL verification
assert if a diagnostic error was found.

Fixes rdar://75364904 (Crash with assertion `noescape partial_apply
has unexpected use`)
2021-05-05 17:06:30 -07:00
Holly Borla
6eb133b627 Merge pull request #37263 from hborla/async-closure-diagnostics
[Concurrency] Improve diagnostics for missing `await`
2021-05-05 16:43:45 -07:00
Victoria Mitchell
4b5045f25a add "memberOf" relations for remote protocol implementations
rdar://75729692
2021-05-05 15:44:28 -06:00
Pavel Yaskevich
29cb7ddbcb [Diagnostics] Handle ambiguities related to use of nil literal
When `nil` is passed as an argument to call with multiple overloads
it's possible that this would result in ambiguity where matched
expected argument type doesn't conform to `ExpressibleByNilLiteral`.

To handle situations like this locator for contextual mismatch
has to be adjusted to point to the call where `nil` is used, so
`diagnoseAmbiguityWithFixes` can identify multiple overloads and
produce a correct ambiguity diagnostic.

Resolves: rdar://75514153
2021-05-05 12:56:25 -07:00
Holly Borla
b6a3434851 [Concurrency] Emit a tailored note for a missing await if the call is implicitly
asynchronous due to actor isolation.
2021-05-05 11:35:40 -07:00
Holly Borla
8e78c8b35c [CSApply] Propagate 'async' from contextual types to closures, unless the closure
is an argument to a 'reasync' function.
2021-05-05 11:35:40 -07:00
Emily Shi
804c3aaea7 Reenable sanitizer tests 2021-05-05 11:15:06 -07:00
swift-ci
8d7eede32c Merge pull request #37267 from kaar3k/main 2021-05-05 11:09:58 -07:00