Closed
Description
Bug Report
π Search Terms
object.assign return type
π Version & Regression Information
Faced this problem in the 4.3.2 version and checked on 4.3.5, 4.4.0-beta(problem still exists)
β― Playground Link
Playground link with relevant code
π» Code
type SomeData = { a: number };
const getSomeData = (): SomeData | undefined => {
return undefined;
}
// expected data type: SomeData | undefined
// actual data type: SomeData
const data = Object.assign({}, getSomeData())
π Actual behavior
Incorrect type inference
π Expected behavior
Correct type inference