Skip to content

Conversation

@oxinabox
Copy link
Owner

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!)

@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2023

Codecov Report

Merging #37 (3bb42aa) into master (6f6d911) will decrease coverage by 2.99%.
The diff coverage is 85.71%.

📣 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     
Impacted Files Coverage Δ
src/Tricks.jl 95.45% <85.71%> (-2.99%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@coveralls
Copy link

coveralls commented Mar 29, 2023

Pull Request Test Coverage Report for Build 4550113720

  • 9 of 10 (90.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.9%) to 98.077%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Tricks.jl 9 10 90.0%
Totals Coverage Status
Change from base Build 2636518578: -1.9%
Covered Lines: 51
Relevant Lines: 52

💛 - Coveralls

Comment on lines -66 to +83
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

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.

@ChrisRackauckas
Copy link

It's hard to overstate my satisfaction.

@zsunberg
Copy link

Yay! I am so happy about this!!!

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

Successfully merging this pull request may close these issues.

7 participants