Skip to content

NoAccessLevelOnExtensionDeclaration doesn't apply access modifier on members guarded by #if #966

Closed
@ahoppen

Description

@ahoppen

Reproducer:

public extension Foo {
#if os(ios)
    static let x = 10
#endif
    static let y = 10
}

Gets formatted to

extension Foo {
  #if os(ios)
    static let x = 10
  #endif
  public static let y = 10
}

But should be

extension Foo {
  #if os(ios)
    public static let x = 10
  #endif
  public static let y = 10
}

rdar://146604297

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