Skip to content

Commit

Permalink
enable the avoid_dynamic_calls lint (dart-archive/collection#232)
Browse files Browse the repository at this point in the history
enable the avoid_dynamic_calls lint
  • Loading branch information
devoncarew authored Feb 18, 2022
1 parent 3c3f34e commit 4d6899b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkgs/collection/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Assignment to `Equality` with a nullable type is still allowed because of
covariance. The `equals` and `hash` methods continue to accept nullable
arguments.

* Enable the `avoid_dynamic_calls` lint.

## 1.15.0

Expand Down
3 changes: 3 additions & 0 deletions pkgs/collection/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
include: package:lints/recommended.yaml

linter:
rules:
- avoid_dynamic_calls

# Errors
- test_types_in_equals
- throw_in_finally
Expand Down
2 changes: 1 addition & 1 deletion pkgs/collection/lib/src/equality.dart
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ abstract class _UnorderedEquality<E, T extends Iterable<E>>
bool equals(T? elements1, T? elements2) {
if (identical(elements1, elements2)) return true;
if (elements1 == null || elements2 == null) return false;
var counts = HashMap(
var counts = HashMap<E, int>(
equals: _elementEquality.equals,
hashCode: _elementEquality.hash,
isValidKey: _elementEquality.isValidKey);
Expand Down
6 changes: 6 additions & 0 deletions pkgs/collection/test/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include: ../analysis_options.yaml

# Turn off the avoid_dynamic_calls lint for the test/ directory.
analyzer:
errors:
avoid_dynamic_calls: ignore

0 comments on commit 4d6899b

Please sign in to comment.