Open
Description
TypeScript Version: 3.3.0-dev.20190110
Search Terms: Object.assign
Code
function foo(): {foo: string} {
return Object.assign({});
}
Interestingly the code:
function bar(): {bar: string} {
return Object.assign({}, {bar: 1});
}
does report the expected error
Expected behavior: TypeScript should report an error because the type returned by return Object.assign({});
does not mach {foo: string}
but instead the type any is assumed.
Actual behavior: No error is shown
Related Issues: no