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
dbarden opened this Issue Jan 25, 2018 · 9 comments

Comments

Projects
None yet
7 participants
@dbarden

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 label Jan 25, 2018

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Jan 25, 2018

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Jan 25, 2018

@dbarden

This comment has been minimized.

dbarden commented Jan 25, 2018

Thanks :)

@MillerApps

This comment has been minimized.

MillerApps commented Apr 5, 2018

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

@marcelofabri

This comment has been minimized.

Collaborator

marcelofabri commented Apr 5, 2018

@MillerApps please fill a new issue following the issue template

@MillerApps

This comment has been minimized.

MillerApps commented Apr 6, 2018

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

@BilalReffas

This comment has been minimized.

BilalReffas commented Apr 7, 2018

Yes I have the same issue on Xcode 9.3

@MarcAMartin

This comment has been minimized.

MarcAMartin commented Apr 12, 2018

Seeing this issue as well

@marcelofabri

This comment has been minimized.

Collaborator

marcelofabri commented Apr 12, 2018

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

@nmvictor

This comment has been minimized.

nmvictor commented Apr 13, 2018

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

@diejmon

This comment has been minimized.

diejmon 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