luau icon indicating copy to clipboard operation
luau copied to clipboard

Free type pack is escaping its module with LemonSignal library

Open imnerolin opened this issue 1 year ago • 1 comments

image No clue what this means but it told me to report it here.

Relevant code:

--!strict

local Class = {}
Class.__index = Class

-->>	Includes
local Signal = require(script.Parent.Signal) -- https://github.com/Data-Oriented-House/LemonSignal

-->>	Types
export type Class = typeof(setmetatable({} :: ClassStruct, Class))
type ClassStruct = {
	signal: Signal.Signal<number>,
}

-->>	Public
function Class.new(interval: number): Class
	local self = setmetatable({
		signal = Signal.new()
	}, Class)
	return self
end

-- ENTIRE function body has the error, including comments (not including header or 'end')
-- TypeError: Free type pack is escaping its module, please report this error
function Class.Connect(self: Class, callback: (number) -> ())
	return self.signal:Connect(callback)
end

-->>
return Class

imnerolin avatar Dec 19 '24 01:12 imnerolin

Thank you for the report! I added that warning, thank you for the detailed reproduction steps.

hgoldstein avatar Feb 03 '25 19:02 hgoldstein