TypeScript (and Flow probably?) might be the biggest industry adopters of typestate so far.
-
-
e.g. “let foo: A | B = …; if (!(foo instanceof B)) { /* foo statically has type A in here */ } /* but here it’s A | B */
-
The TS compiler seems to be reasoning based on the CFG — stuff like “if (foo instanceof B) return; /* foo has type A here */“ works
- 6 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.