-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redundant_type_annotation autocorrect is really buggy #2314
Comments
@Dschee I wasn't able to reproduce the problem with the examples you've provided. Can you double check that those reduced snippets trigger the issue? |
You were right, the above examples didn't have this bug. But I could reduce the issue to the following example, where this happens: class ViewController: UIViewController {
func someMethod() {
let myVar: Int = Int(5)
}
} When autocorrecting this example, instead of removing the redundant |
@marcelofabri Thank you for fixing this so quickly! |
I recently turned on
redundant_type_annotation
which seems to work fine when it comes to showing warnigns. But when runningswiftlint autocorrect
I get many changes that break my code. Here are a few examples of the changes made by this rule:BEFORE
AFTER (the fist two cases mixed up)
BEFORE
AFTER (the swiftlint disabling broken)
BEFORE
AFTER (the
: class
is gone)There's a lot more if you need more examples, but I thinks this is a start.
The text was updated successfully, but these errors were encountered: