Closed plztrial4me closed 1 year ago
This works as expected.
The problem is that commandHandler
is Parent
and in the Parent
class hierarchy there is no class named Interface2
. Only child has it, but commandHandler
has no knowledge about that.
Consider adding // ignore: avoid-unrelated-type-assertions
to ignore this warning.
Environment and configuration
DCM version: 5.7.2 Dart SDK version: 2.19.6
Configuration
```yaml dart_code_metrics: metrics: cyclomatic-complexity: 20 number-of-parameters: 4 maximum-nesting-level: 5 metrics-exclude: - test/** rules: - avoid-dynamic - no-avoid-passing-async-when-sync-expected - avoid-redundant-async - avoid-unnecessary-type-assertions - avoid-unnecessary-type-casts - avoid-unrelated-type-assertions - avoid-unused-parameters - avoid-nested-conditional-expressions - newline-before-return - no-boolean-literal-compare - no-empty-block - prefer-trailing-comma - prefer-conditional-expressions - no-equal-then-else - prefer-moving-to-variable - no-prefer-match-file-name ```What did you do?
What did you expect to happen?
The result is not always FALSE. Problem 'Avoid unrelated "is" assertion. The result is always "false".' shouldn't occured.
What actually happened?
Problem 'Avoid unrelated "is" assertion. The result is always "false".' occurs in the source code below in class Manager.
if (commandHandler is Interface2) {
Participation
Additional comments
No response