You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.
Would it make sense to expose $StrictUnion as a generic so it could be used by end users?
That would simplify the syntax end users would have to necessarily use. In my case I'm transpiling a GUI Language to js, and I don't want to add Union operator since that would increase the syntax end users have to learn. I found $Intersection, but no corresponding $Union.
describe("$StrictUnion", () => {
// todo make it work with
beforeAll(async () => {});
test("allows parseing of generic $StrictUnion", async () => {
const sourceAST = prepareAST(`
type U = $StrictUnion<bigint | number>
const a: U = 2;
`);
const [[actual], errors] = await createTypeGraph([sourceAST]);
console.log(actual, errors)
expect(errors.length).toEqual(0);
}, 5000);
});
The text was updated successfully, but these errors were encountered:
Hi @abhishiv.
Sounds good, I think we can do it.
But, I need to mention that $StrictUnion works a little bit differently than a simple union.
The difference can be shown by the next case:
Hey @JSMonk
Would it make sense to expose $StrictUnion as a generic so it could be used by end users?
That would simplify the syntax end users would have to necessarily use. In my case I'm transpiling a GUI Language to js, and I don't want to add Union operator since that would increase the syntax end users have to learn. I found $Intersection, but no corresponding $Union.
The text was updated successfully, but these errors were encountered: