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

unneeded_synthesized_initializer rule does not detect violations in a struct nested inside a class #5120

Closed
2 tasks done
mildm8nnered opened this issue Jul 15, 2023 · 0 comments · Fixed by #5121
Closed
2 tasks done
Labels
bug Unexpected and reproducible misbehavior.

Comments

@mildm8nnered
Copy link
Collaborator

New Issue Checklist

Describe the bug

A clear and concise description of what the bug is.

Given

class Foo {
    struct Bar {
        let baz: Int

        init(baz: Int) {
            self.baz = baz
        }
    }
}

unneeded_synthesized_initializer will fail to detect the violation here.

Environment

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

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

  • Which Xcode version are you using (check xcodebuild -version)?

14.2

  • Do you have a sample that shows the issue? Run echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
    to quickly test if your example is really demonstrating the issue. If your example is more
    complex, you can use swiftlint lint --path [file here] --no-cache --enable-all-rules.

See above

@SimplyDanny SimplyDanny added the bug Unexpected and reproducible misbehavior. label Jul 15, 2023
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

Successfully merging a pull request may close this issue.

2 participants