swiftlang / swiftlang/swift-syntax
[SR-11827] Missing "in" => bad diagnostic
- Dominant language
- Swift
- Stars
- 3.7k
- Forks
- 553
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 16
Description
| | |
|------------------|-----------------|
|Previous ID | SR-11827 |
|Radar | rdar://problem/57418525 |
|Original Reporter | @dabrahams |
|Type | Bug |
Additional Detail from JIRA
| | |
|------------------|-----------------|
|Votes | 0 |
|Component/s | Compiler |
|Labels | Bug |
|Assignee | None |
|Priority | Medium |
md5: 29d9832455f9840f7ae31e4c0ca0baec
**Issue Description:**
```
1> (0..<10).map { x
2. x + 1
3. }
error: repl.swift:1:10: error: cannot invoke 'map' with an argument list of type '(@escaping () -> ())'
(0..<10).map { x
^
repl.swift:1:10: note: expected an argument list of type '((Self.Element) throws -> T)'
(0..<10).map { x
^
```
I've also seen, "Contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored" (small reproducer harder to generate). Either way we should have an error saying "in" is missing and a fixit to insert it.
Contributor guide
Assessment
This issue has not been assessed yet.