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

Commit 767891b

Browse files
committed
Only include operators if they have at least one visible implementation.
1 parent 7ae63b6 commit 767891b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/swift-doc/Subcommands/Generate.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ 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, includingImplementations: symbolFilter)
79+
let operatorPage = OperatorPage(module: module, symbol: symbol, baseURL: baseURL, includingImplementations: symbolFilter)
80+
if !operatorPage.implementations.isEmpty {
81+
pages[route(for: symbol)] = operatorPage
82+
}
8083
case let function as Function where !function.isOperator:
8184
globals[function.name, default: []] += [symbol]
8285
case let variable as Variable:

0 commit comments

Comments
 (0)