Disallow implicit casts in analysis_options (#28)
diff --git a/analysis_options.yaml b/analysis_options.yaml
index 5d1b743..4a774a7 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -1,6 +1,8 @@
include: package:pedantic/analysis_options.1.9.0.yaml
analyzer:
+ strong-mode:
+ implicit-casts: false
errors:
annotate_overrides: ignore
prefer_single_quotes: ignore
diff --git a/test/typed_buffers_test.dart b/test/typed_buffers_test.dart
index ab36559..174806b 100644
--- a/test/typed_buffers_test.dart
+++ b/test/typed_buffers_test.dart
@@ -223,9 +223,9 @@
16777215.0
];
-int clampUint8(x) => x < 0 ? 0 : x > 255 ? 255 : x;
+int clampUint8(int x) => x < 0 ? 0 : x > 255 ? 255 : x;
-void doubleEqual(x, y) {
+void doubleEqual(x, num y) {
if (y.isNaN) {
expect(x.isNaN, isTrue);
} else {
@@ -233,7 +233,7 @@
}
}
-Rounder intRounder(bits) {
+Rounder intRounder(int bits) {
var highBit = 1 << (bits - 1);
var mask = highBit - 1;
return (int x) => (x & mask) - (x & highBit);
@@ -243,14 +243,14 @@
return (Float32List(1)..[0] = value)[0];
}
-void testFloat32x4Buffer(List floatSamples) {
+void testFloat32x4Buffer(List<double> floatSamples) {
var float4Samples = <Float32x4>[];
for (var i = 0; i < floatSamples.length - 3; i++) {
float4Samples.add(Float32x4(floatSamples[i], floatSamples[i + 1],
floatSamples[i + 2], floatSamples[i + 3]));
}
- void floatEquals(x, y) {
+ void floatEquals(x, num y) {
if (y.isNaN) {
expect(x.isNaN, isTrue);
} else {
@@ -535,7 +535,7 @@
}, testOn: testOn);
}
-Rounder uintRounder(bits) {
+Rounder uintRounder(int bits) {
var halfbits = (1 << (bits ~/ 2)) - 1;
var mask = halfbits | (halfbits << (bits ~/ 2));
return (int x) => x & mask;
@@ -551,12 +551,10 @@
Description describe(Description description) =>
description.add('Int32x4.==');
- bool matches(item, Map matchState) {
- if (item is! Int32x4) return false;
- Int32x4 value = item;
- return result.x == value.x &&
- result.y == value.y &&
- result.z == value.z &&
- result.w == value.w;
- }
+ bool matches(item, Map matchState) =>
+ item is Int32x4 &&
+ result.x == item.x &&
+ result.y == item.y &&
+ result.z == item.z &&
+ result.w == item.w;
}