| 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 interface TreeElements { | 5 interface TreeElements { |
| 6 Element operator[](Node node); | 6 Element operator[](Node node); |
| 7 Selector getSelector(Send send); | 7 Selector getSelector(Send send); |
| 8 Type getType(TypeAnnotation annotation); | 8 Type getType(TypeAnnotation annotation); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 } | 149 } |
| 150 if (isConstructor) { | 150 if (isConstructor) { |
| 151 constructorElements[element] = visitor.mapping; | 151 constructorElements[element] = visitor.mapping; |
| 152 } | 152 } |
| 153 return visitor.mapping; | 153 return visitor.mapping; |
| 154 }); | 154 }); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void resolveConstructorImplementation(FunctionElement constructor, | 157 void resolveConstructorImplementation(FunctionElement constructor, |
| 158 FunctionExpression node) { | 158 FunctionExpression node) { |
| 159 assert(constructor.defaultImplementation === constructor); | 159 if (constructor.defaultImplementation !== constructor) return; |
| 160 ClassElement intrface = constructor.enclosingElement; | 160 ClassElement intrface = constructor.enclosingElement; |
| 161 if (!intrface.isInterface()) return; | 161 if (!intrface.isInterface()) return; |
| 162 Type defaultType = intrface.defaultClass; | 162 Type defaultType = intrface.defaultClass; |
| 163 if (defaultType === null) { | 163 if (defaultType === null) { |
| 164 error(node, MessageKind.NO_DEFAULT_CLASS, [intrface.name]); | 164 error(node, MessageKind.NO_DEFAULT_CLASS, [intrface.name]); |
| 165 } | 165 } |
| 166 ClassElement defaultClass = defaultType.element; | 166 ClassElement defaultClass = defaultType.element; |
| 167 defaultClass.ensureResolved(compiler); | 167 defaultClass.ensureResolved(compiler); |
| 168 if (defaultClass.isInterface()) { | 168 if (defaultClass.isInterface()) { |
| 169 error(node, MessageKind.CANNOT_INSTANTIATE_INTERFACE, | 169 error(node, MessageKind.CANNOT_INSTANTIATE_INTERFACE, |
| (...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2093 | 2093 |
| 2094 TopScope(LibraryElement library) : super(null, library); | 2094 TopScope(LibraryElement library) : super(null, library); |
| 2095 Element lookup(SourceString name) { | 2095 Element lookup(SourceString name) { |
| 2096 return library.find(name); | 2096 return library.find(name); |
| 2097 } | 2097 } |
| 2098 | 2098 |
| 2099 Element add(Element newElement) { | 2099 Element add(Element newElement) { |
| 2100 throw "Cannot add an element in the top scope"; | 2100 throw "Cannot add an element in the top scope"; |
| 2101 } | 2101 } |
| 2102 } | 2102 } |
| OLD | NEW |