-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Integer shift operators are not documented #1136
Comments
Assigning to Area=language to get the actual behavior specified. Added Area-Language label. |
Issue #1137 has been merged into this issue. |
From issue #1137, co19 tests that depend on this issue: Added Triaged label. |
This comment was originally written by ief...@unipro.ru Actually, the spec says the following: A shift expression of the form e1 op e2 is equivalent to the method invocation So it is probably a library issue: corresponding operators should be properly documented. |
I agree that this could be a library issue too. |
Moving to libraries and assigning to Josh. Set owner to jjb@google.com. |
I believe the implementation is working correctly now. The VM does throw an out-of-memory error when shifting by too much (when the representation would be too big to fit in the heap, or probably a little before). Set owner to @lrhn. |
Has the documentation be updated? See also co19 issue #129. cc @floitschG. |
The documentation doesn't mention memory overflows (nor should it, it's just another way to run out of memory, just as creating extremely large lists). |
This issue was originally filed by ief...@unipro.ru
What steps will reproduce the problem?
consider the following test:
main() {
int val = 1 << 2147483647;
}
What is the expected output? What do you see instead?
Expected: not sure what, since behavior is not documented
Actual:
Unhandled exception:
NoSuchMethodException - receiver: '2147483647' function name: 'shlFromInt' arguments: [1]]
0. Function: 'Object.noSuchMethod' url: 'bootstrap' line:356 col:3
1. Function: 'IntegerImplementation.<<' url: 'bootstrap_impl' line:1505 col:28
2. Function: '::main' url: '/home/iefremov/dart/co19/trunk/co19/tests/co19/src/LibTest/core/int/operator_lshift/int_operator_lshift_A01_t02.dart' line:17 col:15
The same works for operator >>
What version of the product are you using? On what operating system?
DartVM 3171
Please provide any additional information below.
co19 tests (see rev. 87):
LibTest/core/int/operator_lshift/int_operator_lshift_A01_t02.dart
LibTest/core/int/operator_rshift/int_operator_rshift_A01_t02.dart
The text was updated successfully, but these errors were encountered: