The above declares an array type with the access trait equal to its specialized variant of the array_get function. Calling [] on an instance of this type as below performs a type-checked call.
let a = array_new::<string>(8, 0);
assert(a[0] == array_get::<string>(a, 0));
Additionally, this PR
Makes type printing better by removing extraneous spacing and commas
Types can now carry method data, which can provide type-checkable syntactic sugar.
The above declares an array type with the
access
trait equal to its specialized variant of thearray_get
function. Calling[]
on an instance of this type as below performs a type-checked call.Additionally, this PR
type_tree
to better reflect its purpose