luau-lang/luau

"attempt to call a nil value" error message could be improved

Closed this issue · 1 comments

Hi all,
Calling a function that doesn't exist does not provide a very helpful error message.
Let's say we try to call Print() instead of print():

Print("hello")

results in the following error:

[string "script"]:3: attempt to call a nil value

it would be great if this could result in an error message like "Tried to call a function 'Print' that does not exist".

This looks like #255 but not for table methods.

Luau VM doesn't have a name of the function in this context.
While PUC Lua performs approximate symbolic re-execution of code to find potential sources of the call function register, we do not have such mechanism and have no plans to add it (because of performance, unreliability and code complexity).