-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add Revise tests #27
base: master
Are you sure you want to change the base?
Add Revise tests #27
Conversation
using some temporary module gymnastics inside a new `revise.jl` test suite. test that modifs in `@qstruct` definitions are correctly revised.
which currently leads to a ``` MethodError: Cannot `convert` an object of type Nothing to an object of type Symbol ``` during `Revise.revise()`
Thank you for the bug report! 121bab4 makes the revise tests pass, at the cost of breaking some other tests. Revise doesn't seem to like Is Revise really broken on your side? Maybe the Revise test failures are just an artifact of the way the revise tests are performed, and it's the tests themselves that need updating. I appreciate the test suite, and it was quite useful to me. That said, it would be a bit sad to add this kind of maintenance burden on all packages that use macros, for what is arguably a Revise failure (heroic as Revise is). I think once this is fixed, I'd merge the test suite, but wouldn't hesitate to drop it if it becomes a burden. |
No, the tests are working as expected. We can replicate the
errors in real life scenarios. |
With diff --git a/test/assets/within-macro1.jl b/test/assets/within-macro1.jl
index 36e468b..f639abd 100644
--- a/test/assets/within-macro1.jl
+++ b/test/assets/within-macro1.jl
@@ -3,7 +3,7 @@ using MacroTools: @q, @capture
macro mymodel(def)
@capture(def, model_(; params__))
- esc(@q begin
+ esc(quote
$QuickTypes.@qstruct_fp $model(; $(params...))
end)
end
diff --git a/test/assets/within-macro2.jl b/test/assets/within-macro2.jl
index 76da376..d27b4a6 100644
--- a/test/assets/within-macro2.jl
+++ b/test/assets/within-macro2.jl
@@ -3,7 +3,7 @@ using MacroTools: @q, @capture
macro mymodel(def)
@capture(def, model_(; params__))
- esc(@q begin
+ esc(quote
$QuickTypes.@qstruct_fp $model(; $(params...))
end)
end the Revise error goes away. |
Yes, res = esc(@q begin
$QuickTypes.@qstruct_fp $model(; $(params...))
end)
res.args[1].args[2] = __source__
return res The problem with normal Come to think of it, maybe the |
Start with some basic Revise tests, that currently pass on v1.9.1.