Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
altano
· 10y ago · 0 comments
Why is this line an error?:
> var cats : Cat[] = [ new Cat() ]
Comments
[–]
DCoder
10y ago
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[]`.