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

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

Issue 2659403002: Fix hints and warnings. (Closed)
Patch Set: Rebased on e4c8a99f67f6846dffae69d1f4c745f1085d2680. Created 3 years, 10 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/summary_sdk.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2568 matching lines...) Expand 10 before | Expand all | Expand 10 after
2579 StaticWarningCode.ASSIGNMENT_TO_TYPE, expression); 2579 StaticWarningCode.ASSIGNMENT_TO_TYPE, expression);
2580 } 2580 }
2581 } 2581 }
2582 2582
2583 /** 2583 /**
2584 * Verifies that the class is not named `Function` and that it doesn't 2584 * Verifies that the class is not named `Function` and that it doesn't
2585 * extends/implements/mixes in `Function`. 2585 * extends/implements/mixes in `Function`.
2586 */ 2586 */
2587 void _checkForBadFunctionUse(ClassDeclaration node) { 2587 void _checkForBadFunctionUse(ClassDeclaration node) {
2588 ExtendsClause extendsClause = node.extendsClause; 2588 ExtendsClause extendsClause = node.extendsClause;
2589 ImplementsClause implementsClause = node.implementsClause;
2590 WithClause withClause = node.withClause; 2589 WithClause withClause = node.withClause;
2591 2590
2592 if (node.name.name == "Function") { 2591 if (node.name.name == "Function") {
2593 _errorReporter.reportErrorForNode( 2592 _errorReporter.reportErrorForNode(
2594 HintCode.DEPRECATED_FUNCTION_CLASS_DECLARATION, node.name); 2593 HintCode.DEPRECATED_FUNCTION_CLASS_DECLARATION, node.name);
2595 } 2594 }
2596 2595
2597 if (extendsClause != null) { 2596 if (extendsClause != null) {
2598 InterfaceType superclassType = _enclosingClass.supertype; 2597 InterfaceType superclassType = _enclosingClass.supertype;
2599 ClassElement superclassElement = superclassType?.element; 2598 ClassElement superclassElement = superclassType?.element;
(...skipping 4478 matching lines...) Expand 10 before | Expand all | Expand 10 after
7078 class _InvocationCollector extends RecursiveAstVisitor { 7077 class _InvocationCollector extends RecursiveAstVisitor {
7079 final List<String> superCalls = <String>[]; 7078 final List<String> superCalls = <String>[];
7080 7079
7081 @override 7080 @override
7082 visitMethodInvocation(MethodInvocation node) { 7081 visitMethodInvocation(MethodInvocation node) {
7083 if (node.target is SuperExpression) { 7082 if (node.target is SuperExpression) {
7084 superCalls.add(node.methodName.name); 7083 superCalls.add(node.methodName.name);
7085 } 7084 }
7086 } 7085 }
7087 } 7086 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/summary/summary_sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698