Commit Graph

7628 Commits

Author SHA1 Message Date
Alex Hoppen
f652a9d01a Merge pull request #42295 from ahoppen/pr/add-fixed-test-cases
[IDE][Sema] Add test cases for issues no longer occurring in the stress tester
2022-04-27 11:32:44 +02:00
Pavel Yaskevich
7869b73a73 [TypeChecker] NFC: Add a "slow" perf test-case for rdar://91310777 2022-04-25 14:10:58 -07:00
Pavel Yaskevich
a40e8e80c1 [ConstraintSystem] Use affected range (if any) to diagnose 'too complex' failures 2022-04-25 14:09:45 -07:00
Pavel Yaskevich
e73ee93268 Merge pull request #42594 from xedin/rdar-92025732
[TypeChecker] NFC: Remove a literal to make test-case less flaky
2022-04-25 09:33:21 -07:00
Josh Soref
624a54b9cf Spelling stdlib (#42544)
* spelling: abcdefghijklmnopqrstuvwxyz

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: clazz

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: collection

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: compressible

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: constituent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: contiguous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: convertibility

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: element

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: enforce

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: exhaustive

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: exhausts

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: existential

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: facilitate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: ignored

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: incorporated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: intersection

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: laziness

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: misaligned

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: overhaul

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: preamble

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: precondition

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: replacement

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: trailing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unambiguous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: uncompressible

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: world

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-22 19:18:38 -07:00
Pavel Yaskevich
b8046e1064 [TypeChecker] NFC: Remove a literal to make test-case less flaky
Multi-statement closure + simd perf test-case still (albeit very
rarely) fails, so let's remove `/ 4` in attempt to prevent that
happening.

Resolves: rdar://92025732
2022-04-22 15:44:42 -07:00
Alex Hoppen
e0205f7586 [Sema] Add test case for SR-15497
SR-15497 is no longer happening in the stress tester. Add its test case to the test suite.

rdar://85602946
2022-04-22 09:50:24 +02:00
Alex Hoppen
0a79ab7637 [IDE] Add test case for SR-14708
SR-14708 is no longer happening in the stress tester. Add its test case to the test suite.

rdar://78781625
2022-04-22 09:50:24 +02:00
Pavel Yaskevich
384d508200 Merge pull request #42483 from xedin/rdar-90366182
[CSApply] Rewrite types of a constructed tuple
2022-04-21 10:00:40 -07:00
Pavel Yaskevich
ef4793e191 Merge pull request #42500 from xedin/rdar-91849144
[TypeChecker] NFC: Adjust SwiftUI to use %target-cpu instead of x86_64
2022-04-21 09:43:49 -07:00
Doug Gregor
3316cf01f7 Merge pull request #41996 from DougGregor/implicit-open-by-default
[SE-0352] Implicit opening of existentials by default
2022-04-20 21:37:52 -07:00
swift-ci
d0950d127a Merge pull request #42508 from nate-chandler/test/20220420/rdar85526879
[Test] Run more returned-as-async ObjC blocks.
2022-04-20 20:51:16 -07:00
Doug Gregor
4116d7a3d7 Rename the -strict-concurrency= options to be more descriptive.
The three options are now:

* `explicit`: Enforce Sendable constraints where it has been explicitly adopted and perform actor-isolation checking wherever code has adopted concurrency. (This is the default)
* `targeted`: Enforce Sendable constraints and perform actor-isolation checking wherever code has adopted concurrency, including code that has explicitly adopted Sendable.
* `complete`: Enforce Sendable constraints and actor-isolation checking throughout the entire module.
2022-04-20 18:17:33 -07:00
Doug Gregor
c76a99ba02 [SE-0352] Enable implicit opening of existentials by default 2022-04-20 17:51:04 -07:00
nate-chandler
45ec725e43 Merge pull request #42485 from nate-chandler/rdar85526916
[SILGen] Use opaque AP for ObjC-async returns.
2022-04-20 16:43:02 -07:00
Nate Chandler
15ed62d5a7 [Test] Run more returned-as-async ObjC blocks.
Verify the recent fix at https://github.com/apple/swift/pull/42485.
2022-04-20 16:40:52 -07:00
Pavel Yaskevich
1c426a30d1 Merge pull request #42484 from xedin/drop-se-0326-flag
[TypeChecker] NFC: Remove `-experimental-multi-statement-closures` flag
2022-04-20 14:39:35 -07:00
Pavel Yaskevich
2b3661570f [TypeChecker] NFC: Adjust SwiftUI to use %target-cpu instead of x86_64
Resolves: rdar://91849144
2022-04-20 14:38:24 -07:00
Joe Groff
270d100b43 Merge pull request #42478 from asl/escape-c-pointer
[DebugInfo] Ignore noescape bit for all @convention(c) pointers
2022-04-20 12:58:31 -07:00
Nate Chandler
4aff98ffb5 [SILGen] Use opaque AP for ObjC-async returns.
Previously, the AbstractionPattern that was used for the value
"returned" (i.e. via a completion handler) from ObjC mostly (but not
quite always) was "type".

The generated completion handler correctly (because this is required in
order to call _resumeUnsafeContinuation) reabstracted the block (e.g.
from @convention(block) to @substituted <T> () -> @out T for <()>).  The
callee of the ObjC function, however, loaded the function from the block
as if it were not reabstracted (e.g. () -> ()).

On most platforms, that happened to work.  On arm64e, that difference in
types caused in a difference in pointer signing, resulting in a failure
at runtime.

rdar://85526879
rdar://85526916
2022-04-20 10:42:45 -07:00
Pavel Yaskevich
6db0001863 [TypeChecker] NFC: Remove -experimental-multi-statement-closures flag
SE-0326 has been enabled by default, so this flag is no longer necessary.
2022-04-20 10:40:27 -07:00
Pavel Yaskevich
879bd6578d [CSApply] Rewrite types of a constructed tuple
When construction call is rewritten into a tuple conversion,
rewriter has to make sure that AST types are reset otherwise
it would end up with types set by `packIntoImplicitTupleOrParen`
which could contain l-values.

Resolves: rdar://90366182
2022-04-20 10:35:06 -07:00
Doug Gregor
3f4bc7df37 Add -strict-concurrency=limited to one more test. 2022-04-20 09:11:10 -07:00
Anton Korobeynikov
121e28051a Force escaping all thin functions. Ensure types are always unique. 2022-04-20 10:34:45 +02:00
Saleem Abdulrasool
36c951d31e Revert "[DebugInfo] Ignore noescape bit for all @convention(c) pointers" 2022-04-19 18:09:23 -07:00
Anton Korobeynikov
b2dc6e5228 Unbreak the test 2022-04-18 22:43:57 +02:00
Karoy Lorentey
318277c3aa [test] stdlib/StringIndex: Spin off O(n^4) substring replacement test into a standalone long test
Also trim down its input a bit so that this doesn’t take 20 minutes.
2022-04-15 21:29:32 -07:00
Pavel Yaskevich
7a6982347b Merge pull request #42375 from xedin/rdar-66110075
[TypeChecker] NFC: Un-XFAIL SwiftUI test-case which has been fixed
2022-04-14 17:36:37 -07:00
Karoy Lorentey
57f0e67658 Merge pull request #41417 from lorentey/the-horror-of-se-0180
[stdlib] Fix String indexing edge cases, anomalies & validation bugs
2022-04-14 14:08:53 -07:00
Pavel Yaskevich
d8ade63521 [TypeChecker] NFC: Un-XFAIL SwiftUI test-case which has been fixed
Test-case should no longer produce "type of expression is ambiguous"
fallback diagnostic.

Resolves: rdar://66110075
2022-04-14 13:38:01 -07:00
Daniel Duan
3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
Alex Hoppen
11c3ff0534 Merge pull request #42211 from ahoppen/pr/dont-distinguish-identical-convertible-type-relation
[CodeCompletion] Don't distinguish convertible and identical type relation
2022-04-13 12:01:25 +02:00
Alex Hoppen
5d01a097e1 [CodeCompletion] Don't distinguish convertible and idenical type relation
I think that preferring identical over convertible makes sense in e.g. C++ where we have implicit user-defined type conversions but since we don’t have them in Swift, I think the distinction doesn’t make too much sense, because if we have a `func foo(x: Int?)`, want don’t really want to  prioritize variables of type `Int?` over `Int` Similarly if we have `func foo(x: View)`, we don’t want to prioritize a variable of type `View` over e.g. `Text`.

rdar://91349364
2022-04-13 08:28:17 +02:00
Alex Hoppen
e313df88ce [build-script] Add option to build lld as part of LLVM 2022-04-12 16:38:34 +02:00
Alejandro Alonso
5fe6a7e247 Add caseFolded to scalar properties 2022-04-10 13:03:13 -07: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
8919a3398d Merge pull request #42205 from ahoppen/pr/add-test-case-sr15502
[CodeCompletion] Add test case for SR-15502
2022-04-06 22:39:09 +02:00
nate-chandler
de0e227925 Merge pull request #42186 from nate-chandler/rdar83158525
[IRGen] Use condbrs for big int switches.
2022-04-06 07:35:34 -07:00
Alex Hoppen
f2e1f30f66 [CodeCompletion] Add test case for SR-15502 2022-04-06 09:19:12 +02:00
Karoy Lorentey
3f2550feb4 [test] stdlib/StringGraphemeBreaking: Add backwards checks 2022-04-05 21:42:17 -07:00
Slava Pestov
094130b9c7 RequirementMachine: Diagnose redundant concrete conformance requirements
A conformance requirement on a concrete type parameter is redundant if the
concrete type conforms to the protocol.

The replacement path for the conformance rule is based on a concrete
conformance rule introduced by the property map. Since the concrete
conformance rule is not associated with a requirement ID, this would
normally muffle the redundancy warning, because we don't want to
suggest removing a rule that depends on a non-redundant, non-explicit
rule.

However, concrete conformance rules don't actually appear in the
minimal signature, so skip them when computing the set of non-redundant,
non-explicit rules to ensure that the original conformance requirement
is still diagnosed as redundant.
2022-04-05 21:12:51 -04:00
Nate Chandler
602e2e7f34 [IRGen] Use condbrs for big int switches.
Previously, switches over extremely large integers (e.g. i832) were
emitted when emitting switches with many spare bits.  Such switches
result in unfortunate downstream codegen.

Here, for large enums (currently, more than two words) the preexisting
EnumPayload::emitCompare function is used to compare each of the enum
cases in turn with the payload's value.  The result is a series of
cond_br where the conditional is made by anding together word-size
chunks of the payload value with word-size chunks of each enum case's
tag, subject to masking.

rdar://83158525
2022-04-05 09:09:53 -07:00
Nate Chandler
5aa3cf6d6c [Test] Mark two unsupported for backdeploy.
They depend on new runtime changes.
2022-04-04 14:52:03 -07:00
Pavel Yaskevich
5ac54115dd Merge pull request #42159 from xedin/rdar-91150414
[TypeChecker] SE-0326: Check whether function declaration is a result…
2022-04-04 10:32:44 -07:00
Pavel Yaskevich
df549dbdb3 [TypeChecker] SE-0326: Check whether function declaration is a result builder context
This is a follow-up to https://github.com/apple/swift/pull/40708 which only considers
closures, but it missed the case when builder is applied to function body - in such
cases the declaration context is going to be a function/getter declaration.

Resolves: rdar://91150414
2022-04-04 01:13:46 -07: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
Anthony Latsis
62a2c9e265 Merge pull request #42137 from AnthonyLatsis/objc-optional-keypath
SILGen: Handle key paths with `@objc optional` property and subscript components
2022-04-02 13:53:25 +03:00
Slava Pestov
4068c9d707 Pass -requirement-machine-{protocol,inferred}-signatures=verify in remaining tests that fail due to diagnostics 2022-04-01 23:55:34 -04:00
swift-ci
e059cc63d4 Merge pull request #42147 from glessard/sr15994
[test] check availability before executing test
2022-04-01 16:53:01 -07:00
Guillaume Lessard
3bacc7c08f [test] check availability for before running test
- resolves rdar://91181948
2022-04-01 15:37:07 -06:00