Skip to content

Int64 and Uint64 methods and types are not supported in Dart2JS's typeddata #10275

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

Closed
vsmenon opened this issue Apr 29, 2013 · 12 comments
Closed
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js

Comments

@vsmenon
Copy link
Member

vsmenon commented Apr 29, 2013

ByteData.[getInt64/setInt64/getUint64/setUint64] all throw unsupported exceptions in Dart2JS (they work in the VM).

Similarly, Int64List and Uint64List fail on construction.

It's not clear how to expose this in a way that works on Dart2JS. The only 64-bit int type we have is fixnum:int64, but that does not subtype num or int. We have no unsigned 64-bit int type for dart2js.

E.g., here's a signature:

abstract int getUint64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN])

If we implement this in Dart2JS, what should the return type be?

@vsmenon
Copy link
Member Author

vsmenon commented Apr 29, 2013

Issue #10254 has been merged into this issue.

@lrhn
Copy link
Member

lrhn commented Apr 30, 2013

In my opinion, they should throw UnimplementedError.

This can't be implemented correctly in dart2js without proper 64-bit integers, so it is really blocked on issue #1533.

@vsmenon
Copy link
Member Author

vsmenon commented Apr 30, 2013

Blocking on 1533 as Lasse suggests.

Note, current behavior is UnsupportedError as we cannot correctly implement it today, and it's not clear yet whether 1533 will be resolved in a way that lets us correctly implement it as is (given the current API).


Marked this as being blocked by #1533.

@kasperl
Copy link

kasperl commented May 23, 2013

Added this to the Later milestone.

@kasperl
Copy link

kasperl commented May 23, 2013

Added TriageForM5 label.

@kasperl
Copy link

kasperl commented May 28, 2013

Removed TriageForM5 label.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed triaged labels Feb 29, 2016
@Bluenuance
Copy link

what is the state of the issue
it says it is blocked because of #1533 but this issue is closed

@sigmundch
Copy link
Member

Thanks for following up @Bluenuance!

For the same reason we closed #1533, we won't be able to provide the 64-bit variants in typeddata from dart2js.

I'll shortly close this issue as well, since we currently have no plans to change the current behavior.

@fawdlstty
Copy link

Hello everyone. Is there a new plan for this issue? This problem continues to affect developers.

@lrhn
Copy link
Member

lrhn commented Jan 2, 2023

There is no known plan for allowing Uint64List/Int64List on the web, because there is no 64-bit integer values, so int operator[](int index) would not be able to return the values of a 64-bit integer list.

If the web version of Uint64List could return a BigInt, then it would be useful, but it wouldn't match the Dart type system since a JavaScript BigInt is not compatible with an int represented as a JavaScript Number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-not-planned Closed as we don't intend to take action on the reported issue P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js
Projects
None yet
Development

No branches or pull requests

7 participants