Invoking a type object with no parameters should *always* yield an instance of that type
nikomatsakis opened this issue · comments
I'm not sure what we do now for a call like uint8()
, but I think it should yield 0. This basically means that we can say that for all type objects T
, calling T()
yields an instance of that type, calling T(exemplar)
yields an instance of that type with data taken from exemplar
.
The one form that is not applicable across all type objects is T(buffer, offset)
, though one can write T.Array(buffer, offset, 1)
(or whatever) to create an array of length one.