Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single protocol conformance on a class assumed to be inheritance #2

Open
nerosnm opened this issue Feb 25, 2017 · 1 comment
Open

Comments

@nerosnm
Copy link

nerosnm commented Feb 25, 2017

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:

class Day: Comparable {
    // ...
}

produces this:

screen shot 2017-02-25 at 14 01 00

Whereas it should say "conforms to" and "protocol Comparable"

@yoshimkd
Copy link
Owner

@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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants