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

Unified Diff: pkg/compiler/lib/src/serialization/serialization_util.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
Index: pkg/compiler/lib/src/serialization/serialization_util.dart
diff --git a/pkg/compiler/lib/src/serialization/serialization_util.dart b/pkg/compiler/lib/src/serialization/serialization_util.dart
index 24aa6f88ef58e2ba5f9f14109124f5e21d9b1548..1e400000b08f8f9278a96b3fe737606afbc4d5a4 100644
--- a/pkg/compiler/lib/src/serialization/serialization_util.dart
+++ b/pkg/compiler/lib/src/serialization/serialization_util.dart
@@ -506,10 +506,19 @@ Element deserializeElementReference(
if (elementName == null) {
return null;
}
- assert(invariant(NO_LOCATION_SPANNABLE, context.isConstructor,
- message: "Unexpected reference of forwarding constructor "
- "'${elementName}' from $context."));
- ClassElement superclass = context.enclosingClass.superclass;
+ ClassElement cls;
+ if (context is ClassElement) {
+ assert(invariant(NO_LOCATION_SPANNABLE, context.isNamedMixinApplication,
+ message: "Unexpected reference of forwarding constructor "
+ "'${elementName}' from $context."));
+ cls = context;
+ } else {
+ assert(invariant(NO_LOCATION_SPANNABLE, context.isConstructor,
+ message: "Unexpected reference of forwarding constructor "
+ "'${elementName}' from $context."));
+ cls = context.enclosingClass;
+ }
+ ClassElement superclass = cls.superclass;
element = superclass.lookupConstructor(elementName);
assert(invariant(NO_LOCATION_SPANNABLE, element != null,
message: "Unresolved reference of forwarding constructor "
« no previous file with comments | « pkg/compiler/lib/src/serialization/element_serialization.dart ('k') | tests/compiler/dart2js/serialization/test_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698