TypeScript/tests/cases/conformance/types/thisType/thisTypeSyntacticContext.ts

14 lines
192 B
TypeScript
Raw Normal View History

function f(this: { n: number }) {
}
const o: { n: number, test?: (this: { n: number }) => void } = { n: 1 }
o.test = f
o.test();
o!.test();
o.test!();
o.test!!!();
(o.test!)();
(o.test)();