luau
luau copied to clipboard
Setting variables to methods from class types doesn't have the variables type defined as the type of the method
-- Players is also inferred as any as of writing, but im assuming this is roblox's types not being defined correctly as Instance.new("Part") is -- inferred as Part and not any
local Players = game:GetService("Players")
local GET_USERID_FROM_NAME_ASYNC = Players.GetUserIdFromNameAsync -- inferred as any in the new solver
GET_USERID_FROM_NAME_ASYNC("meow") -- no type error
Huh, things are definitely better as of this writing, but we're still not quite doing the right thing:
That should really be GET_USERID_FROM_NAME_ASYNC : (self: Players, userName: string) -> number, though at least we correctly error now.
Closing as the original issue has been fixed.
Issue that @hgoldstein highlights is unrelated to Luau code and should be a separate issue even if it was.