OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer.src.task.dart; | 5 library analyzer.src.task.dart; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
(...skipping 3746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3757 Expression initializer = declaration.initializer; | 3757 Expression initializer = declaration.initializer; |
3758 | 3758 |
3759 DartType newType; | 3759 DartType newType; |
3760 if (!isValidForTypeInference(initializer)) { | 3760 if (!isValidForTypeInference(initializer)) { |
3761 newType = typeProvider.dynamicType; | 3761 newType = typeProvider.dynamicType; |
3762 } else { | 3762 } else { |
3763 ResolutionContext resolutionContext = | 3763 ResolutionContext resolutionContext = |
3764 ResolutionContextBuilder.contextFor(initializer); | 3764 ResolutionContextBuilder.contextFor(initializer); |
3765 ResolverVisitor visitor = new ResolverVisitor( | 3765 ResolverVisitor visitor = new ResolverVisitor( |
3766 variable.library, variable.source, typeProvider, errorListener, | 3766 variable.library, variable.source, typeProvider, errorListener, |
3767 nameScope: resolutionContext.scope, isTopLevelInference: true); | 3767 nameScope: resolutionContext.scope); |
3768 if (resolutionContext.enclosingClassDeclaration != null) { | 3768 if (resolutionContext.enclosingClassDeclaration != null) { |
3769 visitor.prepareToResolveMembersInClass( | 3769 visitor.prepareToResolveMembersInClass( |
3770 resolutionContext.enclosingClassDeclaration); | 3770 resolutionContext.enclosingClassDeclaration); |
3771 } | 3771 } |
3772 visitor.initForIncrementalResolution(); | 3772 visitor.initForIncrementalResolution(); |
3773 initializer.accept(visitor); | 3773 initializer.accept(visitor); |
3774 newType = initializer.staticType; | 3774 newType = initializer.staticType; |
3775 if (newType == null || newType.isBottom || newType.isDartCoreNull) { | 3775 if (newType == null || newType.isBottom || newType.isDartCoreNull) { |
3776 newType = typeProvider.dynamicType; | 3776 newType = typeProvider.dynamicType; |
3777 } | 3777 } |
(...skipping 2809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6587 | 6587 |
6588 @override | 6588 @override |
6589 bool moveNext() { | 6589 bool moveNext() { |
6590 if (_newSources.isEmpty) { | 6590 if (_newSources.isEmpty) { |
6591 return false; | 6591 return false; |
6592 } | 6592 } |
6593 currentTarget = _newSources.removeLast(); | 6593 currentTarget = _newSources.removeLast(); |
6594 return true; | 6594 return true; |
6595 } | 6595 } |
6596 } | 6596 } |
OLD | NEW |