Even as an avid TypeScript and Flow user, I think reserving `:` for types was a big mistake that didn't even really work.
-
-
True... Without running/checking it, I currently have no idea how that'll be represented.
-
in TS and Flow, it's function foo(options) { let { x: string } = options; } (not what you want)
-
Right... No problems with `let x = [ ]; foo({x: Array})`? or something similar, when the right-hand side can be a type or value?
-
that isn't so bad in TS, because `:` isn't used for casting. potentially ambiguous with foo({ (x: Array) }) in Flow-not so bad
-
Thanks for the explanations :)
End of conversation
New conversation -
-
-
I can't see what is wrong here yet. Could you please explain why a massive fail? And why is destructuring broken?
-
The problem is that it's not destructuring as you just thought, but it's defining the type of x.
End of conversation
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.