google / google/protobuf.dart

Int64 is signed, but we use it to store unsigned 64-bit values

Open
#44 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
572
Forks
196
Avg merge
1h 59m
Merged PRs (30d)
2

Description

We are storing both signed and unsigned 64-bit integers in as instances of Int64, even though the Int64 class is intended for signed values. It's up to the caller to treat the the value appropriately.

This is confusing because methods on Int64 such as isNegative() return the wrong thing for numbers from 1<<31 to the top of the range.

To fix this we would need to add another type to the fixnum library:
https://github.com/dart-lang/core/issues/148

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.