Skip to content

Commit e582151

Browse files
committed
[fixcode] Accept the warning fixit for single argument function types requiring parentheses.
1 parent f3b0010 commit e582151

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ class JSONFixitWriter : public DiagnosticConsumer {
568568
if (Info.ID == diag::forced_downcast_coercion.ID ||
569569
Info.ID == diag::forced_downcast_noop.ID ||
570570
Info.ID == diag::variable_never_mutated.ID ||
571+
Info.ID == diag::function_type_no_parens.ID ||
571572
Info.ID == diag::parameter_extraneous_double_up.ID)
572573
return true;
573574
return false;

test/FixCode/fixits-apply.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ func ftest1() {
6363
let myvar = 0
6464
}
6565

66-
func ftest2(x x: Int) {}
66+
func ftest2(x x: Int -> Int) {}

test/FixCode/fixits-apply.swift.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ func ftest1() {
6666
let myvar = 0
6767
}
6868

69-
func ftest2(x: Int) {}
69+
func ftest2(x: (Int) -> Int) {}

0 commit comments

Comments
 (0)