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

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

Issue 8384012: Make some ErrorCode-s compile-time errors and some just type warnings (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changes for comments Created 9 years, 1 month 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 public static DynamicElement dynamicElement() { 163 public static DynamicElement dynamicElement() {
164 return DynamicElementImplementation.getInstance(); 164 return DynamicElementImplementation.getInstance();
165 } 165 }
166 166
167 static ConstructorElement lookupConstructor(ClassElement cls, ClassElement typ e, String name) { 167 static ConstructorElement lookupConstructor(ClassElement cls, ClassElement typ e, String name) {
168 return ((ClassElementImplementation) cls).lookupConstructor(type, name); 168 return ((ClassElementImplementation) cls).lookupConstructor(type, name);
169 } 169 }
170 170
171 static ConstructorElement lookupConstructor(ClassElement cls, String name) { 171 static ConstructorElement lookupConstructor(ClassElement cls, String name) {
172 return ((ClassElementImplementation) cls).lookupConstructor(name); 172 if (cls instanceof ClassElementImplementation) {
173 return ((ClassElementImplementation) cls).lookupConstructor(name);
174 }
175 return null;
173 } 176 }
174 177
175 public static MethodElement lookupLocalMethod(ClassElement cls, String name) { 178 public static MethodElement lookupLocalMethod(ClassElement cls, String name) {
176 return ((ClassElementImplementation) cls).lookupLocalMethod(name); 179 return ((ClassElementImplementation) cls).lookupLocalMethod(name);
177 } 180 }
178 181
179 public static FieldElement lookupLocalField(ClassElement cls, String name) { 182 public static FieldElement lookupLocalField(ClassElement cls, String name) {
180 return ((ClassElementImplementation) cls).lookupLocalField(name); 183 return ((ClassElementImplementation) cls).lookupLocalField(name);
181 } 184 }
182 185
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 return VoidElement.getInstance(); 220 return VoidElement.getInstance();
218 } 221 }
219 222
220 /** 223 /**
221 * Returns true if the class needs an implicit default constructor. 224 * Returns true if the class needs an implicit default constructor.
222 */ 225 */
223 public static boolean needsImplicitDefaultConstructor(ClassElement classElemen t) { 226 public static boolean needsImplicitDefaultConstructor(ClassElement classElemen t) {
224 return !classElement.isObject() && classElement.getConstructors().isEmpty(); 227 return !classElement.isObject() && classElement.getConstructors().isEmpty();
225 } 228 }
226 } 229 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698