Git Product home page Git Product logo

Comments (8)

bhb avatar bhb commented on August 24, 2024

@bmabey Thanks very much for reporting this!

This is an internal check that unfortunately cannot be resolved by your client code - it means that Expound incorrectly assumes that all problems refer to the same piece of invalid data. If that's not true, Expound is going to have a bug anyway, so this assert catches the problem early. That's why the error message isn't too good - the only resolution is to report the bug, rather than change your code 😄 .

I think the error message here could be improved since the vanilla assert message is not helpful.

That's a good idea! I could at least add a message asking users to report the bug, so they don't wonder how to resolve it.

All that said, you've found a bug in Expound. If possible, can you share the code you used to trigger this assert? Thanks!

from expound.

bmabey avatar bmabey commented on August 24, 2024

The bug occurs when using s/or. Here is a reduced and contrived example that will trigger it:

(s/def :example.place/city string?)
(s/def :example.place/state string?)
(s/def :example/place (s/keys :req-un [:example.place/city :example.place/state]))

(s/def :example.person/first-name string?)
(s/def :example.person/last-name string?)
(s/def :example/person (s/keys :req-un [:example.person/first-name :example.person/last-name]))

(s/def :example/person-or-place  (s/or :person :example/person
                                       :place :example/place))

(s/explain :example/person-or-place {}) ;; works fine
(expound/expound :example/person-or-place {}) ;; blows up

from expound.

bhb avatar bhb commented on August 24, 2024

@bmabey Thanks for the repro! I'll fix ASAP

from expound.

bhb avatar bhb commented on August 24, 2024

@bmabey Thanks again for reporting this. Can you try 0.4.1-SNAPSHOT and see if it works for you?

from expound.

bhb avatar bhb commented on August 24, 2024

@bmabey Does this fix your issue? You can try it out by using 0.4.1-SNAPSHOT. Thanks!

from expound.

bmabey avatar bmabey commented on August 24, 2024

It is hard for me to reproduce the error in my system now but if the above use case is handled I think this will prevent it from happening again. Thanks!

from expound.

bhb avatar bhb commented on August 24, 2024

@bmabey No worries, thanks for the feedback!

from expound.

bhb avatar bhb commented on August 24, 2024

@bmabey I've released Expound 0.5.0, which includes this fix.

from expound.

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.