Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[analyzer] Fix resolving target kinds
As the analyzer is shipped with the SDK, it may have to analyze sources using a newer version of package:meta than the one it was compiled with. If that new version adds a new TargetKind, attempting to resolve that constant with `TargetKind.values[index]` may cause a range error. Further, if a new TargetKind is not added at the end of that enum, the analyzer will misinterpret the constant values. This CL fixes both issues by comparing target kinds by their name. Unknown target kinds from a newer meta version are ignored since the analyzer would not be capable of analyzing them either way. Bug: 46183 Change-Id: Ibbb7063ae9939e95f846076d7fe462e222a8a5bb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201760 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
- Loading branch information