SciML / RuntimeGeneratedFunctions.jl

Functions generated at runtime without world-age issues or overhead
https://docs.sciml.ai/RuntimeGeneratedFunctions/stable/
MIT License
100 stars 14 forks source link

Ensure globals are looked up in the user's module #12

Closed c42f closed 4 years ago

c42f commented 4 years ago

Create method of generated_callfunc in the user's module so that any global symbols within the body will be looked up in the user's module scope.

This is straightforward but a bit clunky. A neater solution might be to explicitly expand in the user's module and return a CodeInfo from generated_callfunc, but it seems we'd need jl_expand_and_resolve which doesn't exist until Julia 1.3 or so. See:

codecov[bot] commented 4 years ago

Codecov Report

Merging #12 into master will decrease coverage by 2.10%. The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #12      +/-   ##
==========================================
- Coverage   92.10%   90.00%   -2.11%     
==========================================
  Files           1        1              
  Lines          38       40       +2     
==========================================
+ Hits           35       36       +1     
- Misses          3        4       +1     
Impacted Files Coverage Δ
src/RuntimeGeneratedFunctions.jl 90.00% <50.00%> (-2.11%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bbfaf60...3ab1da5. Read the comment docs.