4 ms·
Hmm... did I somehow misinterpret this statement from the GP? > The important distinction is that if you tell typescript a function can take in any value it ma
by lewisl9029 9y ago
Hmm... did I somehow misinterpret this statement from the GP?
> The important distinction is that if you tell typescript a function can take in any value it makes no attempt to type check. Flow will look at each usage of the function and try to determine if the value being run through is valid.
This reads to me to mean that while annotations are optional in both systems, if you don't provide them for a particular subsystem in TypeScript, the static analysis will simply perform no checks for usages of that particular subsystem, while in Flow it will still attempt to validate your subsystem with properties it can infer on a best-effort basis from things like the way its functions are called.
- Joeri 9y agoTypescript also tries to infer types, and falls back to an implicit "any" type when it can't. Flow was better at type inference, but I don't know if it still is.