This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
Operators are not included in the generated documentation if there are multiple operators with the same name #263
Labels
bug
Something isn't working
It's possible to use an operator name multiple times and create multiple definitions for an operator with the same name. It can be defined up to three times.
For example, the given Swift source (where the operators don't make too much sense, there are better ideas for custom operators out there):
will create the following documentation (after the fixes in #262) which is missing the declaration of the infix operator and all the operator implementations of the infix operator:
This is more or less an artifact howIdentifier
works for operators. It does not differentiate between the different kind of operators, therefore an infix operator has the same identifier as a postfix operator as a prefix operator.I can see multiple ways how we fix this.1. MakeIdentifier
have a differentEquatable
andHashable
for operators and create differentOperatorPage
s for the different kind of operators. Not sure if I like it.2. Change a little bit the
OperatorPage
. Currently it works with the assumption that an operator name has exactly one definition. We could collect all different operator definitions (prefix, infix, postfix) on the same page and then group the implementations by definition.Update: My initial assumption was wrong. It's way more trivial. We already create multiple pages for the different kind of operators, but the last operator declaration always wins because it overwrites the page of the previous declaration:
swift-doc/Sources/swift-doc/Subcommands/Generate.swift
Line 81 in 4ec92a5
The text was updated successfully, but these errors were encountered: