Re:Why async fn in traits are hard
by littlestymaar on Sunday October 27, 2019 @04:38AM
(#21368521)
It is. It's not visible if you the types aren't written, but under the hood, that's the type of things like this.
[ Parent
| on HN ]
Ehm. No. JavaScript will return a Promise. It’s “type” is Object as pretty much anything else in JavaScript.
Re:Why async fn in traits are hard
by endless1234 on Sunday October 27, 2019 @04:51AM
(#21368557)
But isn't a Promise for all intents and purposes the same as a Future here?
Yes, but I think they are emphasising that only a promise will be returned. Any further type information is not given
Check out structural typing. I would say it’s the type system JavaScript uses for non-primitive values. The “dynamic” appearance is just that JavaScript doesn’t center the type system in its UX.