ForwardDiff2.jl
ForwardDiff2.jl copied to clipboard
Fail if a GlobalRef is being assigned to a Dual number.
Codecov Report
Merging #39 into master will increase coverage by
0.49%. The diff coverage is80%.
@@ Coverage Diff @@
## master #39 +/- ##
==========================================
+ Coverage 73.26% 73.75% +0.49%
==========================================
Files 7 7
Lines 273 282 +9
==========================================
+ Hits 200 208 +8
- Misses 73 74 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/custom_dispatch.jl | 94.28% <80%> (-5.72%) |
:arrow_down: |
| src/dual_context.jl | 90.56% <0%> (+1.88%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 5b0f8d4...e4925ff. Read the comment docs.
Note that this won't solve all leaks, e.g. if you have global ref = Real[0] and put a number in there while differentiating you'll get the same issue.
I could probably also get around this by, for example, doing global foo = [x::Dual] or global foo = SomeStruct(x::Dual) (and same for setfield issues).
I could probably also get around this by, for example, doing global foo = [x::Dual] or global foo = SomeStruct(x::Dual) (and same for setfield issues).
If the user wants to get a Dual, then it is the intended behavior.