-
Notifications
You must be signed in to change notification settings - Fork 392
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
Lua comma evaluation order issue? tfound[1],num = num, num - 1 breaks on luau sometime after 0.541 #754
Comments
I can confirm that this is an issue with multiple-assignment in Luau compiler that's related to a not-so-recent optimization that we've added. |
We have a fix ready internally, next release is planned for Dec 2nd. |
Fast! Thank you very much! |
* Type mismatch errors now mention if unification failed in covariant or invariant context, to explain why sometimes derived class can't be converted to base class or why `T` can't be converted into `T?` and so on * Class type indexing is no longer an error in non-strict mode (still an error in strict mode) * Fixed cyclic type packs not being displayed in the type * Added an error when unrelated types are compared with `==`/`~=` * Fixed false positive errors involving sub-type tests an `never` type * Fixed miscompilation of multiple assignment statements (Fixes #754) * Type inference stability improvements
Merged to 0.555 and the byte code generate is unfortunately in the wrong order still 22: tfound[1],num = num,num - 1 |
* Type mismatch errors now mention if unification failed in covariant or invariant context, to explain why sometimes derived class can't be converted to base class or why `T` can't be converted into `T?` and so on * Class type indexing is no longer an error in non-strict mode (still an error in strict mode) * Fixed cyclic type packs not being displayed in the type * Added an error when unrelated types are compared with `==`/`~=` * Fixed false positive errors involving sub-type tests an `never` type * Fixed miscompilation of multiple assignment statements (Fixes luau-lang/luau#754) * Type inference stability improvements
We have some binary search copy pasta from here http://lua-users.org/wiki/BinarySearch
It has this pesky line:
tfound[1],num = num, num - 1
In 0.541 this line emits these opcodes, and everything works as it did on stock Lua:
In 0.554, it emits this, which breaks our search:
If I remove the comma, it works again. The order is correct and is nicely optimized as 0.554
I'm ready to believe this is ambiguous or a bug in the original, but I thought I should mention it for compatibility reasons.
The text was updated successfully, but these errors were encountered: