Closed
Description
Bug description
I noticed that bswap requires a type argument for i16 integers since 0.20.00.
Without the type argument it overflows.
Versions before 0.20.00 did not require a type argument and did not overflow.
Is this expected behaviour? If this is a regression, which changes from a7c87e6 might have caused it?
Steps to reproduce
Reproduction at https://github.com/fetsorn/as-bswap-repro
const value: i16 = -32768;
// [ 128 0 ]
assert(value == <i16>0x8000);
// [ 0 128 ], asserts in both <=0.19 and >=0.20
assert(bswap<i16>(value) == <i16>0x0080);
// [ 0 128 ], asserts in <=0.19, fails in >=0.20
assert(bswap(value) == <i16>0x0080);
// [ 255 128 ], asserts in >=0.20, fails in <=0.19
assert(bswap(value) == <i16>0xff80);
AssemblyScript version
0.20.00