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

Unified Diff: runtime/lib/errors_patch.dart

Issue 2785623004: Fix #14144 confusing error message misusing a callable object (Closed)
Patch Set: Remove the check to 'call' methods to report closures. Clearer this way. 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
Index: runtime/lib/errors_patch.dart
diff --git a/runtime/lib/errors_patch.dart b/runtime/lib/errors_patch.dart
index cf42b572f7c9a7904b0c590174835b36af7ade8b..76bbd7a4e167a63882f35b75cb1c0cc1e22e7073 100644
--- a/runtime/lib/errors_patch.dart
+++ b/runtime/lib/errors_patch.dart
@@ -312,7 +312,8 @@ class NoSuchMethodError {
.writeln("The $type_str '$memberName' was called on null.");
}
} else {
- if (_receiver is Function) {
+ if (_receiver.runtimeType == Function ||
rmacnak 2017/03/31 16:36:39 `_receiver.runtimeType == Function` doesn't match
+ _receiver.runtimeType == _Closure) {
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') | tests/language/vm/no_such_args_error_message_vm_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698