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

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

Issue 1769253002: Fix cycle in override check. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | 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 5784 matching lines...) Expand 10 before | Expand all | Expand 10 after
5795 DartType staticReturnType = getStaticType(returnExpression); 5795 DartType staticReturnType = getStaticType(returnExpression);
5796 if (staticReturnType != null && _enclosingFunction.isAsynchronous) { 5796 if (staticReturnType != null && _enclosingFunction.isAsynchronous) {
5797 return _typeProvider.futureType.instantiate( 5797 return _typeProvider.futureType.instantiate(
5798 <DartType>[staticReturnType.flattenFutures(_typeSystem)]); 5798 <DartType>[staticReturnType.flattenFutures(_typeSystem)]);
5799 } 5799 }
5800 return staticReturnType; 5800 return staticReturnType;
5801 } 5801 }
5802 5802
5803 MethodElement _findOverriddenMemberThatMustCallSuper(MethodDeclaration node) { 5803 MethodElement _findOverriddenMemberThatMustCallSuper(MethodDeclaration node) {
5804 ExecutableElement overriddenMember = _getOverriddenMember(node.element); 5804 ExecutableElement overriddenMember = _getOverriddenMember(node.element);
5805 while (overriddenMember is MethodElement) { 5805 List<ExecutableElement> seen = <ExecutableElement>[];
5806 while (
5807 overriddenMember is MethodElement && !seen.contains(overriddenMember)) {
5806 for (ElementAnnotation annotation in overriddenMember.metadata) { 5808 for (ElementAnnotation annotation in overriddenMember.metadata) {
5807 if (annotation.isMustCallSuper) { 5809 if (annotation.isMustCallSuper) {
5808 return overriddenMember; 5810 return overriddenMember;
5809 } 5811 }
5810 } 5812 }
5813 seen.add(overriddenMember);
5811 // Keep looking up the chain. 5814 // Keep looking up the chain.
5812 overriddenMember = _getOverriddenMember(overriddenMember); 5815 overriddenMember = _getOverriddenMember(overriddenMember);
5813 } 5816 }
5814 return null; 5817 return null;
5815 } 5818 }
5816 5819
5817 /** 5820 /**
5818 * Return the error code that should be used when the given class [element] 5821 * Return the error code that should be used when the given class [element]
5819 * references itself directly. 5822 * references itself directly.
5820 */ 5823 */
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
6267 class _InvocationCollector extends RecursiveAstVisitor { 6270 class _InvocationCollector extends RecursiveAstVisitor {
6268 final List<String> superCalls = <String>[]; 6271 final List<String> superCalls = <String>[];
6269 6272
6270 @override 6273 @override
6271 visitMethodInvocation(MethodInvocation node) { 6274 visitMethodInvocation(MethodInvocation node) {
6272 if (node.target is SuperExpression) { 6275 if (node.target is SuperExpression) {
6273 superCalls.add(node.methodName.name); 6276 superCalls.add(node.methodName.name);
6274 } 6277 }
6275 } 6278 }
6276 } 6279 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698