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

Fix discriminant caching issue #962

Open
ssalbdivad opened this issue May 21, 2024 · 0 comments
Open

Fix discriminant caching issue #962

ssalbdivad opened this issue May 21, 2024 · 0 comments

Comments

@ssalbdivad
Copy link
Member

ssalbdivad commented May 21, 2024

This tests passes in isolation but fails when run with the rest of the repo:

I've noticed that foo: "Function" incorrectly gets pruned to foo: "object" in this case but can't figure out where.

it("multiple switch", () => {
  const types = scope({
    a: { foo: "string" },
    b: { foo: "number" },
    c: { foo: "Function" },
    d: "a|b|c",
  }).export();
  // attest(types.d({}).toString()).snap(
  // 	"foo must be a number, an object or a string (was undefined)"
  // )
  // this could be improved, currently a bit counterintuitive because of
  // the inconsistency between `domainOf` and typeof
  attest(types.d({ foo: null }).toString()).snap(
    "foo must be a function (was null)"
  );
});
@ssalbdivad ssalbdivad changed the title Fix discriminant caching issue. This tests passes in isolation but fails when run with the rest of the repo: Fix discriminant caching issue May 31, 2024
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