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

classify js bigint type correctly #5351

Merged
merged 4 commits into from
Jun 30, 2022

Conversation

cometkim
Copy link
Contributor

@cometkim cometkim commented Jan 2, 2022

currently, Js.Types.classify to external bigint value matches JSSymbol('a)

This is also related to #5350
I guess bigint_val will be replaced with the bigint binding

@bobzhang
Copy link
Member

@cometkim hi, would you mind update the PR with smaller diffs

@cometkim
Copy link
Contributor Author

cometkim commented Jan 20, 2022

what does that mean "smaller diffs"? I only changed the implementation of Js.Types.classify and relevant interfaces and tests.

@bobzhang
Copy link
Member

bobzhang commented May 5, 2022

@cometkim sorry, I was on leave for several months. I mean not check in diffs of generated code

@cannorin
Copy link
Contributor

cannorin commented Jun 8, 2022

ts2ocaml would greatly benefit from having bigint supported in rescript out of the box.

I'm willing to help this if you need a hand.

@cometkim
Copy link
Contributor Author

cometkim commented Jun 8, 2022

@bobzhang I just cleaned the PR.

I'm also wondering if there are any latest plans for bigint first-class support.

@cristianoc
Copy link
Collaborator

@bobzhang I just cleaned the PR.

I'm also wondering if there are any latest plans for bigint first-class support.

would you rebase on current master -- looks like we can move on with this

Copy link
Collaborator

@cristianoc cristianoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small suggestions on the order of checks and final default.
Probably does not matter much but might be slightly more future-proof.

@cometkim cometkim requested a review from cristianoc June 30, 2022 01:42
@cristianoc
Copy link
Collaborator

cristianoc commented Jun 30, 2022

This looks great. Seems ready to merge.
Just a quick question: are the existing tests OK, do they test enough functionality of typeof?

@cristianoc
Copy link
Collaborator

The context is this changes so rarely that I guess it might be unlikely that more tests would catch anything in future. If so, nothing else to do.

@cristianoc
Copy link
Collaborator

Also would you update the changelog.

@cristianoc
Copy link
Collaborator

(CI fails because some generated files were not checked in after compiling).

@cristianoc cristianoc merged commit bda48d0 into rescript-lang:master Jun 30, 2022
@cometkim
Copy link
Contributor Author

Oh, thanks for updating the changelog :)

@cometkim cometkim deleted the classify-bigint branch June 30, 2022 05:23
@cometkim
Copy link
Contributor Author

are the existing tests OK, do they test enough functionality of typeof?

Tests are OK, and I think it's enough here.
I couldn't write a decoder without BigInt support, but now I can explicitly output errors at least.

@DZakh
Copy link
Contributor

DZakh commented Jul 7, 2022

If we're going to have support for BigInt in the future, maybe it's better to create Js.BigInt module with only type t?
So we won't have breaking changes later.

@DZakh
Copy link
Contributor

DZakh commented Jul 7, 2022

If we're going to have support for BigInt in the future, maybe it's better to create Js.BigInt module with only type t? So we won't have breaking changes later.

@cristianoc I don't know how notifications work in GH, so I decided to mention you just in case 😅

I can prepare a PR with it using #5350 as a reference, or even revive it.

@cristianoc
Copy link
Collaborator

Sure go ahead.

@DZakh
Copy link
Contributor

DZakh commented Jul 9, 2022

I've created a PR in which added the BigInt module #5531. I think it should be good enough as the first iteration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants