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

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

Issue 9373043: Move helpers and interceptors to own library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add TODO Created 8 years, 10 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 | « dart/frog/leg/ssa/builder.dart ('k') | dart/frog/tests/leg/src/mock_compiler.dart » ('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 void check(Node tree, TreeElements elements) { 9 void check(Node tree, TreeElements elements) {
10 measure(() { 10 measure(() {
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 ClassElement classElement = receiverType.element; 368 ClassElement classElement = receiverType.element;
369 // TODO(karlklose): substitute type arguments. 369 // TODO(karlklose): substitute type arguments.
370 Type memberType = lookupMethodType(node, classElement, selector.source); 370 Type memberType = lookupMethodType(node, classElement, selector.source);
371 if (memberType === types.dynamicType) return types.dynamicType; 371 if (memberType === types.dynamicType) return types.dynamicType;
372 if (memberType is !FunctionType) { 372 if (memberType is !FunctionType) {
373 fail(node, 'can only handle function types'); 373 fail(node, 'can only handle function types');
374 } 374 }
375 funType = memberType; 375 funType = memberType;
376 } else { 376 } else {
377 Element element = elements[node]; 377 Element element = elements[node];
378 if (element.kind === ElementKind.FUNCTION) { 378 if (element === null) {
379 fail(node, 'unresolved ${node.selector}');
380 } else if (element.kind === ElementKind.FUNCTION) {
379 funType = computeType(element); 381 funType = computeType(element);
380 } else if (element.kind === ElementKind.FOREIGN) { 382 } else if (element.kind === ElementKind.FOREIGN) {
381 return types.dynamicType; 383 return types.dynamicType;
382 } else { 384 } else {
383 fail(node, 'unexpected element kind ${element.kind}'); 385 fail(node, 'unexpected element kind ${element.kind}');
384 } 386 }
385 } 387 }
386 Link<Type> parameterTypes = funType.parameterTypes; 388 Link<Type> parameterTypes = funType.parameterTypes;
387 Link<Node> argumentNodes = node.arguments; 389 Link<Node> argumentNodes = node.arguments;
388 while (!argumentTypes.isEmpty() && !parameterTypes.isEmpty()) { 390 while (!argumentTypes.isEmpty() && !parameterTypes.isEmpty()) {
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 } 627 }
626 628
627 visitCatchBlock(CatchBlock node) { 629 visitCatchBlock(CatchBlock node) {
628 compiler.unimplemented('visitCatchBlock', node: node); 630 compiler.unimplemented('visitCatchBlock', node: node);
629 } 631 }
630 632
631 visitTypedef(Typedef node) { 633 visitTypedef(Typedef node) {
632 compiler.unimplemented('visitTypedef', node: node); 634 compiler.unimplemented('visitTypedef', node: node);
633 } 635 }
634 } 636 }
OLDNEW
« no previous file with comments | « dart/frog/leg/ssa/builder.dart ('k') | dart/frog/tests/leg/src/mock_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698