OLD | NEW |
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 } | 270 } |
271 | 271 |
272 checkCondition(Expression condition) { | 272 checkCondition(Expression condition) { |
273 checkAssignable(condition, boolType, analyze(condition)); | 273 checkAssignable(condition, boolType, analyze(condition)); |
274 } | 274 } |
275 | 275 |
276 void pushCascadeType(Type type) { | 276 void pushCascadeType(Type type) { |
277 cascadeTypes = cascadeTypes.prepend(type); | 277 cascadeTypes = cascadeTypes.prepend(type); |
278 } | 278 } |
279 | 279 |
280 void popCascadeType() { | 280 Type popCascadeType() { |
281 Type type = cascadeTypes.head; | 281 Type type = cascadeTypes.head; |
282 cascadeTypes = cascadeTypes.tail; | 282 cascadeTypes = cascadeTypes.tail; |
283 return type; | 283 return type; |
284 } | 284 } |
285 | 285 |
286 Type visitBlock(Block node) { | 286 Type visitBlock(Block node) { |
287 return analyze(node.statements); | 287 return analyze(node.statements); |
288 } | 288 } |
289 | 289 |
290 Type visitCascade(Cascade node) { | 290 Type visitCascade(Cascade node) { |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 } | 749 } |
750 | 750 |
751 visitCatchBlock(CatchBlock node) { | 751 visitCatchBlock(CatchBlock node) { |
752 fail(node); | 752 fail(node); |
753 } | 753 } |
754 | 754 |
755 visitTypedef(Typedef node) { | 755 visitTypedef(Typedef node) { |
756 fail(node); | 756 fail(node); |
757 } | 757 } |
758 } | 758 } |
OLD | NEW |