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

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

Issue 10917187: First partial step at removing interfaces in libraries. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/resolver/Resolver.java
===================================================================
--- compiler/java/com/google/dart/compiler/resolver/Resolver.java (revision 12179)
+++ compiler/java/com/google/dart/compiler/resolver/Resolver.java (working copy)
@@ -647,16 +647,19 @@
DartBlock body = functionNode.getBody();
boolean isInterface = false;
- if (ElementKind.of(member.getEnclosingElement()).equals(ElementKind.CLASS)
- && ((ClassElement) member.getEnclosingElement()).isInterface()) {
- isInterface =true;
+ boolean isAbstractClass = false;
+ if (ElementKind.of(member.getEnclosingElement()).equals(ElementKind.CLASS)) {
+ ClassElement cl = (ClassElement) member.getEnclosingElement();
+ isInterface = cl.isInterface();
+ isAbstractClass = cl.getModifiers().isAbstract();
}
+
if (body == null
&& !Elements.isNonFactoryConstructor(member)
&& !member.getModifiers().isAbstract()
&& !member.getModifiers().isExternal()
&& node.getRedirectedTypeName() == null
- && !isInterface) {
+ && !(isInterface || isAbstractClass)) {
onError(functionNode, ResolverErrorCode.METHOD_MUST_HAVE_BODY);
}
resolve(functionNode.getBody());
@@ -778,7 +781,7 @@
node.getMetadata().accept(this);
return super.visitVariable(node);
}
-
+
public VariableElement resolveVariable(DartVariable x, Modifiers modifiers) {
// Visit the initializer first.
resolve(x.getValue());
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698