-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
native: cleanup assign, fix nested struct #23778
native: cleanup assign, fix nested struct #23778
Conversation
Connected to Huly®: V_0.6-22189 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Structs and enums, too? Excellent!
Oh true, == is not implemented for floats. |
|
||
a = 1.0 | ||
mut b := &a | ||
unsafe{*b += 2.5} | ||
assert a == 3.5 | ||
unsafe{*b -= 1.25} | ||
assert a == 2.25 | ||
unsafe{*b *= 6.0} | ||
assert a == 13.5 | ||
unsafe{*b /= 4.5} | ||
assert a == 3.0 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may need a change too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
however it can also serve as a check when the asserts and == work for f64, and the rest of the tests can cross check it, so imho it is good to merge as it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, I'll change that for the next PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will require to change all the tests in the file, as it is using asserts between floats for all checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may wait until assert between floats are fixed as some of the tests would be interesting to keep as such.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work.
Cleanup the
assign_stmt
function (and some functions called in it)Add file:line on some n_error calls for faster debugging
Fix nested struct expressions, ex:
foo.bar.a
did not workAdd tests for fixed behavior and for more already supported behavior