-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Simplify RuntimeGeneratedFunction type printing, but don't lie about the type :-) #16
Conversation
This reverts commit 9b9426e. Even though this printing is lovely to the eye, overloading show(::IO, ::Type{SomeType}) has been known to cause subtle problems in the past and suspected of causing them quite recently.
- Use SHA1 and use UInt32's to encode the 20 bits. sha1 has been good enough for git, and 64 bytes for sha512 is an awful lot. - Reorder the RuntimeGeneratedFunction type parameters to make them easier to read. - Shorten the module tag name
Codecov Report
@@ Coverage Diff @@
## master #16 +/- ##
==========================================
+ Coverage 81.81% 90.00% +8.18%
==========================================
Files 1 1
Lines 44 40 -4
==========================================
Hits 36 36
+ Misses 8 4 -4
Continue to review full report at Codecov.
|
I'll let @YingboMa take this. |
Seems like a good place to put it in the type hierarchy.
@@ -10,26 +10,17 @@ export @RuntimeGeneratedFunction | |||
|
|||
This type should be constructed via the macro @RuntimeGeneratedFunction. | |||
""" | |||
struct RuntimeGeneratedFunction{moduletag,id,argnames} | |||
struct RuntimeGeneratedFunction{argnames,moduletag,id} <: Function |
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.
haha yes, good idea.
I also just added a tweak here to make @YingboMa some of the history of problems supposedly caused by overloading these kind of To be quite clear, I'm just following those other PRs out of caution in not wanting random segfaults. I don't have a proper explanation for why this doesn't or shouldn't work well :-/ |
Alas this is not nearly as pretty as #15, but overloading
show(::IO, ::Type{SomeType})
has been known to cause subtle problems in the past. And suspected of causing them quite recently, though I'm not sure it was conclusively proven.So instead, here I've tried to shorten the RuntimeGeneratedFunction type:
For example:
Which is hardly pretty, but not as bad as before.