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

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

Issue 10920089: Generate a warning and a runtime error for calls to nonexistent static calls, getters and setters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove case for variable == null in handling of ForIn. 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 unified diff | Download patch | Annotate | Revision Log
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 class TypeCheckerTask extends CompilerTask { 5 class TypeCheckerTask extends CompilerTask {
6 TypeCheckerTask(Compiler compiler) : super(compiler); 6 TypeCheckerTask(Compiler compiler) : super(compiler);
7 String get name => "Type checker"; 7 String get name => "Type checker";
8 8
9 static const bool LOG_FAILURES = false; 9 static const bool LOG_FAILURES = false;
10 10
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 if (receiverKind !== ElementKind.CLASS) { 566 if (receiverKind !== ElementKind.CLASS) {
567 fail(node.receiver, 'unexpected receiver kind: ${receiverKind}'); 567 fail(node.receiver, 'unexpected receiver kind: ${receiverKind}');
568 } 568 }
569 ClassElement classElement = receiverType.element; 569 ClassElement classElement = receiverType.element;
570 // TODO(karlklose): substitute type arguments. 570 // TODO(karlklose): substitute type arguments.
571 DartType memberType = 571 DartType memberType =
572 lookupMethodType(selector, classElement, selector.source); 572 lookupMethodType(selector, classElement, selector.source);
573 if (memberType.element === compiler.dynamicClass) return null; 573 if (memberType.element === compiler.dynamicClass) return null;
574 return memberType; 574 return memberType;
575 } else { 575 } else {
576 if (element === null) { 576 if (Element.isInvalid(element)) {
577 fail(node, 'unresolved ${node.selector}'); 577 fail(node, 'unresolved ${node.selector}');
578 } else if (element.kind === ElementKind.FUNCTION) { 578 } else if (element.kind === ElementKind.FUNCTION) {
579 return computeType(element); 579 return computeType(element);
580 } else if (element.kind === ElementKind.FOREIGN) { 580 } else if (element.kind === ElementKind.FOREIGN) {
581 return null; 581 return null;
582 } else if (element.kind === ElementKind.VARIABLE 582 } else if (element.kind === ElementKind.VARIABLE
583 || element.kind === ElementKind.FIELD) { 583 || element.kind === ElementKind.FIELD) {
584 // TODO(karlklose): handle object invocations. 584 // TODO(karlklose): handle object invocations.
585 return null; 585 return null;
586 } else { 586 } else {
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 } 844 }
845 845
846 visitCatchBlock(CatchBlock node) { 846 visitCatchBlock(CatchBlock node) {
847 return unhandledStatement(); 847 return unhandledStatement();
848 } 848 }
849 849
850 visitTypedef(Typedef node) { 850 visitTypedef(Typedef node) {
851 return unhandledStatement(); 851 return unhandledStatement();
852 } 852 }
853 } 853 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698