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

Side by Side Diff: frog/leg/typechecker.dart

Issue 9597011: Fix one crash in the compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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
« no previous file with comments | « no previous file | tests/co19/co19-leg.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 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 final bool LOG_FAILURES = false; 9 static final bool LOG_FAILURES = false;
10 10
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 399
400 } else { 400 } else {
401 Link<Type> argumentTypes = analyzeArguments(node.arguments); 401 Link<Type> argumentTypes = analyzeArguments(node.arguments);
402 FunctionType funType; 402 FunctionType funType;
403 if (node.receiver !== null) { 403 if (node.receiver !== null) {
404 Type receiverType = analyze(node.receiver); 404 Type receiverType = analyze(node.receiver);
405 if (receiverType === types.dynamicType) return types.dynamicType; 405 if (receiverType === types.dynamicType) return types.dynamicType;
406 if (receiverType === null) { 406 if (receiverType === null) {
407 fail(node.receiver, 'receivertype is null'); 407 fail(node.receiver, 'receivertype is null');
408 } 408 }
409 if (receiverType.element.kind !== ElementKind.CLASS) {
410 fail(node.receiver, 'receivertype is not a class');
411 }
409 ClassElement classElement = receiverType.element; 412 ClassElement classElement = receiverType.element;
410 // TODO(karlklose): substitute type arguments. 413 // TODO(karlklose): substitute type arguments.
411 Type memberType = lookupMethodType(node, classElement, selector.source); 414 Type memberType = lookupMethodType(node, classElement, selector.source);
412 if (memberType === types.dynamicType) return types.dynamicType; 415 if (memberType === types.dynamicType) return types.dynamicType;
413 if (memberType is !FunctionType) { 416 if (memberType is !FunctionType) {
414 fail(node, 'can only handle function types'); 417 fail(node, 'can only handle function types');
415 } 418 }
416 funType = memberType; 419 funType = memberType;
417 } else { 420 } else {
418 Element element = elements[node]; 421 Element element = elements[node];
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 } 678 }
676 679
677 visitCatchBlock(CatchBlock node) { 680 visitCatchBlock(CatchBlock node) {
678 fail(node); 681 fail(node);
679 } 682 }
680 683
681 visitTypedef(Typedef node) { 684 visitTypedef(Typedef node) {
682 fail(node); 685 fail(node);
683 } 686 }
684 } 687 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698