for-GET / jesse

jesse (JSon Schema Erlang) is an implementation of a JSON Schema validator for Erlang.
https://github.com/for-get/jesse
Apache License 2.0
126 stars 64 forks source link

jesse: fix handling of -0.0 for OTP-26.1/27.0 #129

Closed mikpe closed 1 year ago

mikpe commented 1 year ago

Matching of floating-point zeroes will change in OTP-27 so that -0.0 will no longer match a non-negative 0.0. OTP-26.1 warns about such constructs, which in jesse results in:

===> Compiling src/jesse_validator_draft3.erl failed src/jesse_validator_draft3.erl:865:5: matching on the float 0.0 will no longer also match -0.0 in OTP 27. If you specifically intend to match 0.0 alone, write +0.0 instead.

===> Compiling src/jesse_validator_draft4.erl failed src/jesse_validator_draft4.erl:1019:5: matching on the float 0.0 will no longer also match -0.0 in OTP 27. If you specifically intend to match 0.0 alone, write +0.0 instead.

===> Compiling src/jesse_validator_draft6.erl failed src/jesse_validator_draft6.erl:997:5: matching on the float 0.0 will no longer also match -0.0 in OTP 27. If you specifically intend to match 0.0 alone, write +0.0 instead.

Fixed by switching from matches to numerical comparisons.

srijan commented 1 year ago

Dupe of #128 ?

mikpe commented 1 year ago

Dupe of #128 ?

Yes

seriyps commented 1 year ago

I merged #128, so closing this one.