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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/Resolver.java

Issue 9017015: Dartc was not raising an error if an interface declared constructors without a default clause (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated the stub-generator tests to get rid of errors Created 9 years 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
Index: compiler/java/com/google/dart/compiler/resolver/Resolver.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/Resolver.java b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
index 380e2960171c3735052c3623a147a653fe4657e9..f57e65286b380642b63fa8c4cc2dad0e4f61383b 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -230,7 +230,7 @@ public class Resolver {
}
checkClassTypeVariables(classElement);
-
+
// Push new resolution context.
ResolutionContext previousContext = context;
EnclosingElement previousHolder = currentHolder;
@@ -272,8 +272,12 @@ public class Resolver {
// Check that interface constructors have corresponding methods in default class.
checkInteraceConstructors(classElement);
-
-
+ } else if (classElement.isInterface() && classElement.getConstructors() != null) {
+ for (ConstructorElement interfaceConstructor : classElement.getConstructors()) {
+ DartMethodDefinition methodNode = (DartMethodDefinition)interfaceConstructor.getNode();
+ onError(methodNode.getName(),
+ ResolverErrorCode.ILLEGAL_CONSTRUCTOR_NO_DEFAULT_IN_INTERFACE);
+ }
}
context = previousContext;

Powered by Google App Engine
This is Rietveld 408576698