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
Currently the following is not discriminated during traversal:
const t = type(["string"]) .pipe((s) => s.length) .or(["boolean"]);
This is because boolean is being treated as a union and we don't identify that we could discriminate using domain.
It should be discriminated similarly to the existing test case "discriminable tuple union" where number is substituted for boolean:
number
boolean
const $ = scope({ a: () => $.type(["string"]).pipe((s) => [...s, "!"]), b: ["number"], c: () => $.type("a|b"), }); const types = $.export(); attest<[number] | ((In: [string]) => Out<string[]>)>(types.c.t); const expectedSerializedMorphs = types.a.raw.assertHasKind("morph").serializedMorphs; attest(types.c.raw.assertHasKind("union").discriminantJson).snap({ kind: "domain", path: ["0"], cases: { '"number"': { sequence: { prefix: ["number"] }, proto: "Array", exactLength: 1, }, '"string"': { in: { sequence: { prefix: ["string"] }, proto: "Array", exactLength: 1, }, morphs: expectedSerializedMorphs, }, }, });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently the following is not discriminated during traversal:
This is because boolean is being treated as a union and we don't identify that we could discriminate using domain.
It should be discriminated similarly to the existing test case "discriminable tuple union" where
number
is substituted forboolean
:The text was updated successfully, but these errors were encountered: