Create overloadable function for string representations of types#537
Open
MilesCranmer wants to merge 3 commits intoJuliaDebug:masterfrom
Open
Create overloadable function for string representations of types#537MilesCranmer wants to merge 3 commits intoJuliaDebug:masterfrom
MilesCranmer wants to merge 3 commits intoJuliaDebug:masterfrom
Conversation
Author
|
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 |
Zentrik
reviewed
Jan 18, 2024
| return string(T) | ||
| else | ||
| wrapper = Base.typename(T).wrapper | ||
| return string(wrapper, '{', join(map(type_string, T.parameters), ','), '}') |
Collaborator
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #535
Example: