Skip to content
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

Uint8List reports type exception while using + operator in null safety mode #45140

Closed
ctrysbita opened this issue Feb 27, 2021 · 0 comments
Closed
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-typed-data type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@ctrysbita
Copy link

ctrysbita commented Feb 27, 2021

Dart code:

print(Uint8List.fromList([1]) + Uint8List.fromList([2]));

Reports exception:

Unhandled exception:
type 'Null' is not a subtype of type 'int' in type cast
#0      List.length= (dart:core-patch/growable_array.dart:222:12)
#1      _IntListMixin.+ (dart:typed_data-patch/typed_data_patch.dart:156:9)

While null safety is on (SDK >= 2.12.0-0).

Expected output:

[1, 2]

Dart SDK Version (dart --version)

Dart SDK version: 2.13.0-30.0.dev (dev) (Fri Feb 12 04:33:47 2021 -0800) on "windows_x64"
@lrhn lrhn added area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-typed-data type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Mar 1, 2021
@lrhn lrhn self-assigned this Mar 1, 2021
dart-bot pushed a commit that referenced this issue Mar 10, 2021
Fixes #45140.

Bug: http://dartbug.com/45140
Change-Id: I95f45c64d86428ddb67d176cdd2d50cfdbadfe8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188283
Reviewed-by: Martin Kustermann <[email protected]>
Commit-Queue: Lasse R.H. Nielsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-typed-data type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants