Assigning callback property to non function and non nil value doesn't error

Reproduction Steps
Assigning any callback to a non function and non nil value will reveal this issue.
Example:

local b = Instance.new"BindableFunction"
b.OnInvoke = 1
print"---"
print(pcall(b.Invoke,b))

Expected Behavior
The expected result of assigning a non function and non nil value to a callback property is an error.

Actual Behavior
Upon running the example code in the command line:
https://i.gyazo.com/5735ef95c3c25841719ae8a6f6b3563f.png
No error is generated from the assignment to OnInvoke, but Invoke errors because a non function and non nil value is set for OnInvoke.

Issue Area: Engine
Issue Type: Other
Impact: Low
Frequency: Very Rarely

3 Likes

Just to add on to this report, I found some odd behavior messing around:

image
As shown in the image above, the error is thrown twice upon calling Invoke

2 Likes

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

1 Like

I wonder if this affects other callbacks like ProcessReciept or is isolated to bindables.

This error is reported by script analysis if you add “–!strict” at the beginning of your script.