==== tests/cases/compiler/lastPropertyInLiteralWins.ts (3 errors) ==== interface Thing { thunk: (str: string) => void; } function test(thing: Thing) { thing.thunk("str"); } test({ // Should error, as last one wins, and is wrong type thunk: (str: string) => {}, thunk: (num: number) => {} ~~~~~ !!! Duplicate identifier 'thunk'. }); test({ // Should be OK. Last 'thunk' is of correct type ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ thunk: (num: number) => {}, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ thunk: (str: string) => {} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~ !!! Duplicate identifier 'thunk'. }); ~ !!! Argument of type '{ thunk: (num: number) => void; }' is not assignable to parameter of type 'Thing'. !!! Types of property 'thunk' are incompatible: !!! Type '(num: number) => void' is not assignable to type '(str: string) => void': !!! Types of parameters 'num' and 'str' are incompatible: !!! Type 'number' is not assignable to type 'string'.