I’ve noticed that string keys result in the type checker failing when using custom Luau types. For example:
type testType = {
testString: string,
[true]: string
}
local testTable: testType = {
testString = 123,
[true] = 321
}
The Roblox script editor is picking up that 321
is not a string (Type 'number' could not be converted into 'string'
), however it is not picking up that 123
is not a string. This means that any table can have a string as a key, regardless of if its type permits it, and the value assigned to this key is not checked at all. Is this intentional behaviour, and is there a workaround for it?