mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user