2014-07-13 01:04:16 +02:00
|
|
|
//// [contextualTypingOfObjectLiterals2.ts]
|
|
|
|
interface Foo {
|
|
|
|
foo: (t: string) => string;
|
|
|
|
}
|
|
|
|
function f2(args: Foo) { }
|
|
|
|
f2({ foo: s => s.hmm }) // 's' should be 'string', so this should be an error
|
|
|
|
|
|
|
|
//// [contextualTypingOfObjectLiterals2.js]
|
2015-03-26 21:46:35 +01:00
|
|
|
function f2(args) { }
|
|
|
|
f2({ foo: function (s) { return s.hmm; } }); // 's' should be 'string', so this should be an error
|