1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-08 12:06:26 +00:00
dart-sdk/runtime
Todd Volkert 9173aed1ba Declare return types of Uint8List.
These methods all were returning Uint8List, yet they were only
declared to return List<int>. This forced callers to either defensively
wrap the return values in Uint8List, or to assume the contravariant
return value:

* Utf8Codec.encode()
* BytesBuilder.takeBytes()
* BytesBuilder.toBytes()
* File.readAsBytes()
* File.readAsBytesSync()
* RandomAccessFile.read()
* RandomAccessFile.readSync()
* Uint8List.sublist()

Since it's related, this change also updates the following sublist()
methods to declare that they return the a sublist of the same type as
the source list:

* Int8List
* Uint8ClampedList
* Int16List
* Uint16List
* Int32List
* Uint32List
* Int64List
* Uint64List
* Float32List
* Float64List
* Float32x4List
* Int32x4List
* Float64x2List

Bug: https://github.com/dart-lang/sdk/issues/36900
Bug: https://github.com/dart-lang/sdk/issues/31547
Bug: https://github.com/dart-lang/sdk/issues/27818
Bug: https://github.com/dart-lang/sdk/issues/35521
Change-Id: Ic3bc1db0d64de36fb68b1d8d98037eed1464f978
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101742
Commit-Queue: Todd Volkert <tvolkert@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2019-06-20 06:43:44 +00:00
..
bin Update RawSocket.read to return Uint8List 2019-06-20 06:36:28 +00:00
docs Move the test runner (i.e. "test.dart"/"test.py") to pkg/. 2019-06-14 23:35:10 +00:00
include [vm] Document clock compatibility between Timeline.now and Dart_TimelineGetMicros. 2019-06-19 21:17:51 +00:00
lib Declare return types of Uint8List. 2019-06-20 06:43:44 +00:00
observatory [ VM / Service ] Add getInstances and InstanceSet to the service protocol. 2019-06-19 23:59:32 +00:00
platform [vm] Account for DBC32 when deciding between 32-bit and 64-bit ELF. 2019-05-29 23:59:12 +00:00
tests/vm Normalize status files 2019-06-19 23:04:01 +00:00
third_party [vm, fuchsia] Fix deps and stop suppressing -fvisibility=hidden. 2019-04-29 23:31:27 +00:00
tools [dart/fuzzer] added another ignored parameter 2019-06-13 19:05:04 +00:00
vm [ VM / Service ] Add getInstances and InstanceSet to the service protocol. 2019-06-19 23:59:32 +00:00
.gitignore
BUILD.gn Allow building Dart with Fuchsia SDK enabled buildroots. 2019-05-07 00:43:33 +00:00
codereview.settings
configs.gni [vm, fuchsia] Fix deps and stop suppressing -fvisibility=hidden. 2019-04-29 23:31:27 +00:00
CPPLINT.cfg
PRESUBMIT.py Fix PRESUBMIT.py so it is python3-compatible. 2019-05-07 20:53:06 +00:00
runtime_args.gni [vm/bytecode] Enable building of kernel service snapshot 2019-04-05 22:31:58 +00:00