We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
2.0
Recursive generics work at a type-level, but will crash at runtime.
We need to introduce a mechanism for tracking instantiated args so we can avoid infinitely recursing in these cases.
Also would mean re-enabling these tests in generic.test.ts
generic.test.ts
it("self-reference", () => { const types = scope({ "alternate<a, b>": { // ensures old generic params aren't intersected with // updated values (would be never) swap: "alternate<b, a>", order: ["a", "b"], }, reference: "alternate<0, 1>", }).export(); attest<[0, 1]>(types.reference.infer.swap.swap.order); attest<[1, 0]>(types.reference.infer.swap.swap.swap.order); const fromCall = types.alternate("'off'", "'on'"); attest<["off", "on"]>(fromCall.infer.swap.swap.order); attest<["on", "off"]>(fromCall.infer.swap.swap.swap.order); }); it("self-reference no params", () => { attest(() => scope({ "nest<t>": { // @ts-expect-error nest: "nest", }, }).export() ).throwsAndHasTypeError(writeInvalidGenericArgsMessage("nest", ["t"], [])); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Recursive generics work at a type-level, but will crash at runtime.
We need to introduce a mechanism for tracking instantiated args so we can avoid infinitely recursing in these cases.
Also would mean re-enabling these tests in
generic.test.ts
The text was updated successfully, but these errors were encountered: