Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
RyanCavanaugh opened this issue Apr 12, 2019 · 3 comments · Fixed by #55279
Closed

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

RyanCavanaugh opened this issue Apr 12, 2019 · 3 comments · Fixed by #55279
Labels
Bug A bug in TypeScript
Milestone

Comments

@RyanCavanaugh
Copy link
Member

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

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Apr 12, 2019
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Apr 12, 2019
@bterlson
Copy link
Member

Note that this also applies to async generators which have similar semantics when immediately invoked.

@DanielRosenwasser
Copy link
Member

Weird because #23565 was already fixed?

@ajafff
Copy link
Contributor

ajafff commented Apr 13, 2019

The use before define check doesn't use the control flow graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants