Bug Report
π Search Terms
expression not callable union arrays
π Version & Regression Information
This changed between versions 4.1.3 and 4.2 beta
β― Playground Link
https://www.typescriptlang.org/play?ts=4.1.3#code/CYUwxgNghgTiAEYD2A7AzgF3gDwFzxQFcBbAIxBgG0BdeAH3kxgEsUBzGgKE+wDpioABwAUAM3gBeAHzxRASiA
https://www.typescriptlang.org/play?ts=4.2.0-beta#code/CYUwxgNghgTiAEYD2A7AzgF3gDwFzxQFcBbAIxBgG0BdeAH3kxgEsUBzGgKE+wDpioABwAUAM3gBeAHzxRASiA
π» Code
declare const x: number[] | string[]
x.map(f => f)
π Actual behavior
.map is now callable but f as an implicit type of any, leading to an implicit any error.
π Expected behavior
The current behaviour in 4.1.3 is to mark the map() call as not callable as well as f should have an implicit any type.
I don't know if this is a regression but I'm raising it because this change in behaviour is not documented in the release notes.