HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by altano | Hacker News Reader
Parent
Full thread
altano
·
Why is this line an error?:
> var cats : Cat[] = [ new Cat() ]
View on HN
DCoder
·
It would not be an error if not for `addToList(cats, new Dog())`. Based on that call, Flow infers that `cats` has to be a `Dog[]`, not `Cat[]`.
Reply on news.ycombinator.com