-
Notifications
You must be signed in to change notification settings - Fork 14
Make identity op on julia v1.10 #37
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
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #37 +/- ##
==========================================
- Coverage 98.43% 95.45% -2.99%
==========================================
Files 1 1
Lines 64 66 +2
==========================================
Hits 63 63
- Misses 1 3 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Pull Request Test Coverage Report for Build 4550113720
💛 - Coveralls |
| static_methods(@nospecialize(f)) = static_methods(f, Tuple{Vararg{Any}}) | ||
| @generated function static_methods(@nospecialize(f) , @nospecialize(_T::Type{T})) where {T <: Tuple} | ||
| list_of_methods = _methods(f, T) | ||
| ci = create_codeinfo_with_returnvalue([Symbol("#self#"), :f, :_T], [:T], (:T,), :($list_of_methods)) | ||
|
|
||
| # Now we add the edges so if a method is defined this recompiles | ||
| ci.edges = _method_table_all_edges_all_methods(f, T) | ||
| return ci | ||
| const static_methods = if VERSION >= v"1.10.0-DEV.609" | ||
| # feature is now built in | ||
| methods | ||
| else | ||
| _static_methods(@nospecialize(f)) = static_methods(f, Tuple{Vararg{Any}}) | ||
| @generated function _static_methods(@nospecialize(f) , @nospecialize(_T::Type{T})) where {T <: Tuple} | ||
| list_of_methods = _methods(f, T) | ||
| ci = create_codeinfo_with_returnvalue([Symbol("#self#"), :f, :_T], [:T], (:T,), :($list_of_methods)) | ||
|
|
||
| # Now we add the edges so if a method is defined this recompiles | ||
| ci.edges = _method_table_all_edges_all_methods(f, T) | ||
| return ci |
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.
methods isn't constant folded at compile-time even after the PR. It returns vector, which is currently not handled as constant within our compiler.
|
It's hard to overstate my satisfaction. |
|
Yay! I am so happy about this!!! |
Thanks to JuliaLang/julia#48639 we no longer need this package.
We do want to keep it working for purposes of compatibility.
Which is what this PR achieves.
(Also: I win. I got this feature into the language.
This was a triumph. I am making a note here, huge success!)