--!strict
export type ConnectionPrototype<T...> = {
Disconnect: (self: Connection<T...>) -> (),
}
export type ConnectionInstance<T...> = {
Callback: (T...) -> (),
Previous: Connection<T...>?,
Next: Connection<T...>?
}
export type Connection<T...> = typeof (setmetatable({} :: ConnectionInstance<T...>, {__index = {} :: ConnectionPrototype<T...>}))
export type SignalPrototype<T...> = {
Connect: (self: Signal<T...>, callback: (T...) -> ()) -> (),
DisconnectAll: (self: Signal<T...>) -> (),
}
export type SignalInstance<T...> = {
HeadConnection: Connection<T...>?,
TailConnection: Connection<T...>?
}
export type Signal<T...> = typeof (setmetatable({} :: SignalInstance<T...>, {__index = {} :: SignalPrototype<T...>}))
The above is a type definition for two classes Connection and Signal.
I am currently getting the type check error Recursive type being used with different parameters. on the type definition for SignalPrototype.
It does seem to go away whenever I use a different alias (ie K… instead of T…) for the Signal class definition.
Am I doing something wrong with my type definitions or is this an engine issue?