ClojureDart
ClojureDart copied to clipboard
Error: Can't use an expression of type 'void Function()?' as a function because it's potentially null.
When binding a nullable Function property inference should remove the?
(when-some [cb (-> (m/ContextMenuButtonItem .onPressed nil) .-onPressed)]
(cb))
will generate
final void Function()? some$6054_$AUTO_$1=const f_material.ContextMenuButtonItem(onPressed: null, ).onPressed;
if((null == some$6054_$AUTO_$1)){
return null;
}
final void Function()? cb$1=some$6054_$AUTO_$1;
return cb$1();
Which throws at compile time
Try calling using ?.call instead.
Performing hot reload...
return cb$1();
^
Try again after fixing the above error(s).