-
Notifications
You must be signed in to change notification settings - Fork 1.7k
call
method invocation and noSuchMethod
forwarder
#59952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Summary: |
Not sure if we have specified this particular interaction between If the call should not invoke the It'll be the only place where you can get an |
It is a tricky case! ;-) I think the actual behavior of the CFE matches the specified behavior: We're considering an invocation of the expression
We're applying these rules because the previous cases do not match the given situation. The static analysis goes through the following steps: (It doesn't help that it has a getter named Following the rules at that point, we'll then invoke There is another part of the language specification which is concerned with the behavior of the It could be claimed that it is underspecified which value
Yes, I was thinking about that, too. However, it's probably the most consistent behavior, measured against the behavior of statically checked invocations. |
Turns out that DartPad (DDC) yields |
According to the spec, a call in the form e(a0,...,aN) where static type of 'e' is 'dynamic' should succeed only if (1) 'e' evaluates to a function, or (2) runtime type of 'e' has a 'call' *method*. If runtime type of 'e' has a 'call' getter this invocation should fail with NSM. This behavior is different from 'e.call(a0,...,aN)' which accepts 'call' getters. --- In order to implement this behavior in the VM, a special 'dyn:implicit:call' selector is added. It behaves similarly to 'dyn:call' except when looking for a getter target. This selector is used when CFE sets FlagImplicitCall on a DynamicInvocation node. TEST=co19/Language/Expressions/Function_Invocation/Function_Expression_Invocation/call_A04_t01 TEST=co19/Language/Expressions/Function_Invocation/Function_Expression_Invocation/call_A04_t02 Fixes #59965 Issue #59952 Issue #51517 Issue dart-lang/language#3482 Change-Id: Ic45f7743ad75571476642dcec9c91e6a77e8e321 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407161 Reviewed-by: Slava Egorov <[email protected]> Commit-Queue: Alexander Markov <[email protected]> Reviewed-by: Ryan Macnak <[email protected]>
VM behavior was fixed in 4305541. |
Closed too soon. Dart2js still prints |
This issue derieved from the test mentioned in #55803 (comment). I didn't find a separate github item for this issue. Feel free to close this one as a duplicate if there is such one.
Here we have an attempt to invoke a
call
method, not a getter, soisMethod
andisGetter
should have opposite values.cc @lrhn @eernstg to confirm.
The text was updated successfully, but these errors were encountered: