-
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
SwiftLint 0.16.1 incorrectly converting legacy constant for Swift 2.3 #1238
Comments
I've tried to reproduce it and couldn't. The implementation seems correct too. The only reason that could make this happen seems to be the wrong toolchain being used (see https://github.com/jpsim/SourceKitten#how-is-sourcekit-resolved). Using |
I think the issue might be that since It's not a great experience, but I'd still consider it a "user error". |
@marcelofabri, yes specifying the |
In general this shouldn't be needed. Do you have more than one Xcode installed? |
SwiftLint doesn't check the version specified in your Xcode project, or a
This can happen even with just a single version of Xcode installed, since Xcode 8.x ships with both Swift 3 and Swift 3 toolchains |
@marcelofabri, yes I have 7.3.1 and 8.2.1 as I need both for client work. |
@jpsim, that makes sense. I may suggest adding something about that to the README. |
See #1239. |
I have a project using Swift 2.3 and have installed version 0.16.1 of SwiftLint. When I run
swiftlint autocorrect
, it's incorrectly replacingCGFloat(M_PI)
withCGFloat.pi
. In the logs I see the output ofCorrected Legacy Constant
where it made the change to my code and the project won't compile due to this error.The text was updated successfully, but these errors were encountered: