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

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

Issue 8462004: Integrate leg as a component in test.py. Also update presubmit script to run tests with leg. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' 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
« no previous file with comments | « dart/frog/leg/scanner/parser.dart ('k') | dart/frog/presubmit.py » ('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) 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 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, Map<Node, Element> elements) { 9 void check(Node tree, Map<Node, Element> elements) {
10 measure(() { 10 measure(() {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 Type visitIdentifier(Identifier node) { 114 Type visitIdentifier(Identifier node) {
115 fail(node); 115 fail(node);
116 } 116 }
117 117
118 Type visitSend(Send node) { 118 Type visitSend(Send node) {
119 Element target = elements[node]; 119 Element target = elements[node];
120 if (target !== null) { 120 if (target !== null) {
121 // TODO(karlklose): Move that to a function that also 121 // TODO(karlklose): Move that to a function that also
122 // calculates FunctionTypes for other target types. 122 // calculates FunctionTypes for other target types.
123 FunctionType funType = target.type; 123 FunctionType funType = target.computeType(compiler, types);
124 Link<Type> formals = funType.parameterTypes; 124 Link<Type> formals = funType.parameterTypes;
125 Link<Node> arguments = node.arguments; 125 Link<Node> arguments = node.arguments;
126 while ((!formals.isEmpty()) && (!arguments.isEmpty())) { 126 while ((!formals.isEmpty()) && (!arguments.isEmpty())) {
127 compiler.cancel('parameters not supported.'); 127 compiler.cancel('parameters not supported.');
128 var argumentType = visit(arguments.head); 128 var argumentType = visit(arguments.head);
129 if (!types.isAssignable(formals.head, argumentType)) { 129 if (!types.isAssignable(formals.head, argumentType)) {
130 var warning = CompilerError.NOT_ASSIGNABLE(argumentType, 130 var warning = CompilerError.NOT_ASSIGNABLE(argumentType,
131 formals.head); 131 formals.head);
132 compiler.reportWarning(node, warning); 132 compiler.reportWarning(node, warning);
133 } 133 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 compiler.cancel('unsupported type ${node.typeName}'); 200 compiler.cancel('unsupported type ${node.typeName}');
201 } 201 }
202 return types.VOID; 202 return types.VOID;
203 } 203 }
204 204
205 Type visitVariableDefinitions(VariableDefinitions node) { 205 Type visitVariableDefinitions(VariableDefinitions node) {
206 // TODO(karlklose): Implement this. 206 // TODO(karlklose): Implement this.
207 return types.VOID; 207 return types.VOID;
208 } 208 }
209 } 209 }
OLDNEW
« no previous file with comments | « dart/frog/leg/scanner/parser.dart ('k') | dart/frog/presubmit.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698