Git Product home page Git Product logo

Comments (7)

talentdeficit avatar talentdeficit commented on August 23, 2024

i don't use dialyzer typically so i'm not sure i'm equipped to tackle this but i'll see what i can do

from jsx.

sumerman avatar sumerman commented on August 23, 2024

According to my little experiment, the fix is a simple inclusion of term [{}] to the json_term() type.

-type json_term() :: list({binary(), json_term()}) 
    | [{}]
    | list(json_term())
 ...

from jsx.

sumerman avatar sumerman commented on August 23, 2024

And it's also accurate to say that list({binary(), json_term()}) is actually list({binary() | atom(), json_term()})

from jsx.

talentdeficit avatar talentdeficit commented on August 23, 2024

i just ran dialyzer against the current development branch and i didn't get either of these errors. could you let me know what version you ran dialyzer against? also the output from dialyzer would be great too

from jsx.

sumerman avatar sumerman commented on August 23, 2024

Of course you will not see any warnings running dialyzer against just jsx (without the underspec warning turned on) because in this case dialyzer checks internal jsx consistency. Consider the following example: jsx's code handles A, B and C cases, but its spec denotes it currently handles only A and B — it's perfectly ok for dialyzer; but when dialyzer checks caller's code it complains about using C because jsx's spec discourage it.
Furthermore, projects with lots of deps in order to reduce memory footprint and runtime typically run dialyzer only against it's own codebase with PLTs generated from deps' typespecs, like this:

APP_PLT = ./.app_plt

$(APP_PLT): 
    dialyzer --plt ~/.dialyzer_plt --build_plt --output_plt $(APP_PLT) deps/*/ebin

dialyze: build $(APP_PLT)
    dialyzer --plts ~/.dialyzer_plt $(APP_PLT) --fullpath ebin -Wunmatched_returns -Werror_handling -Wrace_conditions

Here ~/.dialyzer_plt is a pregenerated PLT for the standard OTP distribution, and ./.app_plt is the project local one, which contains typespecs extracted from deps.

And even if we put the dialyzer thing aside for a second inconsistency between the typespec and the README remains.

from jsx.

talentdeficit avatar talentdeficit commented on August 23, 2024

okay thanks for helping me understand this. i think i've fixed it. let me know if you find any other problems

from jsx.

sumerman avatar sumerman commented on August 23, 2024

You're welcome. 5868430 passes dialyzation, thank you.

from jsx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.