Closed
Description
TypeScript Version: 2.1.1 / nightly (2.2.0-dev.201xxxxx)
See next code, also in This playground.
Code
interface F {
(p: {a:number}): {a: string}
}
// there are no type check for extra keys
// but F interface has return type
let g: F = ({a}) => ({
a: '5',
b: '',
})
// we need to do that!, but F interface also has return type
let f: F = ({a}): {a: string} => ({
a: '5',
b: '',
})
Expected behavior:
'g' function should be detected as an error, because return type of interface F doesn't have key 'b', just haves 'a' key
Actual behavior:
'g' function doesn't display any error