3 ms·
> aren't there non-arithmetic functions that also error? What's the message in that case? Any function can error in any way imaginable, but if we're talking ab
by BugsJustFindMe 6y ago
> aren't there non-arithmetic functions that also error? What's the message in that case?
Any function can error in any way imaginable, but if we're talking about built-ins...
`print(nil.."a")` -> "attempt to concatenate a nil value"
`print(({}).foo.bar)` -> "attempt to index a nil value (field 'foo')"
`table.insert(a, 1)` -> "bad argument #1 to 'insert' (table expected, got nil)"
On the Python side you get:
`None[1]` -> "TypeError: 'NoneType' object is not subscriptable"
`str.split(None, "d")` -> "TypeError: descriptor 'split' for 'str' objects doesn't apply to a 'NoneType' object"