| Index: pkg/analyzer/lib/src/generated/error_verifier.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
|
| index 0d6ecf83ff5ee7a4c3b5e83705b724de0a531009..52f6f9cd2bdc01c9eda30d7dd238585d5440a571 100644
|
| --- a/pkg/analyzer/lib/src/generated/error_verifier.dart
|
| +++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
|
| @@ -8,6 +8,7 @@ import 'dart:collection';
|
| import "dart:math" as math;
|
|
|
| import 'package:analyzer/dart/ast/ast.dart';
|
| +import 'package:analyzer/dart/ast/resolution_accessors.dart';
|
| import 'package:analyzer/dart/ast/token.dart';
|
| import 'package:analyzer/dart/ast/visitor.dart';
|
| import 'package:analyzer/dart/element/element.dart';
|
| @@ -857,7 +858,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| // we can get the function element via `node?.element?.type?.element` but
|
| // it doesn't have hasImplicitReturnType set correctly.
|
| if (!_options.implicitDynamic && node.returnType == null) {
|
| - DartType parameterType = node.element.type;
|
| + DartType parameterType = elementForFormalParameter(node).type;
|
| if (parameterType is FunctionType &&
|
| parameterType.returnType.isDynamic) {
|
| _errorReporter.reportErrorForNode(
|
| @@ -2238,7 +2239,8 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| DartType redirectedReturnType = redirectedType.returnType;
|
|
|
| // Report specific problem when return type is incompatible
|
| - FunctionType constructorType = declaration.element.type;
|
| + FunctionType constructorType =
|
| + elementForConstructorDeclaration(declaration).type;
|
| DartType constructorReturnType = constructorType.returnType;
|
| if (!_typeSystem.isAssignableTo(
|
| redirectedReturnType, constructorReturnType)) {
|
| @@ -2893,7 +2895,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| ClassMember conflictingSetter = memberHashMap[setterName];
|
| if (conflictingSetter != null) {
|
| enclosingElementOfSetter =
|
| - conflictingSetter.element.enclosingElement;
|
| + elementForDeclaration(conflictingSetter).enclosingElement;
|
| } else {
|
| ExecutableElement elementFromInheritance = _inheritanceManager
|
| .lookupInheritance(_enclosingClass, setterName);
|
| @@ -4733,7 +4735,7 @@ class ErrorVerifier extends RecursiveAstVisitor<Object> {
|
| }
|
|
|
| void _checkForMissingJSLibAnnotation(Annotation node) {
|
| - if (node.elementAnnotation?.isJS ?? false) {
|
| + if (elementAnnotationForAnnotation(node)?.isJS ?? false) {
|
| if (_currentLibrary.isJS != true) {
|
| _errorReporter.reportErrorForNode(
|
| HintCode.MISSING_JS_LIB_ANNOTATION, node);
|
| @@ -6898,7 +6900,9 @@ class RequiredConstantsComputer extends RecursiveAstVisitor {
|
| DartType type = node.constructorName.type.type;
|
| if (type is InterfaceType) {
|
| _checkForMissingRequiredParam(
|
| - node.staticElement?.type, node.argumentList, node.constructorName);
|
| + staticElementForConstructorReference(node)?.type,
|
| + node.argumentList,
|
| + node.constructorName);
|
| }
|
| return super.visitInstanceCreationExpression(node);
|
| }
|
| @@ -6913,7 +6917,7 @@ class RequiredConstantsComputer extends RecursiveAstVisitor {
|
| @override
|
| Object visitRedirectingConstructorInvocation(
|
| RedirectingConstructorInvocation node) {
|
| - DartType type = node.staticElement?.type;
|
| + DartType type = staticElementForConstructorReference(node)?.type;
|
| if (type != null) {
|
| _checkForMissingRequiredParam(type, node.argumentList, node);
|
| }
|
| @@ -6922,7 +6926,7 @@ class RequiredConstantsComputer extends RecursiveAstVisitor {
|
|
|
| @override
|
| Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
|
| - DartType type = node.staticElement?.type;
|
| + DartType type = staticElementForConstructorReference(node)?.type;
|
| if (type != null) {
|
| _checkForMissingRequiredParam(type, node.argumentList, node);
|
| }
|
|
|