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 operator[](Node node); | 8 Element operator[](Node node); |
| 9 Selector getSelector(Send send); | 9 Selector getSelector(Send send); |
| 10 DartType getType(Node node); | 10 DartType getType(Node node); |
| (...skipping 2691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2702 DartType interfaceType = typeResolver.resolveTypeAnnotation( | 2702 DartType interfaceType = typeResolver.resolveTypeAnnotation( |
| 2703 link.head, scope, element, onFailure: error); | 2703 link.head, scope, element, onFailure: error); |
| 2704 if (interfaceType != null) { | 2704 if (interfaceType != null) { |
| 2705 if (identical(interfaceType.kind, TypeKind.MALFORMED_TYPE)) { | 2705 if (identical(interfaceType.kind, TypeKind.MALFORMED_TYPE)) { |
| 2706 // Error has already been reported. | 2706 // Error has already been reported. |
| 2707 } else if (!identical(interfaceType.kind, TypeKind.INTERFACE)) { | 2707 } else if (!identical(interfaceType.kind, TypeKind.INTERFACE)) { |
| 2708 // TODO(johnniwinther): Handle dynamic. | 2708 // TODO(johnniwinther): Handle dynamic. |
| 2709 TypeAnnotation typeAnnotation = link.head; | 2709 TypeAnnotation typeAnnotation = link.head; |
| 2710 error(typeAnnotation.typeName, MessageKind.CLASS_NAME_EXPECTED, []); | 2710 error(typeAnnotation.typeName, MessageKind.CLASS_NAME_EXPECTED, []); |
| 2711 } else { | 2711 } else { |
| 2712 if (interfaceType == element.supertype) { | |
| 2713 error(link.head, | |
|
ahe
2013/01/09 13:15:31
As these errors are recoverable, it would be nice
Johnni Winther
2013/01/10 06:55:13
Done.
| |
| 2714 MessageKind.DUPLICATE_EXTENDS_IMPLEMENTS, | |
| 2715 [interfaceType]); | |
| 2716 } | |
| 2717 if (interfaces.contains(interfaceType)) { | |
| 2718 error(link.head, MessageKind.DUPLICATE_IMPLEMENTS, [interfaceType]); | |
| 2719 } | |
| 2712 interfaces = interfaces.prepend(interfaceType); | 2720 interfaces = interfaces.prepend(interfaceType); |
| 2713 if (isBlackListed(interfaceType)) { | 2721 if (isBlackListed(interfaceType)) { |
| 2714 error(link.head, MessageKind.CANNOT_IMPLEMENT, [interfaceType]); | 2722 error(link.head, MessageKind.CANNOT_IMPLEMENT, [interfaceType]); |
| 2715 } | 2723 } |
| 2716 } | 2724 } |
| 2717 } | 2725 } |
| 2718 } | 2726 } |
| 2719 element.interfaces = interfaces; | 2727 element.interfaces = interfaces; |
| 2720 calculateAllSupertypes(element); | 2728 calculateAllSupertypes(element); |
| 2721 | 2729 |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3318 return e; | 3326 return e; |
| 3319 } | 3327 } |
| 3320 | 3328 |
| 3321 /// Assumed to be called by [resolveRedirectingFactory]. | 3329 /// Assumed to be called by [resolveRedirectingFactory]. |
| 3322 Element visitReturn(Return node) { | 3330 Element visitReturn(Return node) { |
| 3323 Node expression = node.expression; | 3331 Node expression = node.expression; |
| 3324 return finishConstructorReference(visit(expression), | 3332 return finishConstructorReference(visit(expression), |
| 3325 expression, expression); | 3333 expression, expression); |
| 3326 } | 3334 } |
| 3327 } | 3335 } |
| OLD | NEW |