luau icon indicating copy to clipboard operation
luau copied to clipboard

Recursive type error occurring when it doesn't in the old solver

Open gaymeowing opened this issue 1 year ago • 0 comments

The following code does technically include a recursive type, with it working fine if I manually type out the methods rather than using BaseLoggerMethod in the new solver. But this doesn't warn in the old solver so I'd expect it to work in the new one.

type BaseLoggerMethod<I> = (self: Logger, player: Player, info: I) -> ()

type LoggerPrototype = {
	event: (<S, N>(self: S & Logger, name: N) -> S & { [N]: (self: Logger, player: Player) -> () }),
	-- Recursive type being used with diffrent parameters
	onboarding_funnel_step: BaseLoggerMethod<{ meow: "mrrp" }>,
	-- no type error
	progression: BaseLoggerMethod<{ mrrp: "meow" }>,
}

export type Logger = typeof(setmetatable({} :: {}, {} :: LoggerPrototype))

gaymeowing avatar Sep 24 '24 01:09 gaymeowing