Skip to content

redundant_self false positives for properties clashing with local variables that were assigned via tuple destructuring #6553

Closed

Description

@rgoldberg

New Issue Checklist

Bug Description

redundant_self false positives for properties clashing with local variables that were assigned via tuple destructuring:

struct S {
	let a: Int
	let b: Int

	init() {
		let (a, b) = (1, 2)
		self.a = a // spurious Redundant Self Violation: Explicit use of 'self' is not required (redundant_self)
		self.b = b // spurious Redundant Self Violation: Explicit use of 'self' is not required (redundant_self)
	}
}
$ swiftlint --quiet --only-rule redundant_self --reporter relative-path S.swift
S.swift:7:3: warning: Redundant Self Violation: Explicit use of 'self' is not required (redundant_self)
S.swift:8:3: warning: Redundant Self Violation: Explicit use of 'self' is not required (redundant_self)

Environment

  • SwiftLint: 0.63.2
  • Xcode: Xcode 26.4 / Build version 17E192
  • Installation: Homebrew Core
  • Configuration file:
redundant_self:
  only_in_closures: false

Are you using nested configurations? No

Activity

  1. added
    bug
    on Mar 27, 2026
  2. self-assigned this
    on Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions