Open cntkillme opened 8 years ago
Very similar in nature to #137 which was for events.
The only real argument towards permitting this is values with a __call metamethod:
> delay(0, setmetatable({}, {__call = function() print("This works") end}))
This works
Any modification to check types would likely reject this.
Probably better to check it at call time anyway for ease of debugging, but you know, workflows.
Oh wow, didn't see that issue. Yeah hadn't actually thought of people doing that. Thank you
I'd leave the issue open personally, #137 got fixed, for better or worse, and it probably should be made consistent.
It doesn't seem that (at least) the first argument is checked when calling. This causes a vague error message when the first argument (supposed to be a function) is called later from the thread scheduler (you get no stack trace or any other information).
Reproduction: delay(1, 0.5); -- >after half a second, you get the error:
attempt to call a number value