swiftlang/swift

[SR-7230] Improve error message for statement that begins with open brace

オープン

#49,778 opened on 2018/03/19

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Swift (10,719 件のフォーク)batch import
bugcompilerdiagnostics qualitygood first issue

Repository metrics

Stars
 (69,989 個のスター)
PR merge metrics
 (平均マージ 8d 17h) (30d で 510 merged PRs)

説明

Previous ID SR-7230
Radar None
Original Reporter @jckarter
Type Bug
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, StarterBug
Assignee None
Priority Medium

md5: 809fd159923a9a4b4bcf2169a9eb2a66

Issue Description:

Swift doesn't allow a statement to begin with an open brace, and the error message you get when you do is hostile to beginners, talking about "unused closures" rather than the syntactic issue:

https://twitter.com/twostraws/status/975740708601593857

This is likely to come up when a user is moving code around, so the error and associated fixits could be greatly improved.

コントリビューターガイド