| 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 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1485 error(node, MessageKind.NOT_A_TYPE, [node]); | 1485 error(node, MessageKind.NOT_A_TYPE, [node]); |
| 1486 return null; | 1486 return null; |
| 1487 } else { | 1487 } else { |
| 1488 if (element.isClass()) { | 1488 if (element.isClass()) { |
| 1489 compiler.resolver.toResolve.add(element); | 1489 compiler.resolver.toResolve.add(element); |
| 1490 } | 1490 } |
| 1491 if (element.isTypeVariable()) { | 1491 if (element.isTypeVariable()) { |
| 1492 TypeVariableElement variableElement = element; | 1492 TypeVariableElement variableElement = element; |
| 1493 return variableElement.type; | 1493 return variableElement.type; |
| 1494 } else if (element.isTypedef()) { | 1494 } else if (element.isTypedef()) { |
| 1495 compiler.unimplemented('visitIdentifier for typedefs'); | 1495 compiler.unimplemented('visitIdentifier for typedefs', node: node); |
| 1496 } else { | 1496 } else { |
| 1497 // TODO(ngeoffray): Use type variables. | 1497 // TODO(ngeoffray): Use type variables. |
| 1498 return element.computeType(compiler); | 1498 return element.computeType(compiler); |
| 1499 } | 1499 } |
| 1500 } | 1500 } |
| 1501 return null; | 1501 return null; |
| 1502 } | 1502 } |
| 1503 | 1503 |
| 1504 Type visitSend(Send node) { | 1504 Type visitSend(Send node) { |
| 1505 Identifier prefix = node.receiver.asIdentifier(); | 1505 Identifier prefix = node.receiver.asIdentifier(); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1943 | 1943 |
| 1944 TopScope(LibraryElement library) : super(null, library); | 1944 TopScope(LibraryElement library) : super(null, library); |
| 1945 Element lookup(SourceString name) { | 1945 Element lookup(SourceString name) { |
| 1946 return library.find(name); | 1946 return library.find(name); |
| 1947 } | 1947 } |
| 1948 | 1948 |
| 1949 Element add(Element newElement) { | 1949 Element add(Element newElement) { |
| 1950 throw "Cannot add an element in the top scope"; | 1950 throw "Cannot add an element in the top scope"; |
| 1951 } | 1951 } |
| 1952 } | 1952 } |
| OLD | NEW |