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

enable the avoid_dynamic_calls lint #232

Merged
merged 2 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 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 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 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 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