Skip to content

False positive triggers for async_without_await in actor with init() async #6423

@akuzminskyi

Description

@akuzminskyi

New Issue Checklist

Bug Description

In the following example, async_without_await suggest to remove async from init method, but it causes an error.

actor A {
    init() async {
        foo()
    }

    func foo() {}
}
Image

This is only for actor as we can write without await, so it doesn't affect other data types.

Mention the command or other SwiftLint integration method that caused the issue. Include stack traces or command output.

$ swiftlint lint

Environment

  • SwiftLint version: 0.63.0
  • Xcode version: 26.0.1
  • Installation method used: Universal macOS Binary
  • Configuration file:
only_rules:
- async_without_await

Are you using nested configurations? If so, paste their
relative paths and respective contents.

Metadata

Metadata

Assignees

Labels

bugUnexpected and reproducible misbehavior.good first issueIssue to be taken up by new contributors yet unfamiliar with the project.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions