Skip to content

Commit

Permalink
Update logic to account for num type
Browse files Browse the repository at this point in the history
  • Loading branch information
greglittlefield-wf committed Jun 21, 2024
1 parent 1de780d commit 48b7b4b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/analyzer_plugin/lib/src/diagnostic/bad_key.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ class BadKeyDiagnostic extends ComponentUsageDiagnosticContributor {
getTypeContextString() =>
type == topLevelKeyType ? '' : ' (from ${topLevelKeyType.getDisplayString(withNullability: false)})';

if (type.isDartCoreInt || type.isDartCoreDouble || type.isDartCoreString || type.isDartCoreSymbol) {
if (type.isDartCoreNum ||
type.isDartCoreInt ||
type.isDartCoreDouble ||
type.isDartCoreString ||
type.isDartCoreSymbol) {
// Ignore core types that have good `Object.toString` implementations values.
} else if (type.isDartCoreObject || type.isDynamic) {
collector.addError(
Expand Down

0 comments on commit 48b7b4b

Please sign in to comment.