New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recursive types crashes #1861
Comments
Also ran |
Thanks for the report. Can you provide a minimal reproducible example that demonstrates the issue? |
@domoritz Anything specifically missing from the reproducible example provided in the ticket? |
It's not minimal. The smaller, the easier it will be to identify whether this is a knows issue or a new issue and how to fix it. |
Considering it is a total of 4 LoC, how do you propose I minimize this further? |
It's referring to some extra code. I tried to extract the code for type AllowArray<T> = T | T[];
interface OpTypes {
readonly and: unique symbol;
readonly or: unique symbol;
readonly not: unique symbol;
}
const Op: OpTypes = {
and: Symbol.for("and"),
or: Symbol.for("or"),
not: Symbol.for("not"),
} as OpTypes;
type AllowNotOrAndWithImplicitAndArrayRecursive<T> = AllowArray<
| T
| { [Op.or]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<T>> }
| { [Op.and]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<T>> }
| { [Op.not]: AllowNotOrAndWithImplicitAndArrayRecursive<T> }
>;
export type Test = AllowNotOrAndWithImplicitAndArrayRecursive<number>; I ran |
Encountered with this repro:
schema.ts
package.json
Investigating, the culprit seems to be this path in
Options
interface from sequelize:Which is the recursive
AllowNotOrAndWithImplicitAndArrayRecursive
type, see https://github.com/sequelize/sequelize/blob/b8212434b89e1622f86d1f8e1ea1a5daa060cea5/packages/core/src/dialects/abstract/where-sql-builder-types.ts#L17.The text was updated successfully, but these errors were encountered: