Skip to content

[SR-7303] "Method must be declared private because its parameter uses a private type", although the method is in a private extension #49851

@swift-ci

Description

@swift-ci
Previous ID SR-7303
Radar None
Original Reporter theo (JIRA User)
Type Bug

Attachment: Download

Environment

Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)
Target: x86_64-apple-macosx10.9

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, AccessControl
Assignee None
Priority Medium

md5: aca964c8881a8f4aaecf2590b24bb72f

is duplicated by:

  • SR-7420 Private enum in private extension cannot be accessed in method
  • SR-7750 Private extensions can't use private types in method declarations
  • SR-8500 Method defined in private extension unable to use private type from within the same access control group

Issue Description:

The following piece of code produces this error: Method must be declared private because its parameter uses a private type

class Foo {

  private enum MyPrivateEnum {
    case myCase
  }

}

private extension Foo {

  func bar(argument: MyPrivateEnum) {

  }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    access controlFeature → modifiers: Access control and access levelscompilerThe Swift compiler itselfenumFeature → type declarations: Swift enumeration declarationsextensionFeature → declarations: `extension` declarationstype checkerArea → compiler: Semantic analysisunexpected errorBug: Unexpected error

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions