Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Fix parameter types for compareTo().
Browse files Browse the repository at this point in the history
Also adding a CHANGELOG and analysis_options since it's strong mode
clean now.

[email protected], [email protected]

Review URL: https://codereview.chromium.org//1963283002 .
  • Loading branch information
munificent committed May 10, 2016
1 parent b212014 commit 2d95f7d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .analysis_options
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
analyzer:
strong-mode: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
.pub
build
packages
.packages
pubspec.lock
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 0.10.5

* Fix strong mode warning in overridden `compareTo()` methods.

*No changelog entries for previous versions...*
2 changes: 1 addition & 1 deletion lib/src/int32.dart
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ class Int32 implements IntX {
return false;
}

int compareTo(Comparable other) {
int compareTo(other) {
if (other is Int64) {
return this.toInt64().compareTo(other);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/int64.dart
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ class Int64 implements IntX {
return false;
}

int compareTo(Comparable other) =>_compareTo(other);
int compareTo(other) => _compareTo(other);

int _compareTo(other) {
Int64 o = _promote(other);
Expand Down
4 changes: 2 additions & 2 deletions lib/src/intx.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ part of fixnum;
/**
* A fixed-precision integer.
*/
abstract class IntX implements Comparable {
abstract class IntX implements Comparable<dynamic> {

/** Addition operator. */
IntX operator +(other);
Expand Down Expand Up @@ -80,7 +80,7 @@ abstract class IntX implements Comparable {
*/
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
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: fixnum
version: 0.10.4
version: 0.10.5
author: Dart Team <[email protected]>
description: Library for 32- and 64-bit signed fixed-width integers.
homepage: https://github.com/dart-lang/fixnum
Expand Down

0 comments on commit 2d95f7d

Please sign in to comment.