Commit Graph

17 Commits

Author SHA1 Message Date
Slava Pestov
1957bd6065 Sema: Reword diagnostics to say 'without a type annotation' instead of 'without more context' 2023-06-09 17:44:42 -04:00
Anthony Latsis
da8d035b0b Gardening: Migrate test suite to GH issues: Constraints (2/5) 2022-08-19 06:43:11 +03:00
Pavel Yaskevich
1ffe97f2f8 [Diagnostics] NFC: Adjust more tests improved by extraneous argument(s) fix 2019-10-16 10:19:26 -07:00
Pavel Yaskevich
ec6a874ac8 [TypeChecker] NFC: Update test-cases improved by new missing arguments diagnostic 2019-09-25 10:47:26 -07:00
Pavol Vaskovic
ac04995089 [Gardening] Remove DoubleWidth dead code from test 2019-03-01 20:51:43 +01:00
Pavel Yaskevich
a56d527709 [CSSimplify] Fix matchCallArguments not to claim un-labeled arguments too eagerly
Avoid claiming un-labeled defaulted parameters
by out-of-order un-labeled arguments or parts
of variadic argument sequence, because that might
be incorrect.

The following example is supposed to type-check
correctly but without these changes produces
`missing argument for parameter #4 in call`
error, because `3` will be claimed as '_ b:':

```swift
func foo(_ a: Int, _ b: Int = 0, c: Int = 0, _ d: Int) {}
foo(1, c: 2, 3)
```

Resolves: rdar://problem/43525641
2018-08-20 17:37:48 -07:00
Pavel Yaskevich
84cd99a3eb [Diagnostics] Enable extraneous/incorrect label diagnostics via solver fixes
This builds on initial commit which added `RelabelArguments` fix
to the solver that only supported `missingLabels` at that moment,
but now it supports all three posibilities - missing/extraneous and
incorrect labels.
2018-07-25 14:34:26 -07:00
Pavel Yaskevich
91e330c289 [TypeChecker] Improve argument label matching
* Improve label mismatch callback:
 - Split "missing label" callback into 3 - missing, extraneous, incorrect (with typo(s));
 - Allow label callbacks to indicate if it's a fatal error or not;
* Improve matching of the variadic parameters;
* Improve matching of the parameters with defaults;
* Try to look for an argument with matching label before fallback to
  forced claming (if allowed).
2018-07-21 23:21:42 -07:00
Max Moiseev
141fefc06b Update tests after removal of DoubleWidth 2018-03-23 17:14:46 -07:00
Max Moiseev
8dbaa2a752 Revert "[stdlib] Temporarily exclude DoubleWidth from the standard library" 2017-12-05 15:37:07 -08:00
Max Moiseev
156e6eb848 Exclude DoubleWidth due to the binary size concerns
<rdar://problem/32726173>
2017-12-01 14:29:53 -08:00
Pavel Yaskevich
47353c25e2 [ConstraintSolver] Skip performance hacks in presence of unavailable overloads
Limit the scope of the performance hacks which currently exist in the
solver even further by disallowing it to skip generic overlaods or stop
in case when previous solutions involve unavailable overloads, which
otherwise might lead to producing incorrect overall solutions.
2017-08-21 14:55:17 -07:00
Mark Lacey
0ba4a312af Roll back a portion of SE-0110
As described in:
  https://lists.swift.org/pipermail/swift-evolution-announce/2017-June/000386.html

Specifically allow an N-ary argument function to be passed as an
argument in a place where a function of a single N-tuple is expected.

Fixes: rdar://problem/32875953
2017-06-20 11:05:28 -07:00
Mark Lacey
dad2358a76 Remove superfluous parens from function-typed argument type. 2017-05-31 16:07:05 -07:00
Pavel Yaskevich
ead1447aa1 [QoI] Extend single tuple parameter diagnostics to function/subscript calls
Properly diagnose cases of function/subscript argument tuple
structuring/destructuring related by not limited to SE-0110.

Resolves: rdar://problem/31973368
2017-05-15 18:41:41 -07:00
Pavel Yaskevich
c0bc4f20be [QoI] Improve diagnostics for unresolved member with incorrect arguments
`FailureDiagnosis::visitUnresolvedMemberExpr` tries to use the same logic
as `diagnoseSingleCandidateFailures` so instead of doing that let's remove
some of the special handling and use `diagnoseSingleCandidateFailures`
directly instead, which improves label diagnostics and handles more erroneous
cases as well.

Resolves: rdar://problem/31898542
2017-05-11 01:31:33 -07:00
Slava Pestov
f511fec729 Add missing test for "Horrific simulation of Swift 3 bug with argument labels for Swift 3 mode" 2016-12-14 02:12:31 -08:00