TypeScript/tests/cases/compiler/fuzzy.ts
2014-07-12 17:30:19 -07:00

30 lines
536 B
TypeScript

module M {
export interface I {
works:()=>R;
alsoWorks:()=>R;
doesntWork:()=>R;
}
export interface R {
anything:number;
oneI:I;
}
export class C implements I {
constructor(public x:number) {
}
works():R {
return <R>({ anything: 1 });
}
doesntWork():R {
return { anything:1, oneI:this };
}
worksToo():R {
return <R>({ oneI: this });
}
}
}