foo:IsA("Part") proves that foo is a Part but this code produces this error instead:
local foo = workspace:FindFirstChild("Foo")
if foo and foo:IsA("Part") then
print(foo.Position) -- Roblox LSP Type Checking: "Key `Position` not found in type `Instance`."
end
Here it could be inferred that foo IsA Part, this would be an amazing quality of life change, I constantly have to write boilerplate to convince the type checker it will be of the already IsA asserted class in these scenarios.
foo:IsA("Part")
proves that foo is a Part but this code produces this error instead:Here it could be inferred that foo IsA Part, this would be an amazing quality of life change, I constantly have to write boilerplate to convince the type checker it will be of the already IsA asserted class in these scenarios.