I expect that RaycastResult.Instance will have the type of BasePart, or at least Instance as the name suggests. Instead, the type is any. You can see the issue in the code below.
Reproduction Steps
-- psuedo:
local result = workspace:Raycast(origin, direction, params)
if result then
result.Instance. --> No autocomplete here
result. --> Autocomplete for `RaycastResult` here
end
Thanks for the report, and the follow-up! As you have noticed, Raycast does now give the type Instance instead of any, thanks to some of the work that has gone into typing Roblox’s API. For the time being, that’s roughly the best that can be done. It is unfortunately not as simple as editing the type would be if it was purely Luau code (like you get to edit). Nevertheless, there are a few projects underway that are working on systemically fixing issues like this across the API, so keep an eye out for those in the future!