Closed crai0 closed 1 year ago
@JR-Mitchell this looks like an interesting edge case to the :
warnings you implemented — pcall
does have a special handling function in the compiler, so it should be possible to detect when a function call goes through that. Could you take a look? Thank you!
I'll try and find the time to have a look, feel free to assign this one to me for now and I'll let you know how I get on.
@JR-Mitchell thank you!!
@hishamhm I've opened #668 which should fix this for pcall
and xpcall
, as well as the related issue of incorrect error messaging if calling, for example
local ok, err = pcall(test.print, 123)
I haven't taken the time to check if there are any other special functions that might have a similar bug, though I can't think of any off the top of my head.
When calling a method via pcall, the Teal compiler produces a warning that the method is being invoked as a regular function.
Example:
Output: