I have a vanilla JavaScript file using Flow, like so:
// @flow
/*:: type orderType = number; */
let ot = 0 /*:: as orderType */;
but I get error
Invalid type cast syntax. Use the form
(<expr>: <type>)instead of the form<expr> as <type>.
However, trying that syntax also gives me an error:
let ot = 0 /*:: : orderType */; // ■■■■ Unexpected token `:`, expected the token `;`
Is type-casting with type-alias not working with comment types in Flow?
Correct syntax seem to be
assuming you use
numberand notNumber.