Skip to content

[SR-11827] Missing "in" => bad diagnostic #2196

Open
@dabrahams

Description

@dabrahams
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SwiftParserBugs in the (new) Parser written in Swift

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions