luau
luau copied to clipboard
Recursive type error occurring when it doesn't in the old solver
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))