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

Unified Diff: runtime/lib/errors_patch.dart

Issue 2785623004: Fix #14144 confusing error message misusing a callable object (Closed)
Patch Set: Created 3 years, 9 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 | runtime/vm/flow_graph_inliner.cc » ('j') | runtime/vm/flow_graph_inliner.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/errors_patch.dart
diff --git a/runtime/lib/errors_patch.dart b/runtime/lib/errors_patch.dart
index cf42b572f7c9a7904b0c590174835b36af7ade8b..fa43b102dacf0c70f744b67091bbba87aeacb8a7 100644
--- a/runtime/lib/errors_patch.dart
+++ b/runtime/lib/errors_patch.dart
@@ -312,7 +312,9 @@ class NoSuchMethodError {
.writeln("The $type_str '$memberName' was called on null.");
}
} else {
- if (_receiver is Function) {
+ if (_receiver.runtimeType == Function ||
+ _receiver.runtimeType == _Closure ||
+ (_receiver is Function && memberName.startsWith("call"))) {
Florian Schneider 2017/03/30 20:18:05 I think this should be (_receiver is Function &&
msg_buf.writeln("Closure call with mismatched arguments: "
"function '$memberName'");
} else if (_receiver is _Type && memberName == "call") {
« no previous file with comments | « no previous file | runtime/vm/flow_graph_inliner.cc » ('j') | runtime/vm/flow_graph_inliner.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698