TypeScript/tests/cases/conformance/statements/returnStatements/invalidReturnStatements.ts
2014-07-12 17:30:19 -07:00

20 lines
438 B
TypeScript

// all the following should be error
function fn1(): number { }
function fn2(): string { }
function fn3(): boolean { }
function fn4(): Date { }
function fn7(): any { } // should be valid: any includes void
interface I { id: number }
class C implements I {
id: number;
dispose() {}
}
class D extends C {
name: string;
}
function fn10(): D { return { id: 12 }; }
function fn11(): D { return new C(); }