| 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'; |
| (...skipping 3981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3992 } | 3992 } |
| 3993 | 3993 |
| 3994 void _checkForImplicitDynamicInvoke(InvocationExpression node) { | 3994 void _checkForImplicitDynamicInvoke(InvocationExpression node) { |
| 3995 if (_options.implicitDynamic || | 3995 if (_options.implicitDynamic || |
| 3996 node == null || | 3996 node == null || |
| 3997 node.typeArguments != null) { | 3997 node.typeArguments != null) { |
| 3998 return; | 3998 return; |
| 3999 } | 3999 } |
| 4000 DartType invokeType = node.staticInvokeType; | 4000 DartType invokeType = node.staticInvokeType; |
| 4001 DartType declaredType = node.function.staticType; | 4001 DartType declaredType = node.function.staticType; |
| 4002 if (invokeType is FunctionType && declaredType is FunctionType) { | 4002 if (invokeType is FunctionType && |
| 4003 declaredType is FunctionType && |
| 4004 declaredType.typeFormals.isNotEmpty) { |
| 4003 Iterable<DartType> typeArgs = | 4005 Iterable<DartType> typeArgs = |
| 4004 FunctionTypeImpl.recoverTypeArguments(declaredType, invokeType); | 4006 FunctionTypeImpl.recoverTypeArguments(declaredType, invokeType); |
| 4005 if (typeArgs.any((t) => t.isDynamic)) { | 4007 if (typeArgs.any((t) => t.isDynamic)) { |
| 4006 // Issue an error depending on what we're trying to call. | 4008 // Issue an error depending on what we're trying to call. |
| 4007 Expression function = node.function; | 4009 Expression function = node.function; |
| 4008 if (function is Identifier) { | 4010 if (function is Identifier) { |
| 4009 Element element = function.staticElement; | 4011 Element element = function.staticElement; |
| 4010 if (element is MethodElement) { | 4012 if (element is MethodElement) { |
| 4011 _errorReporter.reportErrorForNode( | 4013 _errorReporter.reportErrorForNode( |
| 4012 StrongModeCode.IMPLICIT_DYNAMIC_METHOD, | 4014 StrongModeCode.IMPLICIT_DYNAMIC_METHOD, |
| (...skipping 3050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7063 class _InvocationCollector extends RecursiveAstVisitor { | 7065 class _InvocationCollector extends RecursiveAstVisitor { |
| 7064 final List<String> superCalls = <String>[]; | 7066 final List<String> superCalls = <String>[]; |
| 7065 | 7067 |
| 7066 @override | 7068 @override |
| 7067 visitMethodInvocation(MethodInvocation node) { | 7069 visitMethodInvocation(MethodInvocation node) { |
| 7068 if (node.target is SuperExpression) { | 7070 if (node.target is SuperExpression) { |
| 7069 superCalls.add(node.methodName.name); | 7071 superCalls.add(node.methodName.name); |
| 7070 } | 7072 } |
| 7071 } | 7073 } |
| 7072 } | 7074 } |
| OLD | NEW |