Fix parameter types for compareTo().
Also adding a CHANGELOG and analysis_options since it's strong mode
clean now.
R=cbracken@google.com, leafp@google.com
Review URL: https://codereview.chromium.org//1963283002 .
diff --git a/.analysis_options b/.analysis_options
new file mode 100644
index 0000000..a10d4c5
--- /dev/null
+++ b/.analysis_options
@@ -0,0 +1,2 @@
+analyzer:
+ strong-mode: true
diff --git a/.gitignore b/.gitignore
index bda251a..0dceb6e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,5 @@
.pub
build
packages
+.packages
pubspec.lock
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..9ec23ff
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,5 @@
+## 0.10.5
+
+* Fix strong mode warning in overridden `compareTo()` methods.
+
+*No changelog entries for previous versions...*
diff --git a/lib/src/int32.dart b/lib/src/int32.dart
index c5996f8..786f2bb 100644
--- a/lib/src/int32.dart
+++ b/lib/src/int32.dart
@@ -287,7 +287,7 @@
return false;
}
- int compareTo(Comparable other) {
+ int compareTo(other) {
if (other is Int64) {
return this.toInt64().compareTo(other);
}
diff --git a/lib/src/int64.dart b/lib/src/int64.dart
index 2ff4822..b7127ee 100644
--- a/lib/src/int64.dart
+++ b/lib/src/int64.dart
@@ -458,7 +458,7 @@
return false;
}
- int compareTo(Comparable other) =>_compareTo(other);
+ int compareTo(other) => _compareTo(other);
int _compareTo(other) {
Int64 o = _promote(other);
diff --git a/lib/src/intx.dart b/lib/src/intx.dart
index b47a35e..6b4a454 100644
--- a/lib/src/intx.dart
+++ b/lib/src/intx.dart
@@ -7,7 +7,7 @@
/**
* A fixed-precision integer.
*/
-abstract class IntX implements Comparable {
+abstract class IntX implements Comparable<dynamic> {
/** Addition operator. */
IntX operator +(other);
@@ -80,7 +80,7 @@
*/
IntX shiftRightUnsigned(int shiftAmount);
- int compareTo(Comparable other);
+ int compareTo(other);
/**
* Returns `true` if and only if [other] is an int or IntX equal in
diff --git a/pubspec.yaml b/pubspec.yaml
index 99f990e..96ccfa0 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: fixnum
-version: 0.10.4
+version: 0.10.5
author: Dart Team <misc@dartlang.org>
description: Library for 32- and 64-bit signed fixed-width integers.
homepage: https://github.com/dart-lang/fixnum