marc2534
(MerpButButter)
February 8, 2022, 10:15am
#1
So scripting and using type checking I noticed that luau doesn’t doesn’t recognize type 'table’ .
Here is an example:
local data: table = {}
It will then have a red bottom line, but in VSCode Roblox LSP recognizes it as a real type.
Roblox:
VSCode:
Blockzez
(Blockzez)
February 8, 2022, 11:56am
#2
I believe it is because table
is not a valid type in Luau for type annotation per se but I’m not certain.
You can use {[any]: any}
in lieu.
marc2534
(MerpButButter)
February 8, 2022, 12:37pm
#3
Yea I know you can make table types, but you cant make it so a variable is expected to be a table which is strange, I can’t post in #bug-reports:engine-bugs though. Or maybe you just have to do:
local data: {} = {}
You can do:
type myTable = { -- create a new type
[any]: any
}
local data: myTable = {} -- apply that type