Skip to content

operator_usage_whitespace rule false positive for unwrapping of the optional optional #2728

Closed
@ghost

Description

SwiftLint thinks that ?? is a nil coalescing operator, while it's a unwrapping of the optional optional.

func success(for item: Item) {
    item.successHandler??() // <- triggers operator_usage_whitespace, bc there's no spaces around ??, but item.successHandler is an optional optional
}

Would be nice to make operator_usage_whitespace rule configurable so you can exclude specific operators (??). #1013

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected and reproducible misbehavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions