Analyzer shows warning of use_late_for_private_fields_and_variables in wrong file when part and part of are used #2921
Labels
false-negative
false-positive
P3
A lower priority bug or feature request
set-none
Does not affect any rules in a defined rule set (e.g., core, recommended, flutter)
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
The analyzer shows a warning of the
use_late_for_private_fields_and_variables
lint in wrong file whenpart
andpart of
are used.Steps to reproduce
dart create use_late_bug
analysis_options.yaml
file:foo.dart
inbin
with the content:bar.dart
inbin
with the content:dart analyze
. The output is:Expected Result
The warning for the lint
use_late_for_private_fields_and_variables
should be shown in the filefoo.dart
on the field_s
.Actual Result
The warning for the lint
use_late_for_private_fields_and_variables
is shown in the filebar.dart
by the print.Notably the warning is shown at index 46 of the
bar.dart
file and the field_s
is also defined at index 46 in a string containing thefoo.dart
file.So the warning is shown at the correct place, just in the wrong file.
Output of
dart --version
:Dart SDK version: 2.14.0-301.0.dev (dev) (Sat Jul 10 17:56:59 2021 -0700) on "linux_x64"
The text was updated successfully, but these errors were encountered: