TypeScript/tests/cases/compiler/callOnInstance.ts

10 lines
263 B
TypeScript
Raw Normal View History

2014-10-01 02:15:18 +02:00
declare function D(): string; // error
2014-07-13 01:04:16 +02:00
2014-10-01 02:15:18 +02:00
declare class D { constructor (value: number); } // error
2014-07-13 01:04:16 +02:00
var s1: string = D(); // OK
var s2: string = (new D(1))();
declare class C { constructor(value: number); }
(new C(1))(); // Error for calling an instance