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

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 1678053002: Fix super noSuchMethod handling. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix. Created 4 years, 10 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/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 8766af3ff025653eb3c19aba6697b836eccb908c..d06a002bc42b14a616f38d7f691a4fb2a759fb17 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -4553,7 +4553,10 @@ class SsaBuilder extends ast.Visitor
String name = selector.name;
ClassElement cls = currentNonClosureClass;
- Element element = cls.lookupSuperMember(Identifiers.noSuchMethod_);
+ MethodElement element = cls.lookupSuperMember(Identifiers.noSuchMethod_);
+ if (!Selectors.noSuchMethod_.signatureApplies(element)) {
+ element = coreClasses.objectClass.lookupMember(Identifiers.noSuchMethod_);
+ }
if (compiler.enabledInvokeOn && !element.enclosingClass.isObject) {
// Register the call as dynamic if [noSuchMethod] on the super
// class is _not_ the default implementation from [Object], in
@@ -4693,6 +4696,15 @@ class SsaBuilder extends ast.Visitor
}
@override
+ void visitUnresolvedSuperSet(
+ ast.Send node,
+ Element element,
+ ast.Node rhs,
+ _) {
+ handleSuperSendSet(node);
+ }
+
+ @override
void visitSuperSetterGet(
ast.Send node,
MethodElement setter,
@@ -6811,14 +6823,8 @@ class SsaBuilder extends ast.Visitor
Element element,
ast.Node rhs,
_) {
- if (node.isSuperCall) {
- // TODO(johnniwinther): Remove this when final super field assignment is
- // not an unresolved set.
- handleSuperSendSet(node);
- } else {
- generateIsDeferredLoadedCheckOfSend(node);
- generateNonInstanceSetter(node, element, visitAndPop(rhs));
- }
+ generateIsDeferredLoadedCheckOfSend(node);
+ generateNonInstanceSetter(node, element, visitAndPop(rhs));
}
@override
« no previous file with comments | « pkg/compiler/lib/src/resolution/send_structure.dart ('k') | tests/compiler/dart2js/no_such_method_enabled_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698