luau
luau copied to clipboard
Incorrect "Recursive type being used with different parameters" error
Came across a very odd type error in my codebase, managed to create a minimal reproduction below:

Changing the Bar type so that the metatable field is not casted to another typedef removes the error.

Repositioning the Baz type to above the Bar type also removes the error.

All examples were tested in strict mode.
Code:
type Foo = Baz<unknown>
export type Bar<T> = typeof((setmetatable({}, {} :: BarMetatable)))
type BarMetatable = {}
type Baz<T> = { T }
This is already fixed in the new solver.