| 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.error_verifier; | 5 library analyzer.src.generated.error_verifier; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import "dart:math" as math; | 8 import "dart:math" as math; |
| 9 | 9 |
| 10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
| 11 import 'package:analyzer/dart/ast/token.dart'; | 11 import 'package:analyzer/dart/ast/token.dart'; |
| 12 import 'package:analyzer/dart/ast/visitor.dart'; | 12 import 'package:analyzer/dart/ast/visitor.dart'; |
| 13 import 'package:analyzer/dart/element/element.dart'; | 13 import 'package:analyzer/dart/element/element.dart'; |
| 14 import 'package:analyzer/dart/element/type.dart'; | 14 import 'package:analyzer/dart/element/type.dart'; |
| 15 import 'package:analyzer/dart/element/visitor.dart'; | 15 import 'package:analyzer/dart/element/visitor.dart'; |
| 16 import 'package:analyzer/src/dart/ast/token.dart'; | |
| 17 import 'package:analyzer/src/dart/ast/utilities.dart'; | 16 import 'package:analyzer/src/dart/ast/utilities.dart'; |
| 18 import 'package:analyzer/src/dart/element/element.dart'; | 17 import 'package:analyzer/src/dart/element/element.dart'; |
| 19 import 'package:analyzer/src/dart/element/member.dart'; | 18 import 'package:analyzer/src/dart/element/member.dart'; |
| 20 import 'package:analyzer/src/dart/element/type.dart'; | 19 import 'package:analyzer/src/dart/element/type.dart'; |
| 21 import 'package:analyzer/src/dart/resolver/inheritance_manager.dart'; | 20 import 'package:analyzer/src/dart/resolver/inheritance_manager.dart'; |
| 22 import 'package:analyzer/src/generated/constant.dart'; | 21 import 'package:analyzer/src/generated/constant.dart'; |
| 23 import 'package:analyzer/src/generated/element_resolver.dart'; | 22 import 'package:analyzer/src/generated/element_resolver.dart'; |
| 24 import 'package:analyzer/src/generated/engine.dart'; | 23 import 'package:analyzer/src/generated/engine.dart'; |
| 25 import 'package:analyzer/src/generated/error.dart'; | 24 import 'package:analyzer/src/generated/error.dart'; |
| 26 import 'package:analyzer/src/generated/java_engine.dart'; | 25 import 'package:analyzer/src/generated/java_engine.dart'; |
| (...skipping 5670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5697 for (Expression expression in args.arguments) { | 5696 for (Expression expression in args.arguments) { |
| 5698 if (expression is NamedExpression) { | 5697 if (expression is NamedExpression) { |
| 5699 if (expression.name.label.name == name) { | 5698 if (expression.name.label.name == name) { |
| 5700 return true; | 5699 return true; |
| 5701 } | 5700 } |
| 5702 } | 5701 } |
| 5703 } | 5702 } |
| 5704 return false; | 5703 return false; |
| 5705 } | 5704 } |
| 5706 | 5705 |
| 5707 bool _expressionIsAssignable( | |
| 5708 Expression expression, DartType expectedStaticType) { | |
| 5709 return _expressionIsAssignableAtType( | |
| 5710 expression, getStaticType(expression), expectedStaticType); | |
| 5711 } | |
| 5712 | |
| 5713 bool _expressionIsAssignableAtType(Expression expression, | 5706 bool _expressionIsAssignableAtType(Expression expression, |
| 5714 DartType actualStaticType, DartType expectedStaticType) { | 5707 DartType actualStaticType, DartType expectedStaticType) { |
| 5715 bool concrete = | 5708 bool concrete = |
| 5716 _options.strongMode && StaticInfo.isKnownFunction(expression); | 5709 _options.strongMode && StaticInfo.isKnownFunction(expression); |
| 5717 if (concrete) { | 5710 if (concrete) { |
| 5718 actualStaticType = | 5711 actualStaticType = |
| 5719 _typeSystem.typeToConcreteType(_typeProvider, actualStaticType); | 5712 _typeSystem.typeToConcreteType(_typeProvider, actualStaticType); |
| 5720 // TODO(leafp): Move the Downcast functionality here. | 5713 // TODO(leafp): Move the Downcast functionality here. |
| 5721 // TODO(leafp): Support strict downcasts | 5714 // TODO(leafp): Support strict downcasts |
| 5722 } | 5715 } |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6175 class _InvocationCollector extends RecursiveAstVisitor { | 6168 class _InvocationCollector extends RecursiveAstVisitor { |
| 6176 final List<String> superCalls = <String>[]; | 6169 final List<String> superCalls = <String>[]; |
| 6177 | 6170 |
| 6178 @override | 6171 @override |
| 6179 visitMethodInvocation(MethodInvocation node) { | 6172 visitMethodInvocation(MethodInvocation node) { |
| 6180 if (node.target is SuperExpression) { | 6173 if (node.target is SuperExpression) { |
| 6181 superCalls.add(node.methodName.name); | 6174 superCalls.add(node.methodName.name); |
| 6182 } | 6175 } |
| 6183 } | 6176 } |
| 6184 } | 6177 } |
| OLD | NEW |