You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote some code against v0.1 which had something like myFunction(doc::XML.Document) = <...>. But trying to upgrade to v0.2 of XML, I get the mysterious error ERROR: LoadError: ArgumentError: invalid type for argument doc in method definition for myFunction at <file>:<line>. Any idea what's going on? I added a compat entry for my package for now to stay on XML v0.1.
I'm getting this error on both julia 1.8 and 1.9.
The text was updated successfully, but these errors were encountered:
nstiurca
changed the title
Document breaking changes between v0.1 and v0.2?
Document (breaking) changes between v0.1 and v0.2?
May 10, 2023
There are some big breaking changes between the two versions that:
Are necessary for performance reasons.
Are impossible to deprecate cleanly.
The new way of doing things is in the README, but here's a summary:
The previous structs have been removed and their names have been reused in an enum type. The cryptic error you're seeing is because Document is no longer a type, but instead is an instance of the enum type NodeType.
Most of the old syntax still works, e.g. Document(children...).
Your function would now need to be something like:
functionmyfunction(node::Node)
nodetype(node) == Document ||error("myfunction requires a Document input")
<...>end
I hope this helps! Stick to v0.1 if you need the individual structs and open another issue if v0.2 is making something harder to accomplish.
I wrote some code against v0.1 which had something like
myFunction(doc::XML.Document) = <...>
. But trying to upgrade to v0.2 of XML, I get the mysterious errorERROR: LoadError: ArgumentError: invalid type for argument doc in method definition for myFunction at <file>:<line>
. Any idea what's going on? I added a compat entry for my package for now to stay on XML v0.1.I'm getting this error on both julia 1.8 and 1.9.
The text was updated successfully, but these errors were encountered: