Skip to content

Commit e50c232

Browse files
committed
[FixCode] Add another case of inserting ';' to the ban list
We missed one of the fixits that insert ; separators. rdar://problem/26681061
1 parent b6d61e3 commit e50c232

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ class JSONFixitWriter : public DiagnosticConsumer {
556556

557557
// Do not add a semi or comma as it is wrong in most cases during migration
558558
if (Info.ID == diag::statement_same_line_without_semi.ID ||
559+
Info.ID == diag::declaration_same_line_without_semi.ID ||
559560
Info.ID == diag::expected_separator.ID)
560561
return false;
561562
// The following interact badly with the swift migrator, they are undoing

test/FixCode/fixits-apply.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,8 @@ class InitDynType {
204204
self.init()
205205
}
206206
}
207+
208+
class NoSemi {
209+
enum Bar { case bar }
210+
var foo: .Bar = .bar
211+
}

test/FixCode/fixits-apply.swift.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,8 @@ class InitDynType {
207207
self.init()
208208
}
209209
}
210+
211+
class NoSemi {
212+
enum Bar { case bar }
213+
var foo: .Bar = .bar
214+
}

0 commit comments

Comments
 (0)