| 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.element_resolver; | 5 library analyzer.src.generated.element_resolver; |
| 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/syntactic_entity.dart'; | 10 import 'package:analyzer/dart/ast/syntactic_entity.dart'; |
| (...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1568 | 1568 |
| 1569 /** | 1569 /** |
| 1570 * Check for a generic method & apply type arguments if any were passed. | 1570 * Check for a generic method & apply type arguments if any were passed. |
| 1571 */ | 1571 */ |
| 1572 DartType _instantiateGenericMethod( | 1572 DartType _instantiateGenericMethod( |
| 1573 DartType invokeType, TypeArgumentList typeArguments, AstNode node) { | 1573 DartType invokeType, TypeArgumentList typeArguments, AstNode node) { |
| 1574 // TODO(jmesserly): support generic "call" methods on InterfaceType. | 1574 // TODO(jmesserly): support generic "call" methods on InterfaceType. |
| 1575 if (invokeType is FunctionType) { | 1575 if (invokeType is FunctionType) { |
| 1576 List<TypeParameterElement> parameters = invokeType.typeFormals; | 1576 List<TypeParameterElement> parameters = invokeType.typeFormals; |
| 1577 | 1577 |
| 1578 NodeList<TypeName> arguments = typeArguments?.arguments; | 1578 NodeList<TypeAnnotation> arguments = typeArguments?.arguments; |
| 1579 if (arguments != null && arguments.length != parameters.length) { | 1579 if (arguments != null && arguments.length != parameters.length) { |
| 1580 if (_resolver.strongMode) { | 1580 if (_resolver.strongMode) { |
| 1581 _resolver.errorReporter.reportErrorForNode( | 1581 _resolver.errorReporter.reportErrorForNode( |
| 1582 StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, | 1582 StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, |
| 1583 node, | 1583 node, |
| 1584 [invokeType, parameters.length, arguments?.length ?? 0]); | 1584 [invokeType, parameters.length, arguments?.length ?? 0]); |
| 1585 } else { | 1585 } else { |
| 1586 _resolver.errorReporter.reportErrorForNode( | 1586 _resolver.errorReporter.reportErrorForNode( |
| 1587 HintCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, | 1587 HintCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS_METHOD, |
| 1588 node, | 1588 node, |
| (...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2645 | 2645 |
| 2646 @override | 2646 @override |
| 2647 Element get staticElement => null; | 2647 Element get staticElement => null; |
| 2648 | 2648 |
| 2649 @override | 2649 @override |
| 2650 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => null; | 2650 dynamic/*=E*/ accept/*<E>*/(AstVisitor/*<E>*/ visitor) => null; |
| 2651 | 2651 |
| 2652 @override | 2652 @override |
| 2653 void visitChildren(AstVisitor visitor) {} | 2653 void visitChildren(AstVisitor visitor) {} |
| 2654 } | 2654 } |
| OLD | NEW |