rescript-compiler
rescript-compiler copied to clipboard
@unboxed should support Js.TypedArray2.ArrayBuffer.t
I found that @unboxed supports many types, but it does not support ArrayBuffer or TypedArray.
@unboxed
type dataType = Bin(Js_typed_array2.ArrayBuffer.t) | Json(Js.Json.t) | Text(string)
@unboxed
type dataType = Bin(Js_typed_array2.Uint8Array.t) | Json(Js.Json.t) | Text(string)
However, ArrayBuffer or TypedArray is a type supported by JavaScript.
When I process with record, the JSON data type errors again.
@unboxed
type dataType = Bin({ val: Js_typed_array2.Uint8Array.t}) | Json(Js.Json.t) | Text(string)
I agree these, and probably many more builtins, should be supported by untagged variants. This will be much simpler after we move Core into the compiler, which is destined to happen in v12. Adding this to the v12 milestone.