Skip to content

package import of 'Foundation' was not used in package declarations when also importing module os #83893

@ahoppen

Description

@ahoppen

Type checking the following file results in a warning package import of 'Foundation' was not used in package declarations despite NSObject actually being using in a declaration that is marked as package.

package import Foundation
import os  // os_log

package func foo(x: NSObject) {}

Interestingly, this issue does not occur if:

  • os is not imported
  • public instead of package declarations are used
  • Date or NSString is used from Foundation instead of NSObject.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions