[FixCode] Blacklist the fixit for enum case renames to avoid reverting migrator's change. rdar://27776887 (#4199)

We added the fixit to help users manually migrate enum case references after the declaration
has been renamed; however, when interacting with the migrator, the fixit may revert migrator's
correct changes, when the migrator updates references before updating the declaration. This patch
blacklists the fixit in migrator's pass, so we leave it to users' manually application if necessary.
This commit is contained in:
Xi Ge
2016-08-10 13:52:25 -07:00
committed by GitHub
parent 9f46eb5d1d
commit 398f483557
3 changed files with 14 additions and 0 deletions

View File

@@ -613,6 +613,10 @@ private:
// invalidating some inits with type errors.
if (Info.ID == diag::init_not_instance_member.ID)
return false;
// Renaming enum cases interacts poorly with the swift migrator by
// reverting changes made by the mgirator.
if (Info.ID == diag::could_not_find_enum_case.ID)
return false;
if (Kind == DiagnosticKind::Error)
return true;