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

Side by Side Diff: compiler/java/com/google/dart/compiler/resolver/Elements.java

Issue 8633015: Allow initializing a field in a superclass in a const constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes to lookupField 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 package com.google.dart.compiler.resolver; 5 package com.google.dart.compiler.resolver;
6 6
7 import com.google.common.annotations.VisibleForTesting; 7 import com.google.common.annotations.VisibleForTesting;
8 import com.google.dart.compiler.ast.DartClass; 8 import com.google.dart.compiler.ast.DartClass;
9 import com.google.dart.compiler.ast.DartField; 9 import com.google.dart.compiler.ast.DartField;
10 import com.google.dart.compiler.ast.DartFunctionExpression; 10 import com.google.dart.compiler.ast.DartFunctionExpression;
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } 176 }
177 177
178 public static MethodElement lookupLocalMethod(ClassElement cls, String name) { 178 public static MethodElement lookupLocalMethod(ClassElement cls, String name) {
179 return ((ClassElementImplementation) cls).lookupLocalMethod(name); 179 return ((ClassElementImplementation) cls).lookupLocalMethod(name);
180 } 180 }
181 181
182 public static FieldElement lookupLocalField(ClassElement cls, String name) { 182 public static FieldElement lookupLocalField(ClassElement cls, String name) {
183 return ((ClassElementImplementation) cls).lookupLocalField(name); 183 return ((ClassElementImplementation) cls).lookupLocalField(name);
184 } 184 }
185 185
186 public static FieldElement lookupField(ClassElement cls, String name) {
187 return ((ClassElementImplementation) cls).lookupField(name);
188 }
189
186 static ConstructorElement constructorNamed(String name, ClassElement declaring Class, 190 static ConstructorElement constructorNamed(String name, ClassElement declaring Class,
187 ClassElement constructorType) { 191 ClassElement constructorType) {
188 return ConstructorElementImplementation.named(name, declaringClass, construc torType); 192 return ConstructorElementImplementation.named(name, declaringClass, construc torType);
189 } 193 }
190 194
191 public static FunctionAliasElement functionTypeAliasFromNode(DartFunctionTypeA lias node, 195 public static FunctionAliasElement functionTypeAliasFromNode(DartFunctionTypeA lias node,
192 LibraryElement li brary) { 196 LibraryElement li brary) {
193 return FunctionAliasElementImplementation.fromNode(node, library); 197 return FunctionAliasElementImplementation.fromNode(node, library);
194 } 198 }
195 199
(...skipping 24 matching lines...) Expand all
220 return VoidElement.getInstance(); 224 return VoidElement.getInstance();
221 } 225 }
222 226
223 /** 227 /**
224 * Returns true if the class needs an implicit default constructor. 228 * Returns true if the class needs an implicit default constructor.
225 */ 229 */
226 public static boolean needsImplicitDefaultConstructor(ClassElement classElemen t) { 230 public static boolean needsImplicitDefaultConstructor(ClassElement classElemen t) {
227 return !classElement.isObject() && classElement.getConstructors().isEmpty(); 231 return !classElement.isObject() && classElement.getConstructors().isEmpty();
228 } 232 }
229 } 233 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698