| 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 3318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3329 Elements.constructConstructorName(target.name, selector); | 3329 Elements.constructConstructorName(target.name, selector); |
| 3330 } | 3330 } |
| 3331 return new SynthesizedConstructorElementX.forwarding(constructorName, | 3331 return new SynthesizedConstructorElementX.forwarding(constructorName, |
| 3332 constructor, | 3332 constructor, |
| 3333 target); | 3333 target); |
| 3334 } | 3334 } |
| 3335 | 3335 |
| 3336 void doApplyMixinTo(MixinApplicationElement mixinApplication, | 3336 void doApplyMixinTo(MixinApplicationElement mixinApplication, |
| 3337 DartType supertype, | 3337 DartType supertype, |
| 3338 DartType mixinType) { | 3338 DartType mixinType) { |
| 3339 assert(mixinApplication.supertype == null); | 3339 Node node = mixinApplication.parseNode(compiler); |
| 3340 mixinApplication.supertype = supertype; | |
| 3341 | 3340 |
| 3342 Node node = mixinApplication.parseNode(compiler); | 3341 if (mixinApplication.supertype != null) { |
| 3342 // [supertype] is not null if there was a cycle. |
| 3343 assert(invariant(node, compiler.compilationFailed)); |
| 3344 supertype = mixinApplication.supertype; |
| 3345 assert(invariant(node, supertype.element == compiler.objectClass)); |
| 3346 } else { |
| 3347 mixinApplication.supertype = supertype; |
| 3348 } |
| 3349 |
| 3343 // Named mixin application may have an 'implements' clause. | 3350 // Named mixin application may have an 'implements' clause. |
| 3344 NamedMixinApplication namedMixinApplication = | 3351 NamedMixinApplication namedMixinApplication = |
| 3345 node.asNamedMixinApplication(); | 3352 node.asNamedMixinApplication(); |
| 3346 Link<DartType> interfaces = (namedMixinApplication != null) | 3353 Link<DartType> interfaces = (namedMixinApplication != null) |
| 3347 ? resolveInterfaces(namedMixinApplication.interfaces, | 3354 ? resolveInterfaces(namedMixinApplication.interfaces, |
| 3348 namedMixinApplication.superclass) | 3355 namedMixinApplication.superclass) |
| 3349 : const Link<DartType>(); | 3356 : const Link<DartType>(); |
| 3350 | 3357 |
| 3351 // The class that is the result of a mixin application implements | 3358 // The class that is the result of a mixin application implements |
| 3352 // the interface of the class that was mixed in so always prepend | 3359 // the interface of the class that was mixed in so always prepend |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4023 return e; | 4030 return e; |
| 4024 } | 4031 } |
| 4025 | 4032 |
| 4026 /// Assumed to be called by [resolveRedirectingFactory]. | 4033 /// Assumed to be called by [resolveRedirectingFactory]. |
| 4027 Element visitReturn(Return node) { | 4034 Element visitReturn(Return node) { |
| 4028 Node expression = node.expression; | 4035 Node expression = node.expression; |
| 4029 return finishConstructorReference(visit(expression), | 4036 return finishConstructorReference(visit(expression), |
| 4030 expression, expression); | 4037 expression, expression); |
| 4031 } | 4038 } |
| 4032 } | 4039 } |
| OLD | NEW |