| 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 4303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4314 | 4314 |
| 4315 assert(mixinApplication.mixinType == null); | 4315 assert(mixinApplication.mixinType == null); |
| 4316 mixinApplication.mixinType = resolveMixinFor(mixinApplication, mixinType); | 4316 mixinApplication.mixinType = resolveMixinFor(mixinApplication, mixinType); |
| 4317 | 4317 |
| 4318 // Create forwarding constructors for constructor defined in the superclass | 4318 // Create forwarding constructors for constructor defined in the superclass |
| 4319 // because they are now hidden by the mixin application. | 4319 // because they are now hidden by the mixin application. |
| 4320 superclass.forEachLocalMember((Element member) { | 4320 superclass.forEachLocalMember((Element member) { |
| 4321 if (!member.isGenerativeConstructor) return; | 4321 if (!member.isGenerativeConstructor) return; |
| 4322 FunctionElement forwarder = | 4322 FunctionElement forwarder = |
| 4323 createForwardingConstructor(member, mixinApplication); | 4323 createForwardingConstructor(member, mixinApplication); |
| 4324 if (isPrivateName(member.name) && |
| 4325 mixinApplication.library != superclass.library) { |
| 4326 // Do not create a forwarder to the super constructor, because the mixin |
| 4327 // application is in a different library than the constructor in the |
| 4328 // super class and it is not possible to call that constructor from the |
| 4329 // library using the mixin application. |
| 4330 return; |
| 4331 } |
| 4324 mixinApplication.addConstructor(forwarder); | 4332 mixinApplication.addConstructor(forwarder); |
| 4325 }); | 4333 }); |
| 4326 calculateAllSupertypes(mixinApplication); | 4334 calculateAllSupertypes(mixinApplication); |
| 4327 } | 4335 } |
| 4328 | 4336 |
| 4329 InterfaceType resolveMixinFor(MixinApplicationElement mixinApplication, | 4337 InterfaceType resolveMixinFor(MixinApplicationElement mixinApplication, |
| 4330 DartType mixinType) { | 4338 DartType mixinType) { |
| 4331 ClassElement mixin = mixinType.element; | 4339 ClassElement mixin = mixinType.element; |
| 4332 mixin.ensureResolved(compiler); | 4340 mixin.ensureResolved(compiler); |
| 4333 | 4341 |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4869 } | 4877 } |
| 4870 | 4878 |
| 4871 /// The result for the resolution of the `assert` method. | 4879 /// The result for the resolution of the `assert` method. |
| 4872 class AssertResult implements ResolutionResult { | 4880 class AssertResult implements ResolutionResult { |
| 4873 const AssertResult(); | 4881 const AssertResult(); |
| 4874 | 4882 |
| 4875 Element get element => null; | 4883 Element get element => null; |
| 4876 | 4884 |
| 4877 String toString() => 'AssertResult()'; | 4885 String toString() => 'AssertResult()'; |
| 4878 } | 4886 } |
| OLD | NEW |