diff --git a/Changelog.md b/Changelog.md index 33f0dcc9..538190ea 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Fixed bug that caused prefix and postfix operators to be omitted + from generated documentation. + #262 by @Lukas-Stuehrk. + ## [1.0.0-beta.6] - 2021-04-24 ### Added diff --git a/Sources/swift-doc/Supporting Types/Components/OperatorImplementations.swift b/Sources/swift-doc/Supporting Types/Components/OperatorImplementations.swift index c0040a2a..f28fa761 100644 --- a/Sources/swift-doc/Supporting Types/Components/OperatorImplementations.swift +++ b/Sources/swift-doc/Supporting Types/Components/OperatorImplementations.swift @@ -53,7 +53,7 @@ struct OperatorImplementations: Component { heading = [lhs.type, function.name, rhs.type].compactMap { $0 }.joined(separator: " ") case .prefix: - guard function.signature.input.count == 2, + guard function.signature.input.count == 1, let operand = function.signature.input.first else { return nil @@ -61,7 +61,7 @@ struct OperatorImplementations: Component { heading = [function.name, operand.type].compactMap { $0 }.joined(separator: " ") case .postfix: - guard function.signature.input.count == 2, + guard function.signature.input.count == 1, let operand = function.signature.input.first else { return nil