This project is read-only.


Generics and recursion in 0.9.1


I've upgraded from to 0.9.1, and this code started to produce compile errors
export module M {

    export interface IFoo<A> {
        a: A;

    export function foo<A>(fn: (ifoo: IFoo<A>) => void ): void {
        // some code
error TS2049: Parameter 'ifoo' of exported function is using inaccessible module 'filename.ts'.
It worked in previous version of tsc.

Upd: When I move cursor over 'fn' in VS, it shows correct type: 'fn: (ifoo: IFoo<A>) => void'
If I hover 'ifoo', VS shows it's type is 'any'
Closed Nov 19, 2013 at 9:32 PM by RyanCavanaugh
Thanks for reporting this! The issue has been fixed and can be tried out in the upcoming 0.9.5 release. We also have a beta available ( if you'd like to try it out.


schungx wrote Aug 7, 2013 at 10:45 AM

Seems to work if the function is abstracted into an interface:
export interface FooFunc<A>{ (ifoo: IFoo<A>): void; }

export function foo<A>(fn: FooFunc<A>): void { ... }

RyanCavanaugh wrote Aug 7, 2013 at 4:41 PM

Marking active.