-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Invoking emulated functions implemented using noSuchMethod sometimes fails in DDC #29904
Comments
Also, it's worth noting that while I can avoid |
Yes, it looks like a bug in dynamic dispatch. Note, you'd avoid the
|
Another common case I find myself hitting this error is when initializing class FunctionEmulator implements Function {
call(a, b);
noSuchMethod(i) => 'NSM ${i.positionalArguments}';
}
void main() {
var condition = new DateTime.now().weekday == DateTime.THURSDAY;
var f;
if (condition) {
f = new FunctionEmulator();
} else {
f = new FunctionEmulator();
}
print(f(1, 2));
} Typing |
@jmesserly - is this fixed by your recent CL? |
yup! Running the program above now prints |
In the following code, invoking
f2
throws an error.Here's the full output of executing this program:
Looking at the output, it seems that the second one uses
dart.dcall
:It's worth noting that adding a return type
getF
results indart.dcall
not being used, and the example works as expected:This issue is present in Dart 1.24.0 and 1.25.0-dev.1.0
The text was updated successfully, but these errors were encountered: