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

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

Issue 2105183003: Handle forwarding constructors (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/serialization/serialization_util.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/serialization/element_serialization.dart
diff --git a/pkg/compiler/lib/src/serialization/element_serialization.dart b/pkg/compiler/lib/src/serialization/element_serialization.dart
index 7069b51ff565b21f1e0846630d7f7686978132ce..bbb676f2b8d0c7fe5f8899e3aa639d7b42ec701a 100644
--- a/pkg/compiler/lib/src/serialization/element_serialization.dart
+++ b/pkg/compiler/lib/src/serialization/element_serialization.dart
@@ -423,7 +423,8 @@ class ConstructorSerializer implements ElementSerializer {
SerializedElementKind kind) {
SerializerUtil.serializeParentRelation(element, encoder);
if (kind == SerializedElementKind.FORWARDING_CONSTRUCTOR) {
- encoder.setElement(Key.ELEMENT, element.definingConstructor);
+ serializeElementReference(element.enclosingClass, Key.ELEMENT, Key.NAME,
+ encoder, element.definingConstructor);
} else {
SerializerUtil.serializeMetadata(element, encoder);
encoder.setType(Key.TYPE, element.type);
@@ -773,8 +774,10 @@ class ElementDeserializer {
case SerializedElementKind.REDIRECTING_FACTORY_CONSTRUCTOR:
return new RedirectingFactoryConstructorElementZ(decoder);
case SerializedElementKind.FORWARDING_CONSTRUCTOR:
- return new ForwardingConstructorElementZ(
- decoder.getElement(Key.CLASS), decoder.getElement(Key.ELEMENT));
+ ClassElement cls = decoder.getElement(Key.CLASS);
+ Element definingConstructor =
+ deserializeElementReference(cls, Key.ELEMENT, Key.NAME, decoder);
+ return new ForwardingConstructorElementZ(cls, definingConstructor);
case SerializedElementKind.TOPLEVEL_FUNCTION:
return new TopLevelFunctionElementZ(decoder);
case SerializedElementKind.STATIC_FUNCTION:
« no previous file with comments | « no previous file | pkg/compiler/lib/src/serialization/serialization_util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698