TypeScript/tests/cases/compiler/objectLiteralFunctionArgContextualTyping2.ts

13 lines
283 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
interface I2 {
value: string;
doStuff: (t: string) => string;
}
function f2(args: I2) { }
f2({ hello: 1 })
f2({ value: '' })
f2({ value: '', what: 1 })
f2({ toString: (s) => s })
f2({ toString: (s: string) => s })
f2({ value: '', toString: (s) => s.uhhh })