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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 11829020: Report errors on repeated interfaces. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/warnings.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 Element operator[](Node node); 8 Element operator[](Node node);
9 Selector getSelector(Send send); 9 Selector getSelector(Send send);
10 DartType getType(Node node); 10 DartType getType(Node node);
(...skipping 2762 matching lines...) Expand 10 before | Expand all | Expand 10 after
2773 DartType interfaceType = typeResolver.resolveTypeAnnotation( 2773 DartType interfaceType = typeResolver.resolveTypeAnnotation(
2774 link.head, scope, element, onFailure: error); 2774 link.head, scope, element, onFailure: error);
2775 if (interfaceType != null) { 2775 if (interfaceType != null) {
2776 if (identical(interfaceType.kind, TypeKind.MALFORMED_TYPE)) { 2776 if (identical(interfaceType.kind, TypeKind.MALFORMED_TYPE)) {
2777 // Error has already been reported. 2777 // Error has already been reported.
2778 } else if (!identical(interfaceType.kind, TypeKind.INTERFACE)) { 2778 } else if (!identical(interfaceType.kind, TypeKind.INTERFACE)) {
2779 // TODO(johnniwinther): Handle dynamic. 2779 // TODO(johnniwinther): Handle dynamic.
2780 TypeAnnotation typeAnnotation = link.head; 2780 TypeAnnotation typeAnnotation = link.head;
2781 error(typeAnnotation.typeName, MessageKind.CLASS_NAME_EXPECTED, []); 2781 error(typeAnnotation.typeName, MessageKind.CLASS_NAME_EXPECTED, []);
2782 } else { 2782 } else {
2783 if (interfaceType == element.supertype) {
2784 compiler.reportMessage(
2785 compiler.spanFromNode(node.superclass),
2786 MessageKind.DUPLICATE_EXTENDS_IMPLEMENTS.error([interfaceType]),
2787 Diagnostic.ERROR);
2788 compiler.reportMessage(
2789 compiler.spanFromNode(link.head),
2790 MessageKind.DUPLICATE_EXTENDS_IMPLEMENTS.error([interfaceType]),
2791 Diagnostic.ERROR);
2792 }
2793 if (interfaces.contains(interfaceType)) {
2794 compiler.reportMessage(
2795 compiler.spanFromNode(link.head),
2796 MessageKind.DUPLICATE_IMPLEMENTS.error([interfaceType]),
2797 Diagnostic.ERROR);
2798 }
2783 interfaces = interfaces.prepend(interfaceType); 2799 interfaces = interfaces.prepend(interfaceType);
2784 if (isBlackListed(interfaceType)) { 2800 if (isBlackListed(interfaceType)) {
2785 error(link.head, MessageKind.CANNOT_IMPLEMENT, [interfaceType]); 2801 error(link.head, MessageKind.CANNOT_IMPLEMENT, [interfaceType]);
2786 } 2802 }
2787 } 2803 }
2788 } 2804 }
2789 } 2805 }
2790 element.interfaces = interfaces; 2806 element.interfaces = interfaces;
2791 calculateAllSupertypes(element); 2807 calculateAllSupertypes(element);
2792 2808
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
3389 return e; 3405 return e;
3390 } 3406 }
3391 3407
3392 /// Assumed to be called by [resolveRedirectingFactory]. 3408 /// Assumed to be called by [resolveRedirectingFactory].
3393 Element visitReturn(Return node) { 3409 Element visitReturn(Return node) {
3394 Node expression = node.expression; 3410 Node expression = node.expression;
3395 return finishConstructorReference(visit(expression), 3411 return finishConstructorReference(visit(expression),
3396 expression, expression); 3412 expression, expression);
3397 } 3413 }
3398 } 3414 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698