Repository navigation
Conversation
`Base.get_extension` returns `nothing` for an unknown extension name, so querying `:InverseFunctionsTest` instead of `:InverseFunctionsTestExt` left the guard permanently true: "Did you forget to load Test?" was appended to every `test_inverse` `MethodError`, including those raised when `Test` is loaded and the extension method exists. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #67 +/- ##
==========================================
+ Coverage 98.48% 98.50% +0.02%
==========================================
Files 6 6
Lines 132 134 +2
==========================================
+ Hits 130 132 +2
Misses 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Could you fix the timing issue with |
|
Thanks, this made me dig deeper, and the load-time cost I attributed to Under Supporting evidence:
So |
|
Gotcha. Also, I dug around a bit, and we compile |
|
Nice catch on |
With the error hint kept, `test_inverse` only gains a method when `InverseFunctionsTestExt` is loaded, so `hasmethod` tells downstream code whether `test_inverse` is usable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d51de21 to
aabdd9b
Compare
Test-extension guard and let the extension implement a stubTest-extension guard in the error hint
|
I reported the finding in JuliaLang/julia#63850 |
Fix the extension name in the error hint. The guard queried
:InverseFunctionsTest, but the extension is registered asInverseFunctionsTestExt.Base.get_extensionreturnsnothingfor an unknown name rather than erroring, so the guard was permanently true and "Did you forget to load Test?" was appended to everytest_inverseMethodError— including ones raised whileTestis loaded.Tests cover both directions: with
Testloaded, a wrong-arityMethodErrorcarries no hint; withoutTest(checked in a subprocess, sinceTestcan't be unloaded), the hint is shown andhasmethod(test_inverse, Tuple{Any,Any})isfalse. Tests pass on Julia 1.6, 1.10, 1.11 and 1.13.An earlier version of this PR also removed
__init__to save load time. That cost turned out to be a@time_importsmeasurement artifact (see the discussion below), so__init__and the error hint stay.Closes #66 (version bumped to 0.1.18 here).
🤖 Generated with Claude Code