Commits
Chris Lattner committed 0d57fe5b345
Fix <rdar://problem/24467411> QoI: Using "&& #available" should fixit to comma
This tweet: https://twitter.com/radexp/status/694561060230184960 pointed out
the sad truth that most people don't know that stmt-condition can contain
(including a fixit) when they try to use && instead of commas between clauses.
Before:
t.swift:4:16: error: #available may only be used as condition of an 'if', 'guard' or 'while' statement
if x == y && #available(iOS 9, *) { }
^
t.swift:5:27: error: expected '{' after 'if' condition
if #available(iOS 9, *) && x == y {}
^
t.swift:5:37: error: braced block of statements is an unused closure
if #available(iOS 9, *) && x == y {}
^
t.swift:5:37: error: expression resolves to an unused function
if #available(iOS 9, *) && x == y {}
^~
After:
t.swift:4:13: error: expected ',' joining parts of a multi-clause condition
if x == y && #available(iOS 9, *) { }
^~
,
t.swift:5:27: error: expected ',' joining parts of a multi-clause condition
if #available(iOS 9, *) && x == y {}
^~
,