// no errors expected class C { constructor(x: T) { } foo(x: U) { function bar(x: V) { return x; } return bar; } } var c = new C({ length: 2 }); var r = c.foo({ length: 3, charAt: (x: number) => { '' } }); var r2 = r('');