| 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) : 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 | 503 |
| 504 Type computeType(Element element) { | 504 Type computeType(Element element) { |
| 505 if (element === null) return types.dynamicType; | 505 if (element === null) return types.dynamicType; |
| 506 return element.computeType(compiler); | 506 return element.computeType(compiler); |
| 507 } | 507 } |
| 508 | 508 |
| 509 Type visitTypeAnnotation(TypeAnnotation node) { | 509 Type visitTypeAnnotation(TypeAnnotation node) { |
| 510 if (node.typeName === null) return types.dynamicType; | 510 if (node.typeName === null) return types.dynamicType; |
| 511 Identifier identifier = node.typeName.asIdentifier(); | 511 Identifier identifier = node.typeName.asIdentifier(); |
| 512 if (identifier === null) { | 512 if (identifier === null) { |
| 513 compiler.cancel('library prefix not implemented', | 513 fail(node.typeName, 'library prefix not implemented'); |
| 514 node: node.typeName); | |
| 515 } | 514 } |
| 516 // TODO(ahe): Why wasn't this resolved by the resolver? | 515 // TODO(ahe): Why wasn't this resolved by the resolver? |
| 517 Type type = lookupType(identifier.source, compiler, types); | 516 Type type = lookupType(identifier.source, compiler, types); |
| 518 if (type === null) { | 517 if (type === null) { |
| 519 // The type name cannot be resolved, but the resolver | 518 // The type name cannot be resolved, but the resolver |
| 520 // already gave a warning, so we continue checking. | 519 // already gave a warning, so we continue checking. |
| 521 return types.dynamicType; | 520 return types.dynamicType; |
| 522 } | 521 } |
| 523 return type; | 522 return type; |
| 524 } | 523 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 } | 620 } |
| 622 | 621 |
| 623 visitCatchBlock(CatchBlock node) { | 622 visitCatchBlock(CatchBlock node) { |
| 624 compiler.unimplemented('visitCatchBlock', node: node); | 623 compiler.unimplemented('visitCatchBlock', node: node); |
| 625 } | 624 } |
| 626 | 625 |
| 627 visitTypedef(Typedef node) { | 626 visitTypedef(Typedef node) { |
| 628 compiler.unimplemented('visitTypedef', node: node); | 627 compiler.unimplemented('visitTypedef', node: node); |
| 629 } | 628 } |
| 630 } | 629 } |
| OLD | NEW |