Ignore unnecessary_cast hint.

The cast is no longer needed due to the class hierarchy changes in
https://dart-review.googlesource.com/c/sdk/+/89923.  But we don't want
to remove it yet, because we don't want to unnecessarily make the
analyzer_plugin to depend on the very latest analyzer.  So for now we
ignore the hint.

Change-Id: Ic5314181cd78d72e5c9b1d00f38302773f0a789c
Reviewed-on: https://dart-review.googlesource.com/c/90101
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Paul Berry 2019-01-17 19:52:56 +00:00 committed by commit-bot@chromium.org
parent 3513f872ce
commit f353719b08

View file

@ -816,7 +816,12 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor {
AstNode grandparent = node.parent.parent;
if (grandparent is ConstructorReferenceNode) {
ConstructorElement element =
(grandparent as ConstructorReferenceNode).staticElement;
// TODO(paulberry): remove the unnecessary cast when we are ready to
// depend on a version of the analyzer that includes
// https://dart-review.googlesource.com/c/sdk/+/89923
(grandparent // ignore: unnecessary_cast
as ConstructorReferenceNode)
.staticElement;
if (element != null) {
List<ParameterElement> parameters = element.parameters;
ParameterElement parameterElement = parameters.firstWhere((e) {