Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: pkg/analyzer/lib/src/generated/error_verifier.dart

Issue 2734943002: More support for generic function types (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 } 1396 }
1397 } 1397 }
1398 } 1398 }
1399 1399
1400 /** 1400 /**
1401 * Check that all of the parameters have unique names. 1401 * Check that all of the parameters have unique names.
1402 */ 1402 */
1403 void _checkDuplicateDefinitionInParameterList(FormalParameterList node) { 1403 void _checkDuplicateDefinitionInParameterList(FormalParameterList node) {
1404 Map<String, Element> definedNames = new HashMap<String, Element>(); 1404 Map<String, Element> definedNames = new HashMap<String, Element>();
1405 for (FormalParameter parameter in node.parameters) { 1405 for (FormalParameter parameter in node.parameters) {
1406 _checkDuplicateIdentifier(definedNames, parameter.identifier); 1406 SimpleIdentifier identifier = parameter.identifier;
1407 if (identifier != null) {
1408 // The identifier can be null if this is a parameter list for a generic
1409 // function type.
1410 _checkDuplicateIdentifier(definedNames, identifier);
1411 }
1407 } 1412 }
1408 } 1413 }
1409 1414
1410 /** 1415 /**
1411 * Check that all of the parameters have unique names. 1416 * Check that all of the parameters have unique names.
1412 */ 1417 */
1413 void _checkDuplicateDefinitionInTypeParameterList(TypeParameterList node) { 1418 void _checkDuplicateDefinitionInTypeParameterList(TypeParameterList node) {
1414 Map<String, Element> definedNames = new HashMap<String, Element>(); 1419 Map<String, Element> definedNames = new HashMap<String, Element>();
1415 for (TypeParameter parameter in node.typeParameters) { 1420 for (TypeParameter parameter in node.typeParameters) {
1416 _checkDuplicateIdentifier(definedNames, parameter.name); 1421 _checkDuplicateIdentifier(definedNames, parameter.name);
(...skipping 5664 matching lines...) Expand 10 before | Expand all | Expand 10 after
7081 class _InvocationCollector extends RecursiveAstVisitor { 7086 class _InvocationCollector extends RecursiveAstVisitor {
7082 final List<String> superCalls = <String>[]; 7087 final List<String> superCalls = <String>[];
7083 7088
7084 @override 7089 @override
7085 visitMethodInvocation(MethodInvocation node) { 7090 visitMethodInvocation(MethodInvocation node) {
7086 if (node.target is SuperExpression) { 7091 if (node.target is SuperExpression) {
7087 superCalls.add(node.methodName.name); 7092 superCalls.add(node.methodName.name);
7088 } 7093 }
7089 } 7094 }
7090 } 7095 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698