Why no missing error ?
interface User {
// way 1
foo(): string;
foo2(x:number): string;
// way 2
normal: () => string;
normal2: (x:number) => string;
}
let user: User = {
// way 1
foo: () => '',
foo2: () => '', // why no error since x is missing
// way 2
normal: () => '',
normal2: () => '', // why no error since x is missing
};
See this Typescript Playground
userand received errors as expected - not sure why there's no error in their definition.