Files
tsgo/testdata/baselines/reference/submodule/compiler/contextualTypingOfObjectLiterals2.js

14 lines
439 B
TypeScript

//// [tests/cases/compiler/contextualTypingOfObjectLiterals2.ts] ////
//// [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]
"use strict";
function f2(args) { }
f2({ foo: s => s.hmm }); // 's' should be 'string', so this should be an error