separate type casting and padding into separate behavior #298
Labels
breaking
breaking change
cashc-compiler
Relates to the cashc compiler
enhancement
New feature or request
Milestone
the current situation of when padding occurs is not very consistent and requires a confusing workaround to cast a
bytes
item to a certain sizeI suggest a new function
toBytesX(item, byteLength)
which takes care of the paddingSo the new way would be
possible alternative syntaxes
toBytesLength
,padBytes
, orresizeBytes
.what would break
The second argument in
bytes(item, length)
would simply be deprecated, this can be done over time, first with a warning.bytes6(int)
would simply be disallowed and result in a type error at compile time, onlybytes
type would be able to cast to a bounded bytes typeThe text was updated successfully, but these errors were encountered: