Replace TypeName with NamedType in analyzer_plugin/, where possible.

Change-Id: I979e904fc54fef6dfc42cb999ac72fefb669f462
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214123
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Konstantin Shcheglov 2021-09-22 01:26:21 +00:00
parent 6fc5d5956d
commit b8877d1f5a
2 changed files with 2 additions and 2 deletions

View file

@ -1120,7 +1120,7 @@ class _OpTypeAstVisitor extends GeneralizingAstVisitor<void> {
return;
}
optype.isPrefixed = true;
if (node.parent is TypeName && node.parent?.parent is ConstructorName) {
if (node.parent is NamedType && node.parent?.parent is ConstructorName) {
optype.includeConstructorSuggestions = true;
} else if (node.parent is Annotation) {
optype.includeConstructorSuggestions = true;

View file

@ -12,7 +12,7 @@ import 'package:analyzer/src/dart/ast/token.dart';
/// declarations in those nodes. Consumers typically call [visit] which catches
/// the exception thrown by [finished].
abstract class LocalDeclarationVisitor extends GeneralizingAstVisitor {
static final TypeName STACKTRACE_TYPE = astFactory.typeName(
static final NamedType STACKTRACE_TYPE = astFactory.typeName(
astFactory
.simpleIdentifier(StringToken(TokenType.IDENTIFIER, 'StackTrace', 0)),
null);