-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
traverse_and_update/3 return typespec needs html_tree() #426
Comments
@hattmarris I think you are right. The return type should be Would you mind to send a pull request? |
@WLSF I think I can't assign directly to you. But feel free to work on this :) |
@philss couple of things that I've noticed: The function If thats by design then I guess that there are other aspects of this spec that might not be right, because right now its expecting the first arg and the response to be Assuming everything is ok with the STRING thing, I guess we could also replace this part by: |
@philss yeah, I was wrong. It should be |
Description
The first element in the tuple return type was changed to
html_node()
in this revision - https:/philss/floki/pull/289/files#diff-0eacaeb3de3bdf5b80408719a3ce69f47fd9eda5e9a02de33bd65f7b1235e0e2R395But dialyzer caught for me that this was always returning an
html_tree()
spec'd as a list with a root node --@type html_tree() :: [html_node()]
I don't pretend to know if maybe other use cases might return just a node - but if that's the case could we change spec for return type to allow
html_tree() | html_node()
node? Thanks in advance for taking the time to read my report & for the awesome lib!To Reproduce
Steps to reproduce the behavior:
Here's a simple reproduction:
Expected behavior
Based on typespec, I expected:
The text was updated successfully, but these errors were encountered: