Skip to content

IIFEs should not be CFA-inlined if the FE is a generator function #30907

@RyanCavanaugh

Description

@RyanCavanaugh

This is an incorrect error because generators don't run on invocation

function wrapI() {
    const iter = (function* foo() {
        iter; // use before def error
        yield 1;
    })();
}

cc @bterlson

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions