Open maddiemort opened 7 years ago
@sorenmortensen
The script that generates the diagram analyses the code as a text only. When your class conforms to a protocol that is not being analyzed by the script (like Comparable), there's no way for the script to know the type that goes after the ":" part in the class definition. To satisfy most of the use cases, the script treats the first type after the ":" as a super class, or as a protocol only if it's part of the analysis process.
I don't see any way how this can be fixed with the approach to analyze the code as a text. Maybe these kinds of issues can be solved by changing the approach to analyze a compiler output but that would be a whole other project.
If you have any other idea or would want to make a pull request about this, go ahead and let me know, otherwise I'd be closing the issue.
Anyway, thanks for noticing our script's pitfalls. :)
A class that conforms to a single protocol only and does not inherit is assumed to inherit from the protocol, which is assumed to be a class.
For example:
produces this:
Whereas it should say "conforms to" and "protocol Comparable"