| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 static final LIST = const SourceString('List'); | 112 static final LIST = const SourceString('List'); |
| 113 | 113 |
| 114 final InterfaceType voidType; | 114 final InterfaceType voidType; |
| 115 final InterfaceType dynamicType; | 115 final InterfaceType dynamicType; |
| 116 | 116 |
| 117 Types(Element dynamicElement) | 117 Types(Element dynamicElement) |
| 118 : this.with(dynamicElement, new LibraryElement(new Script(null, null))); | 118 : this.with(dynamicElement, new LibraryElement(new Script(null, null))); |
| 119 | 119 |
| 120 // TODO(karlklose): should we have a class Void? | 120 // TODO(karlklose): should we have a class Void? |
| 121 Types.with(Element dynamicElement, LibraryElement library) | 121 Types.with(Element dynamicElement, LibraryElement library) |
| 122 : voidType = new InterfaceType(new ClassElement(VOID, library)), | 122 : voidType = new InterfaceType(new ClassElement(VOID, library, -1)), |
| 123 dynamicType = new InterfaceType(dynamicElement); | 123 dynamicType = new InterfaceType(dynamicElement); |
| 124 | 124 |
| 125 Type lookup(SourceString s) { | 125 Type lookup(SourceString s) { |
| 126 if (VOID == s) { | 126 if (VOID == s) { |
| 127 return voidType; | 127 return voidType; |
| 128 } else if (DYNAMIC == s || s.stringValue === 'var') { | 128 } else if (DYNAMIC == s || s.stringValue === 'var') { |
| 129 return dynamicType; | 129 return dynamicType; |
| 130 } | 130 } |
| 131 return null; | 131 return null; |
| 132 } | 132 } |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 } | 729 } |
| 730 | 730 |
| 731 visitCatchBlock(CatchBlock node) { | 731 visitCatchBlock(CatchBlock node) { |
| 732 fail(node); | 732 fail(node); |
| 733 } | 733 } |
| 734 | 734 |
| 735 visitTypedef(Typedef node) { | 735 visitTypedef(Typedef node) { |
| 736 fail(node); | 736 fail(node); |
| 737 } | 737 } |
| 738 } | 738 } |
| OLD | NEW |