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

Side by Side Diff: lib/compiler/implementation/universe/universe.dart

Issue 11273034: Make unmatched static call a runtime error. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove isValid. Created 8 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
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 library universe; 5 library universe;
6 6
7 import '../closure.dart'; 7 import '../closure.dart';
8 import '../elements/elements.dart'; 8 import '../elements/elements.dart';
9 import '../dart2jslib.dart'; 9 import '../dart2jslib.dart';
10 import '../runtime_types.dart'; 10 import '../runtime_types.dart';
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 int get hashCode => argumentCount + 1000 * namedArguments.length; 217 int get hashCode => argumentCount + 1000 * namedArguments.length;
218 int get namedArgumentCount => namedArguments.length; 218 int get namedArgumentCount => namedArguments.length;
219 int get positionalArgumentCount => argumentCount - namedArgumentCount; 219 int get positionalArgumentCount => argumentCount - namedArgumentCount;
220 DartType get receiverType => null; 220 DartType get receiverType => null;
221 221
222 bool applies(Element element, Compiler compiler) 222 bool applies(Element element, Compiler compiler)
223 => appliesUntyped(element, compiler); 223 => appliesUntyped(element, compiler);
224 224
225 bool appliesUntyped(Element element, Compiler compiler) { 225 bool appliesUntyped(Element element, Compiler compiler) {
226 if (Elements.isUnresolved(element)) return false;
227 if (element.isForeign()) return true;
228
226 if (element.isSetter()) return isSetter(); 229 if (element.isSetter()) return isSetter();
227 if (element.isGetter()) return isGetter() || isCall(); 230 if (element.isGetter()) return isGetter() || isCall();
228 if (element.isField()) return isGetter() || isSetter() || isCall(); 231 if (element.isField()) return isGetter() || isSetter() || isCall();
229 if (isGetter()) return true; 232 if (isGetter()) return true;
230 233
231 FunctionElement function = element; 234 FunctionElement function = element;
232 FunctionSignature parameters = function.computeSignature(compiler); 235 FunctionSignature parameters = function.computeSignature(compiler);
233 if (argumentCount > parameters.parameterCount) return false; 236 if (argumentCount > parameters.parameterCount) return false;
234 int requiredParameterCount = parameters.requiredParameterCount; 237 int requiredParameterCount = parameters.requiredParameterCount;
235 int optionalParameterCount = parameters.optionalParameterCount; 238 int optionalParameterCount = parameters.optionalParameterCount;
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 532
530 if (!self.isInterface() && self.isSubclassOf(other)) { 533 if (!self.isInterface() && self.isSubclassOf(other)) {
531 // Resolve an invocation of [element.name] on [self]. If it 534 // Resolve an invocation of [element.name] on [self]. If it
532 // is found, this selector is a candidate. 535 // is found, this selector is a candidate.
533 return hasElementIn(self, element) && appliesUntyped(element, compiler); 536 return hasElementIn(self, element) && appliesUntyped(element, compiler);
534 } 537 }
535 538
536 return false; 539 return false;
537 } 540 }
538 } 541 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/builder.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698