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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 101617187f15ab9e4be91ccd433c77f7a72f3314..245a2e4bc3b5622dd33079ec705a8c24afe6ef60 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -2780,6 +2780,22 @@ class ClassResolverVisitor extends TypeDefinitionVisitor {
TypeAnnotation typeAnnotation = link.head;
error(typeAnnotation.typeName, MessageKind.CLASS_NAME_EXPECTED, []);
} else {
+ if (interfaceType == element.supertype) {
+ compiler.reportMessage(
+ compiler.spanFromNode(node.superclass),
+ MessageKind.DUPLICATE_EXTENDS_IMPLEMENTS.error([interfaceType]),
+ Diagnostic.ERROR);
+ compiler.reportMessage(
+ compiler.spanFromNode(link.head),
+ MessageKind.DUPLICATE_EXTENDS_IMPLEMENTS.error([interfaceType]),
+ Diagnostic.ERROR);
+ }
+ if (interfaces.contains(interfaceType)) {
+ compiler.reportMessage(
+ compiler.spanFromNode(link.head),
+ MessageKind.DUPLICATE_IMPLEMENTS.error([interfaceType]),
+ Diagnostic.ERROR);
+ }
interfaces = interfaces.prepend(interfaceType);
if (isBlackListed(interfaceType)) {
error(link.head, MessageKind.CANNOT_IMPLEMENT, [interfaceType]);
« 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