Log In  

This cart defines type = 2 for some reason. Tostr doesn't like that.

https://www.lexaloffle.com/bbs/?tid=34078

P#72149 2020-01-21 06:21 ( Edited 2020-01-21 06:21)

What would you expect to happen?

P#72577 2020-02-01 19:57

@sparr nothing, tostr should have its own type, in a local variable or something, it shouldn't use the global variable

P#72596 2020-02-02 04:42

I never saw this at the time, but the explanation is that type() is a built-in global function, e.g.:

if type(myvar) == "function" then
  myvar()
end

And you're allowed to override built-in global functions.

P#75335 2020-04-25 09:57 ( Edited 2020-04-25 09:58)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 10:24:30 | 0.017s | Q:13