Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # 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.

@github-project-automation github-project-automation bot moved this to To do in arktypeio Jul 28, 2024
@ssalbdivad ssalbdivad moved this from To do to Backlog in arktypeio Jul 30, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant