Closed
Description
/cc @leafpetersen
Take the following code:
void foo(void Function(Object) f) { }
void main() {
var f = (dynamic x) { };
foo(f);
}
This should work: f
has type dynamic -> void
, or as the inference currently infers: dynamic -> Null
.
However I get the following error message:
The argument type '(dynamic) → Null' can't be assigned to the parameter type '(Object) → void'.
I can remove this error message in two ways:
- change from
dynamic
toObject
(which should be the same thing). - change the return type from
Null
tovoid
(by making it a nested function).
Neither should be necessary.
Metadata
Metadata
Assignees
Labels
No labels