Skip to content

prefer_self_in_static_references doesn't understand extensions #3875

Closed

Description

@dalemyers

New Issue Checklist

Describe the bug

Example code:

class Foo {
  static let x = 1
}

extension Foo {
  static let y = Foo.x
}

In this case it suggests you change to static let y = Self.x, however that isn't valid code.

SwiftLint version: 0.46.3

Activity

  1. dalemyers commented on Mar 11, 2022

    @dalemyers
    Author

    I'm not sure what happened but I suspect I had two versions installed on my machine. One which was running via scripts but was older and still had this issue, and the other which was 0.46.3. I no longer repro this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions