Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: pkg/compiler/lib/src/serialization/modelz.dart

Issue 1891193003: Fix serialization of forwarding constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: dartfmt Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/serialization/modelz.dart
diff --git a/pkg/compiler/lib/src/serialization/modelz.dart b/pkg/compiler/lib/src/serialization/modelz.dart
index 5bcb4a604b25947b2b0c7745d96fd31dc33e6248..baafadebc9b10472700fb9a22cc000495f8d9706 100644
--- a/pkg/compiler/lib/src/serialization/modelz.dart
+++ b/pkg/compiler/lib/src/serialization/modelz.dart
@@ -897,33 +897,16 @@ class ClassElementZ extends DeserializedElementZ
abstract class MixinApplicationElementMixin
implements ElementZ, MixinApplicationElement {
- Link<ConstructorElement> _constructors;
-
@override
- bool get isMixinApplication => false;
+ bool get isMixinApplication => true;
@override
ClassElement get mixin => mixinType.element;
-
- Link<ConstructorElement> get constructors {
- if (_constructors == null) {
- LinkBuilder<ConstructorElement> builder =
- new LinkBuilder<ConstructorElement>();
- for (ConstructorElement definingConstructor in superclass.constructors) {
- if (definingConstructor.isGenerativeConstructor &&
- definingConstructor.memberName.isAccessibleFrom(library)) {
- builder.addLast(
- new ForwardingConstructorElementZ(this, definingConstructor));
- }
- }
- _constructors = builder.toLink();
- }
- return _constructors;
- }
}
class NamedMixinApplicationElementZ extends ClassElementZ
- with MixinApplicationElementCommon, MixinApplicationElementMixin {
+ with MixinApplicationElementMixin {
+ Link<Element> _constructors;
InterfaceType _mixinType;
NamedMixinApplicationElementZ(ObjectDecoder decoder) : super(decoder);
@@ -947,6 +930,7 @@ class UnnamedMixinApplicationElementZ extends ElementZ
final InterfaceType supertype;
final Link<DartType> interfaces;
OrderedTypeSet _allSupertypesAndSelf;
+ Link<ConstructorElement> _constructors;
UnnamedMixinApplicationElementZ(
ClassElement subclass, InterfaceType supertype, InterfaceType mixin)
@@ -961,6 +945,22 @@ class UnnamedMixinApplicationElementZ extends ElementZ
@override
bool get isUnnamedMixinApplication => true;
+ Link<ConstructorElement> get constructors {
+ if (_constructors == null) {
+ LinkBuilder<ConstructorElement> builder =
+ new LinkBuilder<ConstructorElement>();
+ for (ConstructorElement definingConstructor in superclass.constructors) {
+ if (definingConstructor.isGenerativeConstructor &&
+ definingConstructor.memberName.isAccessibleFrom(library)) {
+ builder.addLast(
+ new ForwardingConstructorElementZ(this, definingConstructor));
+ }
+ }
+ _constructors = builder.toLink();
+ }
+ return _constructors;
+ }
+
@override
List<DartType> _getTypeVariables() {
// Create synthetic type variables for the mixin application.
« no previous file with comments | « pkg/compiler/lib/src/serialization/element_serialization.dart ('k') | tests/compiler/dart2js/serialization_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698