Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-11006] Improve diagnostic for == instead of = in default function argument #53396

Closed
belkadan opened this issue Jun 24, 2019 · 6 comments
Closed
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers parser Area → compiler: The legacy C++ parser

Comments

@belkadan
Copy link
Contributor

Previous ID SR-11006
Radar rdar://problem/22478168
Original Reporter @belkadan
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Parser, StarterBug
Assignee @vguerra
Priority Medium

md5: 82acd004a5929240f53f0a8529e8f37e

Issue Description:

The diagnostic for accidentally using == instead of = in a default function argument could be improved.

func test(a: Int == 0, b: Int) {}

produces

<stdin>:1:18: error: expected ',' separator
func test(a: Int == 0, b: Int) {}
                 ^
                ,
<stdin>:1:18: error: expected parameter name followed by ':'
func test(a: Int == 0, b: Int) {}
                 ^
@vguerra
Copy link
Contributor

vguerra commented Jun 26, 2019

hello @belkadan, I'll tackle this one if that's ok w/you.

@belkadan
Copy link
Contributor Author

Go for it!

@vguerra
Copy link
Contributor

vguerra commented Jul 14, 2019

PR: #26139

@vguerra
Copy link
Contributor

vguerra commented Jul 18, 2019

PR for this issue has been merged.

@belkadan
Copy link
Contributor Author

Ah, note for the future: the person who filed the bug should be the one who moves it to "Closed".

@vguerra
Copy link
Contributor

vguerra commented Jul 18, 2019

oh ok! ...sorry, my bad.. will have this in mind.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers parser Area → compiler: The legacy C++ parser
Projects
None yet
Development

No branches or pull requests

2 participants