You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 1, 2023. It is now read-only.
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.
As a prefix operator.
As an infix operator.
As a posfix operator.
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 how Identifier 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. Make Identifier have a different Equatable and Hashable for operators and create different OperatorPages 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: