Weird strict type solver warning


(Instance?) can literally be either (Instance) or ().
Not sure what to make of it, can’t think of any further explanation.

1 Like

The Once method expects a function that takes 0 arguments: () -> (). You are currently passing it a function that takes 1 optional argument: (Instance?) -> ().

2 Likes

Yeah, but it will work even if you pass 0 arguments. I’d expect it to accept a function that can take 0 arguments, even if it’s optional…
Is there a workaround or a way to ignore the warning without having to wrap it in a lambda function?

1 Like

Yeah it should work fine, but from a typechecking perspective these two function signatures are not equivalent, hence the warning. You could try casting the function or otherwise wrap it in an anonymous function that matches the expected type.

2 Likes

You can uhh cast it into :Once(SetEquipItem::()->())

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.