-
-
Notifications
You must be signed in to change notification settings - Fork 670
bswap breaking change in 0.20 #2700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Here is bswap in 0.19.0, already requiring a type argument. Hence not sure if the observation regarding a new type argument requirement is correct: https://github.com/AssemblyScript/assemblyscript/blob/5427eb9cf7cc165e87c50b3b656b321e1ac25b6e/std/assembly/polyfills.ts#L1C1-L26 On a glimpse, there is one PR part of 0.19.17 that touched bswap: #2077 Does this one perhaps explain the change in behavior? |
Thank you for a swift reply! Behaviour is the same in all versions before 0.20, including 0.19.17 and 0.19.23. The signature of bswap hasn't changed, I meant to say that type inference that used to work before 0.20 now requires an explicit type and overflows otherwise. |
Appears that the PR causing this is #2417, which is part of 0.20.19, whereas 0.20.18 does not show the difference in behavior. In the PR, |
cc @MaxGraey: What would you prefer here? Move assemblyscript/src/builtins.ts Lines 1196 to 1216 in a0c27fa
|
Up to you. But I guess put |
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
AssemblyScript version
The text was updated successfully, but these errors were encountered: