Skip to content
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

Thunk generics in-scope not inferred #1069

Open
ssalbdivad opened this issue Jul 28, 2024 · 0 comments
Open

Thunk generics in-scope not inferred #1069

ssalbdivad opened this issue Jul 28, 2024 · 0 comments

Comments

@ssalbdivad
Copy link
Member

Up until 2.0.0-beta.2, this test was passing:

it("referenced in scope inline", () => {
  const $ = scope({
    one: "1",
    // now is a circular reference error
    orOne: () => $.type("<t>", "t|one"),
  });

  const types = $.export();
  const bit = types.orOne("0");

  const expected = type("0|1");

  attest<typeof expected.t>(bit.t);
  attest(bit.json).equals(expected.json);
});

Seems like a (reasonable) limitation of TypeScript, so mostly creating this for tracking purposes, but I don't expect to be able to make a change while preserving conditional output types to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant