Pavel Yaskevich
7b9cffd40a
[CSSimplify] Fix should propagate contextual type into optional chain with leading-dot syntax
...
Member chains with leading-dot syntax can infer the base type
only from context, so optionality mismatch with the contextual
type should propagate object type down the chain.
2023-01-20 09:47:33 -08:00
Pavel Yaskevich
1c076f0e2b
[CSSimplify] Allow conversions between tuple element type and a placeholder
...
If a placeholder appears on one of the side of tuple element matching
conversion, consider that conversion to be solved, because the actual
error is related to the placeholder.
2023-01-12 18:16:43 -08:00
Pavel Yaskevich
db37be971d
Merge pull request #62527 from xedin/attempt-conjunctions-in-source-order
...
[CSSolver] Solve multi-statement closures in source order
2022-12-13 12:45:48 -05:00
Pavel Yaskevich
65e7eec62f
[CSSolver] Solve multi-statement closures in source order
...
Currently solver picks the first conjunction it can find,
which means - the earliest resolved closure. This is not
always correct because when calls are chained closures
passed to the lower members could be resolved sooner
than the ones higher up but at the same time they depend
on types inferred from members higher in the chain.
Let's make sure that multi-statement closures are always
solved in order they appear in the AST to make sure that
types are available to members lower in the chain.
2022-12-12 10:57:21 -08:00
Doug Gregor
9d24f447b7
Remove special handling of __FILE__, __LINE__, etc.
...
These were replaced by `#file`, `#line`, etc. with SE-0028, prior to
Swift 3. We don't need this custom error message any more, and they
shouldn't be keywords. Stop treating them as keywords in the lexer.
2022-12-10 15:38:09 -08:00
Robert Widmann
d6cffbbe00
Merge pull request #62145 from CodaFi/synfonia
...
Delete libSyntax
2022-11-17 09:57:37 -08:00
Robert Widmann
37e7052c68
Remove -emit-syntax and -verify-syntax-tree
2022-11-16 15:07:48 -08:00
Jonathan Grynspan
f3bcef92a5
Augment maybeDiagnoseCallToKeyValueObserveMethod() and add support for a @_semantics attribute to trigger it rather than just hard-coding the name of the Foundation method.
2022-11-14 17:18:32 -05:00
Allan Shortlidge
74e55ef51f
Test: Temporarily disable implicit_weak_capture.swift for back_deployment_runtime configs.
2022-11-10 18:21:21 -08:00
Andrew Trick
1ecf0a5586
implicit_weak_capture test requires Concurrency
...
Fixes rdar://101942652 (macOS 10.14.4) (Swift in the OS)
libswift_Concurrency; Symbol not found:
_swift_task_enterThreadLocalContext)
2022-11-03 19:35:47 -07:00
Allan Shortlidge
f79d91aeb5
Sema: Fix crash when diagnosing async let bindings in illegal contexts.
...
Resolves rdar://101673476
2022-11-01 08:55:55 -07:00
Cal Stephens
c081d56cf1
Add test case that implicit self in a weak closure doesn't result in a strong capture
2022-10-27 17:50:44 -07:00
Cal Stephens
8528021f0d
Change lookup behavior in ASTScope::lookupUnqualified when self has been unwrapped
2022-10-26 20:38:43 -07:00
Cal Stephens
ebcc9c2b8b
Revert "Disable SE-0365 behavior for escaping closues in Swift 5 mode"
...
This reverts commit f8ca2937a8 .
2022-10-26 17:38:01 -07:00
Cal Stephens
f8ca2937a8
Disable SE-0365 behavior for escaping closues in Swift 5 mode
2022-10-22 09:15:09 -07:00
Cal Stephens
22e43136d9
Enable SE-0365 behavior in Swift 5.8
2022-10-10 08:03:03 -07:00
Pavel Yaskevich
1a79d93121
Merge pull request #40702 from calda/cal--implicit-weak-self
...
[SE-0365] Allow implicit self for `weak self` captures
2022-09-30 10:30:57 -07:00
Cal Stephens
5bfdfd822c
Only enable SE-0365 in Swift 6
2022-09-28 19:35:26 -07:00
Cal Stephens
cc92f76a9e
Revert changes for handling SE-0365 in Swift 5
...
Revert "Remove properties from AST nodes"
This reverts commit e4b8a829fe .
Revert "Suppress more false-positive 'self is unused' warnings"
This reverts commit 35e028e5c2 .
Revert "fix warning annotation in test"
This reverts commit dfa1fda3d3 .
Revert "Permit implicit self for weak self captures in nonescaping closures in Swift 5 (this is an error in Swift 6)"
This reverts commit 94ef6c4ab4 .
2022-09-28 17:44:02 -07:00
Cal Stephens
35e028e5c2
Suppress more false-positive 'self is unused' warnings
2022-09-26 09:28:22 -07:00
Cal Stephens
dfa1fda3d3
fix warning annotation in test
2022-09-25 16:19:57 -07:00
Cal Stephens
94ef6c4ab4
Permit implicit self for weak self captures in nonescaping closures in Swift 5 (this is an error in Swift 6)
2022-09-25 14:32:19 -07:00
Cal Stephens
9dd56f9daf
Move remaining logic in LookupResultEntry::getBaseDecl() to ASTScope::lookupUnqualified impl, add more extensive tests, fix failing tests
2022-09-22 11:04:08 -07:00
Cal Stephens
4abca2bc9e
Merge tag 'swift-DEVELOPMENT-SNAPSHOT-2022-09-12-a' of github.com:apple/swift into cal--implicit-weak-self
...
Tag build swift-DEVELOPMENT-SNAPSHOT-2022-09-12-a
2022-09-20 06:58:38 -07:00
Pavel Yaskevich
5ffe84765f
Merge pull request #61052 from xedin/closure-property-wrapper-fixes
...
[CSClosure] Fix property wrapper handling
2022-09-13 09:23:15 -07:00
Pavel Yaskevich
61d3a9f786
[CSClosure] Always pre-check init targets of wrapped vars
...
If a variable with attached property wrapper has an initializer
expression it could be modified by implicit wrapper application,
if there is no initializer - one would be synthesized by the
compiler (without arguments). In both cases target has to be
pre-checked before constraints are generated for it.
Resolves: https://github.com/apple/swift/issues/61024
2022-09-12 16:08:36 -07:00
Pavel Yaskevich
3e791dd169
[CSClosure] Use correct type for implicit wrapper variables
...
Using `computeWrappedValueType` is incorrect because
that return a type of the wrapped variable and not
the *wrapper* variable (one that starts with `_`).
Resolves: https://github.com/apple/swift/issues/61017
2022-09-12 09:53:24 -07:00
Pavel Yaskevich
149e57a0cb
Merge pull request #60893 from calda/cal--warn-redundant-comparison-to-optional.none-case
...
Add warning when comparing a non-optional value to `Optional.none`
2022-09-12 00:36:24 -07:00
Cal Stephens
9167a177cc
Merge branch 'main' into cal--implicit-weak-self
2022-09-11 10:24:55 -07:00
Luciano Almeida
9e42002132
Merge pull request #60952 from LucianoPAlmeida/diag-closure
2022-09-06 13:15:57 -03:00
Luciano Almeida
7b82be5e2b
[test] Opaque result is only available in 10.10 macos
2022-09-06 09:12:36 -03:00
Luciano Almeida
9c9af903bb
[test] Add opaque result type cases
2022-09-05 10:29:16 -03:00
Luciano Almeida
7300fb5836
[Sema] Improve diagnostic for closure return contextual mismatch
2022-09-04 22:28:49 -03:00
Anthony Latsis
867472491f
Merge pull request #60812 from AnthonyLatsis/migrate-test-suite-to-gh-issues-12
...
Gardening: Migrate test suite to GH issues p. 12
2022-09-02 06:06:53 +03:00
Anthony Latsis
5b245b42cd
Merge pull request #60836 from AnthonyLatsis/migrate-test-suite-to-gh-issues-13
...
Gardening: Migrate test suite to GH issues p. 13
2022-09-02 06:06:14 +03:00
Cal Stephens
c3e74e06b4
Use a single warning, but dynamically specify 'nil' or 'Optional.none'
2022-09-01 09:10:01 -07:00
Cal Stephens
c2bf0f943e
Revert "Combine the two diagnostics"
...
This reverts commit 2e7656218e .
2022-09-01 08:11:46 -07:00
Cal Stephens
1b224bd945
Add a test that verifyies comparing to a .none case that isn't Optional.none still works
2022-09-01 06:38:50 -07:00
Cal Stephens
2e7656218e
Combine the two diagnostics
2022-09-01 06:23:42 -07:00
Cal Stephens
88b65f406f
Update tests
2022-08-31 20:14:41 -07:00
Anthony Latsis
d911aad234
Gardening: Migrate test suite to GH issues: expr/unary
2022-08-30 00:31:18 +03:00
Anthony Latsis
65663b0b5d
Gardening: Migrate test suite to GH issues: expr/primary
2022-08-30 00:31:18 +03:00
Anthony Latsis
2a220d5d1b
Gardening: Migrate test suite to GH issues: expr/postfix
2022-08-30 00:31:18 +03:00
Anthony Latsis
8cd1df47ce
Gardening: Migrate test suite to GH issues: expr/delayed-ident
2022-08-30 00:31:18 +03:00
Luciano Almeida
109737551e
[Sema] Handle non-function type parameters for closure arguments in ambiguity diagnositc
2022-08-27 20:42:19 -03:00
Anthony Latsis
6c615c8ead
Gardening: Migrate test suite to GH issues: expr/closure
2022-08-27 05:26:00 +03:00
Anthony Latsis
5324bf9773
Gardening: Migrate test suite to GH issues: expr/cast
2022-08-27 03:15:21 +03:00
Anthony Latsis
45f5f08fa0
Gardening: Migrate test suite to GH issues: expr
2022-08-26 22:20:52 +03:00
Pavel Yaskevich
3ebc541fd5
[CSDiagnostics] Verify that member is in collection context
...
`MissingMemberFailure::diagnoseInLiteralCollectionContext`
should verify that a parent (or parent of a parent) expression
is indeed a collection expression instead of checking types.
Resolves: rdar://91452726
2022-08-17 12:12:27 -07:00
Sima Nerush
f608802cfe
Sema: Emit diagnostics when walking into collection literals with defaulted types
...
Resolves https://github.com/apple/swift/issues/60011
Gardening: clean up `checkTypeDefaultedCollectionExpr` function
2022-08-15 22:45:21 -06:00