Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit c375a60

Browse files
committed
Fix the visibility of operator implementations.
1 parent 7654d76 commit c375a60

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/swift-doc/Subcommands/Generate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ extension SwiftDoc {
7676
case let `typealias` as Typealias:
7777
pages[route(for: `typealias`.name)] = TypealiasPage(module: module, symbol: symbol, baseURL: baseURL)
7878
case is Operator:
79-
pages[route(for: symbol)] = OperatorPage(module: module, symbol: symbol, baseURL: baseURL)
79+
pages[route(for: symbol)] = OperatorPage(module: module, symbol: symbol, baseURL: baseURL, includingImplementations: symbolFilter)
8080
case let function as Function where !function.isOperator:
8181
globals[function.name, default: []] += [symbol]
8282
case let variable as Variable:

Sources/swift-doc/Supporting Types/Pages/OperatorPage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ struct OperatorPage: Page {
99
let implementations: [Symbol]
1010
let baseURL: String
1111

12-
init(module: Module, symbol: Symbol, baseURL: String) {
12+
init(module: Module, symbol: Symbol, baseURL: String, includingImplementations symbolFilter: (Symbol) -> Bool) {
1313
precondition(symbol.api is Operator)
1414
self.module = module
1515
self.symbol = symbol
16-
self.implementations = module.interface.functionsByOperator[symbol]?.sorted() ?? []
16+
self.implementations = module.interface.functionsByOperator[symbol]?.filter(symbolFilter).sorted() ?? []
1717
self.baseURL = baseURL
1818
}
1919

0 commit comments

Comments
 (0)