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

Issue 2785623004: Fix #14144 confusing error message misusing a callable object (Closed)

Created:
3 years, 8 months ago by mfairhurst
Modified:
3 years, 8 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix #14144 confusing error message misusing a callable object New tests to make sure that: * Error message calling a closure wrong is unchanged * Error message calling a static function wrong is unchanged * Error message calling a callable object wrong is unchanged * Error message calling nonexist method is unchanged * Error message calling nonexist method for a callable object is clearer The new tests involving calling a closure wrong exposed a bug in the inliner, it assumed (due to lack of ic data, it seems) that all closures have the right number of arguments. Left that assertion/behavior, but put a guard around closures specifically (since static and method calls don't have that bug, due to I think better ic data). Welcoming myself to the world of VMs. BUG= R=fschneider@google.com Committed: https://github.com/dart-lang/sdk/commit/761d21d41466eae28074ff7a42a75f60ad4fde6c

Patch Set 1 #

Total comments: 2

Patch Set 2 : Florian feedback: Check callbar vs call(bar), optional argc for inline #

Patch Set 3 : Remove the check to 'call' methods to report closures. Clearer this way. #

Total comments: 5

Patch Set 4 : Macnak feedback: Function is abstract, and prefer contains over indexOf #

Patch Set 5 : Realized that doing .runtimeType == _Closure is unnecessary, doing 'is' now. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -4 lines) Patch
M runtime/lib/errors_patch.dart View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/flow_graph_inliner.cc View 1 1 chunk +7 lines, -0 lines 0 comments Download
A tests/language/vm/no_such_args_error_message_vm_test.dart View 1 2 3 1 chunk +35 lines, -0 lines 0 comments Download
A tests/language/vm/no_such_method_error_message_callable_vm_test.dart View 1 2 3 1 chunk +39 lines, -0 lines 0 comments Download
M tests/language/vm/no_such_method_error_message_vm_test.dart View 1 2 3 1 chunk +1 line, -3 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
mfairhurst
Started at the oldest and worked back. This one was pretty easy, with an unexpected ...
3 years, 8 months ago (2017-03-30 01:08:21 UTC) #2
Florian Schneider
https://codereview.chromium.org/2785623004/diff/1/runtime/lib/errors_patch.dart File runtime/lib/errors_patch.dart (right): https://codereview.chromium.org/2785623004/diff/1/runtime/lib/errors_patch.dart#newcode317 runtime/lib/errors_patch.dart:317: (_receiver is Function && memberName.startsWith("call"))) { I think this ...
3 years, 8 months ago (2017-03-30 20:18:06 UTC) #3
mfairhurst
Good catch on optional arguments. Had seen that code, but was overly focused on the ...
3 years, 8 months ago (2017-03-31 02:17:11 UTC) #4
rmacnak
https://codereview.chromium.org/2785623004/diff/40001/runtime/lib/errors_patch.dart File runtime/lib/errors_patch.dart (right): https://codereview.chromium.org/2785623004/diff/40001/runtime/lib/errors_patch.dart#newcode315 runtime/lib/errors_patch.dart:315: if (_receiver.runtimeType == Function || `_receiver.runtimeType == Function` doesn't ...
3 years, 8 months ago (2017-03-31 16:36:39 UTC) #5
mfairhurst
+Ryan's feedback. Dropped the entire '.runtimeType ==', can now simply do 'is Closure' instead of ...
3 years, 8 months ago (2017-03-31 18:27:14 UTC) #6
Florian Schneider
Lgtm!
3 years, 8 months ago (2017-03-31 21:09:51 UTC) #7
mfairhurst
3 years, 8 months ago (2017-03-31 22:09:11 UTC) #9
Message was sent while issue was closed.
Committed patchset #5 (id:80001) manually as
761d21d41466eae28074ff7a42a75f60ad4fde6c (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698