-
Notifications
You must be signed in to change notification settings - Fork 41
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
Create overloadable function for string representations of types #537
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a few tests?
Okay I think I'm hitting some recursive types now. It's not fully general but the user can always overload behavior when needed. For the tests I think I'm doing something wrong in that I don't understand |
return string(T) | ||
else | ||
wrapper = Base.typename(T).wrapper | ||
return string(wrapper, '{', join(map(type_string, T.parameters), ','), '}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit wary of this code mapping over T.parameters
as there were quite a few issues doing a similar thing elsewhere.
In that code we had to check for whether each element in T.parameters
was assigned, I don't know if that's a concern here or not.
See https://github.com/JuliaDebug/Cthulhu.jl/pull/508/files for that code and some issues with previous versions of that code are #491, #492, #494.
Fixes #535
Example: