Skip to content

Commit

Permalink
Resolve some strong-mode warnings encountered in IntelliJ
Browse files Browse the repository at this point in the history
  • Loading branch information
Matan Lurey committed Nov 15, 2016
1 parent 1774da0 commit d9ea1ce
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkgs/collection/test/canonicalized_map_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void main() {
var map;
setUp(() {
map = new CanonicalizedMap<int, String, String>(int.parse,
isValidKey: new RegExp(r"^\d+$").hasMatch);
isValidKey: (s) => new RegExp(r"^\d+$").hasMatch(s));
});

test("canonicalizes keys on set and get", () {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/collection/test/comparators_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void main() {
// This will sort alphabetically (by charcode) the way digits sort
// numerically, and the leading 0 means it sorts like a digit
// compared to non-digits.
replaceNumbers(string) => string.replaceAllMapped(new RegExp(r"\d+"), (m) {
replaceNumbers(String string) => string.replaceAllMapped(new RegExp(r"\d+"), (m) {
var digits = m[0];
return new String.fromCharCodes([0x30, int.parse(digits), digits.length]);
});
Expand Down
2 changes: 1 addition & 1 deletion pkgs/collection/test/priority_queue_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void testQueueBody(PriorityQueue create(), List elements, notElement) {
int compare(C c1, C c2) => c1.value - c2.value;
int compareNeg(C c1, C c2) => c2.value - c1.value;

class C implements Comparable {
class C implements Comparable<C> {
final int value;
const C(this.value);
int get hashCode => value;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/collection/test/queue_list_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void main() {

group("[]=", () {
test("sets individual entries in the queue", () {
var queue = new QueueList.from([1, 2, 3]);
var queue = new QueueList<dynamic>.from([1, 2, 3]);
queue[0] = "a";
queue[1] = "b";
queue[2] = "c";
Expand Down
2 changes: 0 additions & 2 deletions pkgs/collection/test/typed_wrapper/set_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ import '../utils.dart';
void main() {
group("with valid types, forwards", () {
var wrapper;
var emptyWrapper;
setUp(() {
wrapper = DelegatingSet.typed/*<int>*/(
new Set<Object>.from([1, 2, 3, 4, 5]));
emptyWrapper = DelegatingSet.typed/*<int>*/(new Set<Object>());
});

test("add()", () {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/collection/test/union_set_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void main() {
group("after an inner set was modified", () {
var set;
setUp(() {
var innerSet = new Set.from([3, 7]);
var innerSet = new Set<int>.from([3, 7]);
set = new UnionSet<int>.from([
new Set.from([1, 2]),
new Set.from([5]),
Expand Down Expand Up @@ -179,7 +179,7 @@ void main() {
var set;
setUp(() {
var innerSet = new Set.from([6]);
var outerSet = new Set.from([
var outerSet = new Set<Set<int>>.from([
new Set.from([1, 2]),
new Set.from([5]),
innerSet
Expand Down
2 changes: 1 addition & 1 deletion pkgs/collection/test/wrapper_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class SyntheticInvocation implements Invocation {
static const int SETTER = 0x02;
final Symbol memberName;
final List positionalArguments;
final Map namedArguments;
final Map<Symbol, dynamic> namedArguments;
final int _type;
const SyntheticInvocation(this.memberName,
this.positionalArguments,
Expand Down

0 comments on commit d9ea1ce

Please sign in to comment.