Skip to content
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

dhall encode --json: DeserialiseFailure 0 "unexpected CBOR token type for a JSON value: TypeFloat16" #1350

Closed
sjakobi opened this issue Sep 27, 2019 · 1 comment
Assignees
Labels

Comments

@sjakobi
Copy link
Collaborator

sjakobi commented Sep 27, 2019

Here are the problematic cases I've found:

$ echo 'NaN' | dhall encode --json
dhall: DeserialiseFailure 0 "unexpected CBOR token type for a JSON value: TypeFloat16"
$ echo 'Infinity' | dhall encode --json
dhall: DeserialiseFailure 0 "unexpected CBOR token type for a JSON value: TypeFloat16"
$ echo '-Infinity' | dhall encode --json
dhall: DeserialiseFailure 0 "unexpected CBOR token type for a JSON value: TypeFloat16"
$ echo '0.0' | dhall encode --json
dhall: DeserialiseFailure 0 "unexpected CBOR token type for a JSON value: TypeFloat16"
$ echo '-0.0' | dhall encode --json
dhall: DeserialiseFailure 0 "unexpected CBOR token type for a JSON value: TypeFloat16"
@sjakobi sjakobi added the bug label Sep 27, 2019
@sjakobi
Copy link
Collaborator Author

sjakobi commented Sep 27, 2019

Another one:

$ echo '12.0' | dhall encode --json
dhall: DeserialiseFailure 0 "unexpected CBOR token type for a JSON value: TypeFloat32"

@sjakobi sjakobi self-assigned this Oct 1, 2019
sjakobi added a commit that referenced this issue Dec 30, 2019
CBOR values that are unrepresentable in JSON, are encoded as `null`,
e.g.

    $ echo 'Infinity' | dhall encode --json
    null
@mergify mergify bot closed this as completed in b623ea7 Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant