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
In the Flow vs TypeScript comparison, TypeScript has emerged as more robust and popular than Flow.
From the State of JavaScript 2018 Survey:
DefinitelyTyped has more type definitions than flow-typed.
There are also many bugs or shortcomings in Flow which do not appear to be issues in TypeScript. For example, in Flow:
class Thing<T, U> { static newThing<V>(factory: () => V) { const thing: Thing<string, V> = new Thing(factory); return thing; } items: T[]; factory: () => U; constructor(factory: () => U) { this.factory = factory; this.items = []; } } const fn: () => number = () => 0; const t: Thing<string, number> = Thing.newThing<number>(fn); const t2: Thing<string, number> = Thing.newThing<number>(() => 0);
Results in the following error:
16: const t: Thing<string, number> = Thing.newThing<number>(fn); ^ Cannot assign `Thing.newThing<...>(...)` to `t` because `V` [1] is incompatible with number [2] in type argument `U` [3]. References: 3: const thing: Thing<string, V> = new Thing(factory); ^ [1] 16: const t: Thing<string, number> = Thing.newThing<number>(fn); ^ [2] 1: class Thing<T, U> { ^ [3] 17: const t2: Thing<string, number> = Thing.newThing<number>(() => 0); ^ Cannot assign `Thing.newThing<...>(...)` to `t2` because `V` [1] is incompatible with number [2] in type argument `U` [3]. References: 3: const thing: Thing<string, V> = new Thing(factory); ^ [1] 17: const t2: Thing<string, number> = Thing.newThing<number>(() => 0); ^ [2] 1: class Thing<T, U> { ^ [3]
But, this works without issue in TypeScript.
The text was updated successfully, but these errors were encountered:
Fixed by #359.
Sorry, something went wrong.
tiffon
No branches or pull requests
In the Flow vs TypeScript comparison, TypeScript has emerged as more robust and popular than Flow.
From the State of JavaScript 2018 Survey:
DefinitelyTyped has more type definitions than flow-typed.
There are also many bugs or shortcomings in Flow which do not appear to be issues in TypeScript. For example, in Flow:
Results in the following error:
But, this works without issue in TypeScript.
The text was updated successfully, but these errors were encountered: