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