Dart floating-point array encoders should accept a List<double>
BUG=
R=abarth@chromium.org, zra@google.com
Review URL: https://codereview.chromium.org/1513923003 .
diff --git a/mojo/dart/packages/mojo/lib/src/codec.dart b/mojo/dart/packages/mojo/lib/src/codec.dart
index 5461860..9d62b54 100644
--- a/mojo/dart/packages/mojo/lib/src/codec.dart
+++ b/mojo/dart/packages/mojo/lib/src/codec.dart
@@ -351,7 +351,7 @@
encoder.appendUint8Array(bytes);
}
- void encodeArray(Function arrayAppend, int elementBytes, List<int> value,
+ void encodeArray(Function arrayAppend, int elementBytes, List value,
int offset, int nullability, int expectedLength) {
if (value == null) {
encodeNullPointer(offset, isArrayNullable(nullability));
@@ -403,12 +403,14 @@
nullability, expectedLength);
void encodeFloatArray(
- List<int> value, int offset, int nullability, int expectedLength) =>
+ List<double> value, int offset, int nullability,
+ int expectedLength) =>
encodeArray((e, v) => e.appendFloatArray(v), 4, value, offset,
nullability, expectedLength);
void encodeDoubleArray(
- List<int> value, int offset, int nullability, int expectedLength) =>
+ List<double> value, int offset, int nullability,
+ int expectedLength) =>
encodeArray((e, v) => e.appendDoubleArray(v), 8, value, offset,
nullability, expectedLength);