Not all of the following options are valid:
type keys = "Foo" | "Bar"
local tab: {[keys]: number} = {}
print(tab["Foo"]) --> Key 'Foo' not found in table '{| ["Bar" | "Foo"]: number |}'
print(tab.Foo) --> Key 'Foo' not found in table '{| ["Bar" | "Foo"]: number |}'
print(tab["Foo":: "Foo"]) --> valid
Expected behavior
I would expect all three to be valid:
type keys = "Foo" | "Bar"
local tab: {[keys]: number} = {}
print(tab["Foo"]) --> valid
print(tab.Foo) --> valid
print(tab["Foo":: "Foo"]) --> valid