| Index: pkg/analyzer/lib/src/task/dart.dart
|
| diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
|
| index 9e3b31e89627c2f6853b84e7a9dce96dc7be634b..9d9a8ee6571f8cf26baacae4714ca1b58868c4f8 100644
|
| --- a/pkg/analyzer/lib/src/task/dart.dart
|
| +++ b/pkg/analyzer/lib/src/task/dart.dart
|
| @@ -7,6 +7,7 @@ library analyzer.src.task.dart;
|
| import 'dart:collection';
|
|
|
| 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';
|
| @@ -1328,7 +1329,8 @@ class BuildEnumMemberElementsTask extends SourceBasedAnalysisTask {
|
| }
|
|
|
| EnumDeclaration firstEnum = findFirstEnum();
|
| - if (firstEnum != null && firstEnum.element.accessors.isEmpty) {
|
| + if (firstEnum != null &&
|
| + elementForEnumDeclaration(firstEnum).accessors.isEmpty) {
|
| EnumMemberBuilder builder = new EnumMemberBuilder(typeProvider);
|
| unit.accept(builder);
|
| }
|
| @@ -1503,7 +1505,7 @@ class BuildLibraryElementTask extends SourceBasedAnalysisTask {
|
| int partLength = partUnits.length;
|
| for (int i = 0; i < partLength; i++) {
|
| CompilationUnit partUnit = partUnits[i];
|
| - Source partSource = partUnit.element.source;
|
| + Source partSource = elementForCompilationUnit(partUnit).source;
|
| partUnitMap[partSource] = partUnit;
|
| }
|
| //
|
| @@ -3445,8 +3447,8 @@ class InferInstanceMembersInUnitTask extends SourceBasedAnalysisTask {
|
| // Infer instance members.
|
| //
|
| if (context.analysisOptions.strongMode) {
|
| - InstanceMemberInferrer inferrer = new InstanceMemberInferrer(
|
| - typeProvider, new InheritanceManager(unit.element.library),
|
| + InstanceMemberInferrer inferrer = new InstanceMemberInferrer(typeProvider,
|
| + new InheritanceManager(elementForCompilationUnit(unit).library),
|
| typeSystem: context.typeSystem);
|
| inferrer.inferCompilationUnit(unit.element);
|
| }
|
| @@ -3511,7 +3513,7 @@ abstract class InferStaticVariableTask extends ConstantEvaluationAnalysisTask {
|
| AstNode node = new NodeLocator2(offset).searchWithin(unit);
|
| if (node == null) {
|
| Source variableSource = variable.source;
|
| - Source unitSource = unit.element.source;
|
| + Source unitSource = elementForCompilationUnit(unit).source;
|
| if (variableSource != unitSource) {
|
| throw new AnalysisException(
|
| "Failed to find the AST node for the variable "
|
| @@ -3526,7 +3528,7 @@ abstract class InferStaticVariableTask extends ConstantEvaluationAnalysisTask {
|
| node.getAncestor((AstNode ancestor) => ancestor is VariableDeclaration);
|
| if (declaration == null || declaration.name != node) {
|
| Source variableSource = variable.source;
|
| - Source unitSource = unit.element.source;
|
| + Source unitSource = elementForCompilationUnit(unit).source;
|
| if (variableSource != unitSource) {
|
| if (declaration == null) {
|
| throw new AnalysisException(
|
|
|