| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.generated.resolver; | 5 library analyzer.src.generated.resolver; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| (...skipping 3082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3093 Block enclosingBlock = node.getAncestor((node) => node is Block); | 3093 Block enclosingBlock = node.getAncestor((node) => node is Block); |
| 3094 if (enclosingBlock != null) { | 3094 if (enclosingBlock != null) { |
| 3095 int functionEnd = node.offset + node.length; | 3095 int functionEnd = node.offset + node.length; |
| 3096 int blockEnd = enclosingBlock.offset + enclosingBlock.length; | 3096 int blockEnd = enclosingBlock.offset + enclosingBlock.length; |
| 3097 element.setVisibleRange(functionEnd, blockEnd - functionEnd - 1); | 3097 element.setVisibleRange(functionEnd, blockEnd - functionEnd - 1); |
| 3098 } | 3098 } |
| 3099 } | 3099 } |
| 3100 if (_functionTypesToFix != null) { | 3100 if (_functionTypesToFix != null) { |
| 3101 _functionTypesToFix.add(element); | 3101 _functionTypesToFix.add(element); |
| 3102 } else { | 3102 } else { |
| 3103 // TODO(jmesserly): for local functions inside of top-level generic | |
| 3104 // functions, this is probably not right. The function type should be set | |
| 3105 // after the enclosingElement is set, otherwise we won't be able to | |
| 3106 // substitute those type parameters later. | |
| 3107 element.type = new FunctionTypeImpl(element); | 3103 element.type = new FunctionTypeImpl(element); |
| 3108 } | 3104 } |
| 3109 element.hasImplicitReturnType = true; | 3105 element.hasImplicitReturnType = true; |
| 3110 _currentHolder.addFunction(element); | 3106 _currentHolder.addFunction(element); |
| 3111 node.element = element; | 3107 node.element = element; |
| 3112 holder.validate(); | 3108 holder.validate(); |
| 3113 return null; | 3109 return null; |
| 3114 } | 3110 } |
| 3115 | 3111 |
| 3116 @override | 3112 @override |
| (...skipping 10440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13557 nonFields.add(node); | 13553 nonFields.add(node); |
| 13558 return null; | 13554 return null; |
| 13559 } | 13555 } |
| 13560 | 13556 |
| 13561 @override | 13557 @override |
| 13562 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); | 13558 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); |
| 13563 | 13559 |
| 13564 @override | 13560 @override |
| 13565 Object visitWithClause(WithClause node) => null; | 13561 Object visitWithClause(WithClause node) => null; |
| 13566 } | 13562 } |
| OLD | NEW |