| OLD | NEW |
| 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) : types = new Types(), super(compiler); | 6 TypeCheckerTask(Compiler compiler) : types = new Types(), super(compiler); |
| 7 String get name() => "Type checker"; | 7 String get name() => "Type checker"; |
| 8 Types types; | 8 Types types; |
| 9 | 9 |
| 10 void check(Node tree, TreeElements elements) { | 10 void check(Node tree, TreeElements elements) { |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 Type thenType = analyzeNonVoid(node.thenExpression); | 525 Type thenType = analyzeNonVoid(node.thenExpression); |
| 526 Type elseType = analyzeNonVoid(node.elseExpression); | 526 Type elseType = analyzeNonVoid(node.elseExpression); |
| 527 if (types.isSubtype(thenType, elseType)) { | 527 if (types.isSubtype(thenType, elseType)) { |
| 528 return thenType; | 528 return thenType; |
| 529 } else if (types.isSubtype(elseType, thenType)) { | 529 } else if (types.isSubtype(elseType, thenType)) { |
| 530 return elseType; | 530 return elseType; |
| 531 } else { | 531 } else { |
| 532 return objectType; | 532 return objectType; |
| 533 } | 533 } |
| 534 } | 534 } |
| 535 |
| 536 visitStringInterpolation(StringInterpolation node) { |
| 537 node.visitChildren(this); |
| 538 return stringType; |
| 539 } |
| 540 |
| 541 visitStringInterpolationPart(StringInterpolationPart node) { |
| 542 node.visitChildren(this); |
| 543 } |
| 535 } | 544 } |
| OLD | NEW |