-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix print_script for 1.10 #36
Conversation
Appearantly, at the time when @generated is evaluated, methods from other packages may not have been compiled yet, so `hasmethod(show, Tuple{IO, MIME{Symbol("text/javascript")}, value})` returns false, and the @generated function print_script throws an error. As the old version worked in 1.9.3, this appears to be the result of subtle changes in precompilation/initialization behavior somewhere between 1.9.3 and 1.10.0-beta2.
This should fix #35 and at once JuliaPluto/AbstractPlutoDingetjes.jl#12 , JuliaLang/julia#51476 and j-fu/PlutoVista.jl#13 . |
The change in behavior appears to be due to the new parser. When setting |
I'm curious does the new parser fix JuliaLang/julia#18221 ? If so we could report it as being fixed. Regardless, could wrap this in a version check? This code is there to reduce user confusion. |
No it doesn't solve JuliaLang/julia#18221 . Will see if this can be wrapped into a version check. But in 1.10 we are on field 1 anyway. |
What about implementing
Seems to be a bit nasty as well, but might work (did not test this yet outside of the REPL). |
That would be type thievery? |
Keep the old behavior (via @generated) for versions <=1.9.x.
I think not exactly, but kind of scary anyway. I added the version discriminator as you proposed. I think this is ready to merge. |
I suppose there's not much else we could do. |
Appearantly, at the time when @generated is evaluated, methods from other packages may not have been compiled yet, so
hasmethod(show, Tuple{IO, MIME{Symbol("text/javascript")}, value})
returns false, and the @generated function print_script throws an error.As the old version worked in 1.9.3, the different behavior appears to be the result of subtle changes in precompilation/initialization behavior somewhere between 1.9.3 and 1.10.0-beta2.