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 Set<Node> get superUses; | 9 Set<Node> get superUses; |
| 10 | 10 |
| (...skipping 3668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3679 compiler.reportError(mixinNode, | 3679 compiler.reportError(mixinNode, |
| 3680 MessageKind.CANNOT_MIXIN, {'type': mixinType}); | 3680 MessageKind.CANNOT_MIXIN, {'type': mixinType}); |
| 3681 } | 3681 } |
| 3682 return mixinType; | 3682 return mixinType; |
| 3683 } | 3683 } |
| 3684 | 3684 |
| 3685 DartType visitNamedMixinApplication(NamedMixinApplication node) { | 3685 DartType visitNamedMixinApplication(NamedMixinApplication node) { |
| 3686 compiler.ensure(element != null); | 3686 compiler.ensure(element != null); |
| 3687 compiler.ensure(element.resolutionState == STATE_STARTED); | 3687 compiler.ensure(element.resolutionState == STATE_STARTED); |
| 3688 | 3688 |
| 3689 if (identical(node.classKeyword.stringValue, 'typedef')) { | |
| 3690 compiler.reportWarning(node.classKeyword, | |
|
ahe
2013/10/10 11:30:15
Add TODO that this should be a compile-time error
aam-me
2013/10/11 03:02:06
Done.
| |
| 3691 MessageKind.DEPRECATED_TYPEDEF_MIXIN_SYNTAX); | |
|
ahe
2013/10/10 11:30:15
Weird indentation.
aam-me
2013/10/11 03:02:06
Done.
| |
| 3692 } | |
| 3693 | |
| 3689 InterfaceType type = element.computeType(compiler); | 3694 InterfaceType type = element.computeType(compiler); |
| 3690 scope = new TypeDeclarationScope(scope, element); | 3695 scope = new TypeDeclarationScope(scope, element); |
| 3691 resolveTypeVariableBounds(node.typeParameters); | 3696 resolveTypeVariableBounds(node.typeParameters); |
| 3692 | 3697 |
| 3693 // Generate anonymous mixin application elements for the | 3698 // Generate anonymous mixin application elements for the |
| 3694 // intermediate mixin applications (excluding the last). | 3699 // intermediate mixin applications (excluding the last). |
| 3695 DartType supertype = resolveSupertype(element, node.superclass); | 3700 DartType supertype = resolveSupertype(element, node.superclass); |
| 3696 Link<Node> link = node.mixins.nodes; | 3701 Link<Node> link = node.mixins.nodes; |
| 3697 while (!link.tail.isEmpty) { | 3702 while (!link.tail.isEmpty) { |
| 3698 supertype = applyMixin(supertype, checkMixinType(link.head), link.head); | 3703 supertype = applyMixin(supertype, checkMixinType(link.head), link.head); |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4520 return finishConstructorReference(visit(expression), | 4525 return finishConstructorReference(visit(expression), |
| 4521 expression, expression); | 4526 expression, expression); |
| 4522 } | 4527 } |
| 4523 } | 4528 } |
| 4524 | 4529 |
| 4525 /// Looks up [name] in [scope] and unwraps the result. | 4530 /// Looks up [name] in [scope] and unwraps the result. |
| 4526 Element lookupInScope(Compiler compiler, Node node, | 4531 Element lookupInScope(Compiler compiler, Node node, |
| 4527 Scope scope, SourceString name) { | 4532 Scope scope, SourceString name) { |
| 4528 return Elements.unwrap(scope.lookup(name), compiler, node); | 4533 return Elements.unwrap(scope.lookup(name), compiler, node); |
| 4529 } | 4534 } |
| OLD | NEW |