Chromium Code Reviews| 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 part of resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 abstract class TreeElements { | 7 abstract class TreeElements { |
| 8 Element get currentElement; | 8 Element get currentElement; |
| 9 Setlet<Node> get superUses; | 9 Setlet<Node> get superUses; |
| 10 | 10 |
| (...skipping 4093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4104 | 4104 |
| 4105 DartType resolveType(TypeAnnotation node) { | 4105 DartType resolveType(TypeAnnotation node) { |
| 4106 return typeResolver.resolveTypeAnnotation(this, node); | 4106 return typeResolver.resolveTypeAnnotation(this, node); |
| 4107 } | 4107 } |
| 4108 | 4108 |
| 4109 DartType resolveSupertype(ClassElement cls, TypeAnnotation superclass) { | 4109 DartType resolveSupertype(ClassElement cls, TypeAnnotation superclass) { |
| 4110 DartType supertype = resolveType(superclass); | 4110 DartType supertype = resolveType(superclass); |
| 4111 if (supertype != null) { | 4111 if (supertype != null) { |
| 4112 if (identical(supertype.kind, TypeKind.MALFORMED_TYPE)) { | 4112 if (identical(supertype.kind, TypeKind.MALFORMED_TYPE)) { |
| 4113 compiler.reportError(superclass, MessageKind.CANNOT_EXTEND_MALFORMED); | 4113 compiler.reportError(superclass, MessageKind.CANNOT_EXTEND_MALFORMED); |
| 4114 return null; | 4114 return compiler.objectClass.computeType(compiler); |
|
karlklose
2014/01/28 13:30:03
Extract a getter for this type. Also it should be
Johnni Winther
2014/01/29 10:26:09
Done.
| |
| 4115 } else if (!identical(supertype.kind, TypeKind.INTERFACE)) { | 4115 } else if (!identical(supertype.kind, TypeKind.INTERFACE)) { |
| 4116 compiler.reportError(superclass.typeName, | 4116 compiler.reportError(superclass.typeName, |
| 4117 MessageKind.CLASS_NAME_EXPECTED); | 4117 MessageKind.CLASS_NAME_EXPECTED); |
| 4118 return null; | 4118 return compiler.objectClass.computeType(compiler); |
| 4119 } else if (isBlackListed(supertype)) { | 4119 } else if (isBlackListed(supertype)) { |
| 4120 compiler.reportError(superclass, MessageKind.CANNOT_EXTEND, | 4120 compiler.reportError(superclass, MessageKind.CANNOT_EXTEND, |
| 4121 {'type': supertype}); | 4121 {'type': supertype}); |
| 4122 return null; | 4122 return compiler.objectClass.computeType(compiler); |
| 4123 } | 4123 } |
| 4124 } | 4124 } |
| 4125 return supertype; | 4125 return supertype; |
| 4126 } | 4126 } |
| 4127 | 4127 |
| 4128 Link<DartType> resolveInterfaces(NodeList interfaces, Node superclass) { | 4128 Link<DartType> resolveInterfaces(NodeList interfaces, Node superclass) { |
| 4129 Link<DartType> result = const Link<DartType>(); | 4129 Link<DartType> result = const Link<DartType>(); |
| 4130 if (interfaces == null) return result; | 4130 if (interfaces == null) return result; |
| 4131 for (Link<Node> link = interfaces.nodes; !link.isEmpty; link = link.tail) { | 4131 for (Link<Node> link = interfaces.nodes; !link.isEmpty; link = link.tail) { |
| 4132 DartType interfaceType = resolveType(link.head); | 4132 DartType interfaceType = resolveType(link.head); |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4818 return finishConstructorReference(visit(expression), | 4818 return finishConstructorReference(visit(expression), |
| 4819 expression, expression); | 4819 expression, expression); |
| 4820 } | 4820 } |
| 4821 } | 4821 } |
| 4822 | 4822 |
| 4823 /// Looks up [name] in [scope] and unwraps the result. | 4823 /// Looks up [name] in [scope] and unwraps the result. |
| 4824 Element lookupInScope(Compiler compiler, Node node, | 4824 Element lookupInScope(Compiler compiler, Node node, |
| 4825 Scope scope, String name) { | 4825 Scope scope, String name) { |
| 4826 return Elements.unwrap(scope.lookup(name), compiler, node); | 4826 return Elements.unwrap(scope.lookup(name), compiler, node); |
| 4827 } | 4827 } |
| OLD | NEW |