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]
|
|
|
|
function f2(args) {
|
|
|
|
}
|
2014-08-16 00:49:09 +02:00
|
|
|
f2({ foo: function (s) { return s.hmm; } }); // 's' should be 'string', so this should be an error
|