Skip to content

"Lexical environment is suspended" when using visitEachChild from nightly transformer API (2.3.0-dev) #15192

@fabiandev

Description

@fabiandev

I'm experiencing issues with visitEachChild for e.g. a variable declaration when using the transformer API from the nightly builds.

TypeScript Version: 2.3.0-dev.20170414

Code

Sample code to transform:

let a: () => any;

Minimal transformer:

function transformer(context) {
    const visitor = node => {
        return ts.visitEachChild(node, visitor, context);
    };

    return sf => ts.visitNode(sf, visitor);
}

@rkirov pointed out, that a "minimal repro is input function f(a: () => null) {} with the identity transformer (i.e. just calling visitEachChild with (n) => n" (see #13940 (comment))

Expected behavior:

Should run without errors.

Actual behavior:

Error: Debug Failure. False expression: Lexical environment is suspended.

I've reproduced the error on runkit: https://runkit.com/fabiandev/58e571bd9383e400145e1245

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions