Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/Buffer.res
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,24 @@ external readUintBE: (t, ~offset: int, ~length: int) => float = "readUintBE"
@send
external readUintLE: (t, ~offset: int, ~length: int) => float = "readUintLE"

@send
external readBigInt64BE: (t, ~offset: int) => bigint = "readBigInt64BE"
Copy link
Contributor Author

@muqiuhan muqiuhan Jan 19, 2025

Choose a reason for hiding this comment

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

CI says there are compilation errors here:

   We've found a bug for you!
  /home/runner/work/rescript-nodejs/rescript-nodejs/src/Buffer.res:276:47-52

  274275 │ @send
  276external readBigInt64BE: (t, ~offset: int) => bigint = "readBigInt64BE
      │ "
  277278 │ @send

  This type constructor, `bigint`, can't be found.
  If you wanted to write a recursive type, don't forget the `rec` in `type rec`

But rescript 11.1 already treats bigint as primitive type: Primitive Types | Big Integer.


Maybe it's because the rescript version in the devDependencies of the current project is 11.0.1:

  "devDependencies": {
    "rescript": "^11.0.1",
  },

Copy link
Owner

Choose a reason for hiding this comment

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

Yes, this repo is quite out of date, feel free to upgrade.


@send
external readBigInt64LE: (t, ~offset: int) => bigint = "readBigInt64LE"

@send
external readBigUint64BE: (t, ~offset: int) => bigint = "readBigUInt64BE"

@send
external readBigUint64LE: (t, ~offset: int) => bigint = "readBigUInt64LE"

@send external slice: (t, ~start: int, ~end_: int) => t = "slice"
@send external sliceToEnd: (t, ~start: int) => t = "slice"

@send external subarray: (t, ~start: int, ~end_: int) => t = "subarray"
@send external subarrayToEnd: (t, ~start: int) => t = "subarray"

@send external swap16: t => t = "swap16"
@send external swap32: t => t = "swap32"
@send external swap64: t => t = "swap64"
Expand Down
Loading