Skip to content

legacy_objc_type rule triggers on NSNumber in the context of NumberFormatter which requires it #3723

@tylerbarnesTrexis

Description

@tylerbarnesTrexis

New Issue Checklist

Describe the bug

legacy_objc_type rule triggers on NSNumber in the context of NumberFormatter

Complete output when running SwiftLint, including the stack trace and command used
% swiftlint
Linting Swift files in current working directory
Linting 
...
Linting
warning: Legacy Objective-C Reference Type Violation: Prefer Swift value types to bridged Objective-C reference types (legacy_objc_type)
Done linting! Found 1 violation, 0 serious in files.

Environment

  • SwiftLint version: 0.44.0
  • Installation method used: Homebrew and SPM via Custom Package
  • Paste your configuration file:
only_rules:
  - legacy_objc_type
// This triggers a violation:
NumberFormatter.string(from: Double as NSNumber)

Originally posted by @PH9 in #3555 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIdeas for improvements of existing features and rules.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