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
Thank you for the report, I wanted to circle back to say that this was fixed in a recent release! On Studio 0.672, I can see that all three are appropriately accepted. Please continue to report any additional issues you run into, thanks!
Hi, it doesn’t seem to be working. Is it on an unreleased version or a beta feature? I currently have no scripting beta features enabled, and I’m fairly sure I’m on the latest version (version-012239e64a274975).
Ah, sorry about that, I honestly assumed that this worked in the old type solver already and that this was a New Type Solver bug report (just because of recency). Very much my bad! This is fixed in the New Type Solver specifically.