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

Unified Diff: runtime/lib/object.cc

Issue 2730193002: Better error message for unresolved super calls (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/object.cc
diff --git a/runtime/lib/object.cc b/runtime/lib/object.cc
index e5cb7e1c6a07686d4ff8097bcc8111d8a6e33f79..308209a26bbd275601456134d200c8a7a4fb3f1d 100644
--- a/runtime/lib/object.cc
+++ b/runtime/lib/object.cc
@@ -82,9 +82,7 @@ DEFINE_NATIVE_ENTRY(Object_noSuchMethod, 6) {
dart_arguments.SetAt(3, func_args);
dart_arguments.SetAt(4, func_named_args);
- if (is_method.value() &&
- (((invocation_type.Value() >> InvocationMirror::kCallShift) &
- InvocationMirror::kCallMask) != InvocationMirror::kSuper)) {
+ if (is_method.value()) {
// Report if a function with same name (but different arguments) has been
// found.
Function& function = Function::Handle();
@@ -92,7 +90,12 @@ DEFINE_NATIVE_ENTRY(Object_noSuchMethod, 6) {
function = Closure::Cast(instance).function();
} else {
Class& instance_class = Class::Handle(instance.clazz());
- function = instance_class.LookupDynamicFunction(member_name);
+ const bool is_super_call =
+ ((invocation_type.Value() >> InvocationMirror::kCallShift) &
+ InvocationMirror::kCallMask) == InvocationMirror::kSuper;
+ if (!is_super_call) {
+ function = instance_class.LookupDynamicFunction(member_name);
+ }
while (function.IsNull()) {
instance_class = instance_class.SuperClass();
if (instance_class.IsNull()) break;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698