Roblox type check error. Perhaps a bug?

I am experiencing a error where the roblox type checker returns **error-type**.

Image I could not capture the dialog with a screenshot!!

I would like to know if there is something I’m not doing correctly or if its an engine bug.

Full Code

type LayoutFunction = (origin: Vector3, count: number, callback: (pos: Vector3) -> nil) -> nil

local LayoutSystem: {LayoutFunction} = {}

function LayoutSystem.circle(origin, count, callback)
	local angle = math.pi * 2 / count
	for i = 0, count do
		local rad = angle * i
		local pos = Vector3.new(math.cos(rad), 0, math.sin(rad)) * 10 + origin
	end
end

return LayoutSystem

Thanks in advance!

nvm I figured out the solution.

It turns out LayoutSystem: {LayoutFunction} only applies the LayoutFunction type to table entries with keys of number type. Changing it to

local LayoutSystem: {[string]: LayoutFunction} = {}

solved the issue.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.