Skip to content
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

Weak delegates not correctly identified with Swift 4.1 #2019

Closed
2 tasks done
dbarden opened this issue Jan 25, 2018 · 9 comments
Closed
2 tasks done

Weak delegates not correctly identified with Swift 4.1 #2019

dbarden opened this issue Jan 25, 2018 · 9 comments
Labels
bug Unexpected and reproducible misbehavior.

Comments

@dbarden
Copy link

dbarden commented Jan 25, 2018

New Issue Checklist

With Swift 4.1 that came out with Xcode 9.3 beta, the weak delegates don't seem to be identified correctly.

Linting Swift files in current working directory
Linting 'atest.swift' (1/1)
/Users/barden/projects/DTI/swiftlint-test/atest.swift:10:8: warning: Weak Delegate Violation: Delegates should be weak to avoid reference cycles. (weak_delegate)
Done linting! Found 1 violation, 0 serious in 1 file.

Environment

  • SwiftLint version (run swiftlint version to be sure)?
    0.24.2

  • Installation method used (Homebrew, CocoaPods, building from source, etc)?
    homebrew

  • Which Xcode version are you using (check xcode-select -p)?

/Applications/Xcode-9.3.app/Contents/Developer (9.3 beta from 24th Jan)

  • Do you have a sample that shows the issue?
protocol TestDelegate: class {

}

protocol TestProtocol {
  weak var delegate: TestDelegate? { get }
}

class Test {
  weak var delegate: TestDelegate
}

Here there is the sourkitten structure output as well.

@marcelofabri marcelofabri added the bug Unexpected and reproducible misbehavior. label Jan 25, 2018
@dbarden
Copy link
Author

dbarden commented Jan 25, 2018

Thanks :)

@MillerApps
Copy link

Apparently it is still an issue. Happens on the Xcode 9.3 release. Installed through Coocapods.

@marcelofabri
Copy link
Collaborator

@MillerApps please fill a new issue following the issue template

@MillerApps
Copy link

@marcelofabri looks like the pod for SwiftLint was out of date.

@BilalReffas
Copy link

Yes I have the same issue on Xcode 9.3

@MarcAMartin
Copy link

Seeing this issue as well

@marcelofabri
Copy link
Collaborator

Please open a new issue following the template and making sure you're on the latest version of SwiftLint.

@nmvictor
Copy link

also facing similar issue, just updated my Xcode to 9.3. any solution suggested thus far?

@S2Ler
Copy link

S2Ler commented Apr 13, 2018

Make sure you have the latest swiftlint: swiftlint version. Should 0.25.1 by now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

No branches or pull requests

7 participants