Make typed arrays private abbreviations of TypedArray.t
Why
Every typed array type was a public abbreviation of TypedArray.t<_>, so the type checker took Uint8Array.t for Int8Array.t, while an untagged variant recognized them by their classes: I8(uint8Array) type-checked and then matched the U8 case (#8955).
Each typed array type is private TypedArray.t<_>: a distinct type that upcasts to TypedArray.t<_> with :>. The TypedArray.Impl functor gives each typed array module the functions of TypedArray for its own type, with their documentation, so Int8Array.get works on an Int8Array.t and Int8Array.slice returns one. The functor holds only externals, so including it emits no code; Stdlib_TypedArray gains an empty Impl function.
Typing rules changed (typed arrays):
@unboxed type ta = I8(Int8Array.t) | U8(Uint8Array.t)let x = I8(Uint8Array.fromArray([1]))
rule
Int8Array.t and Uint8Array.t are both TypedArray.t<int>,I8(uint8Array) type-checks and is matched as U8 at run timeI8(uint8Array) is a type erroraddedDiagnostic one typed array for another
let x = I8(Uint8Array.fromArray([1]))