Our current behavior when an NSM forwarder is called with missing optional, named or type arguments is to preserve their absence in the Invocation
object passed to noSuchMethod
. However, the spec. says they should be filled in with their default values.
In this example:
class C {
dynamic noSuchMethod(Invocation invoke) {
print(invoke.positionalArguments);
print(invoke.namedArguments);
print(invoke.typeArguments);
}
void f1<T>();
void f2([int x = 3]);
void f3({int y = 3});
}
void main() {
var c = new C();
c.f1();
c.f2();
c.f3();
}
Our behavior currently is:
[]
{}
[]
[]
{}
[]
[]
{}
[]
Whereas it should be:
[]
{}
[dynamic]
[3]
{}
[]
[]
{Symbol("y"): 3}
[]
sigh. There’s always somebody isn’t there. https://xkcd.com/1172/