local a: userdata = 1
type userdata = typeof(table.clone(nil::any))
--What is {- -}?
So I was just messing around the type-checker and found a new type that is not listed.
I also noticed it can be a type for all kinds of tables and userdatas.
local a: userdata = 1
type userdata = typeof(table.clone(nil::any))
--What is {- -}?
So I was just messing around the type-checker and found a new type that is not listed.
I also noticed it can be a type for all kinds of tables and userdatas.
As per the table.clone
documentation:
It accepts a table, and returns a table. Just because you typecast any
to nil doesn’t mean the compiler will treat nil like a table, since it’s still a nil value being cast to any
- which includes a lot more than just the table
type. When analyzing local a: typeof(table.clone({'a'}::any)) = 1
, the same warning is presented in Script Analysis. I’m assuming the error lies in that table.clone
isn’t sure what its return type will be since any
can include table
(the only acceptable input) and much more, like number
, string
, etc.
So can this be a substitute for considering this as a type for general data types like table or userdata?