4 ms·
Why is this line an error?: > var cats : Cat[] = [ new Cat() ]
by altano 11y ago
Why is this line an error?:
> var cats : Cat[] = [ new Cat() ]
- deleted 11y ago[deleted]
- DCoder 11y agoIt 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[]`.