Closed pigpigyyy closed 2 years ago
Teal Playground URL: https://556--teal-playground-preview.netlify.app
wouldn't this potentially break for tables/userdata that implement their own comparison? As there a == nil
can mean something else than type(a) == "nil"
The __eq
metamethod will only be invoked when Lua find both side items from "==" expression to be tables or userdata.
Ok. Sounds weird but then I guess this indeed doesn't break anything/change behaviour.
@pigpigyyy Nice, thank you!
Have been using an idiom to notice user to do a nil check before using some API results.
And currently
r is nil
is being generated to(type(r) == "nil")
, could make it to be just(r == nil)
.