Skip to content

Confusing error message for labels used before definition #30408

@paulvanbrenk

Description

@paulvanbrenk

The following gives me an unexpected "TS1007: Jump target cannot cross function boundary error" in TS 3.3.33333

function foo() {
    for (let i = 0; i < 10; i++) {
        console.log(`${i}`);
        continue loopend;
    }

    loopend:
    console.log('end of loop');
}

Further investigation... you can jump to the start of the loop, so the error I would argue is that the error message is confusing.

shareable link

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: Error MessagesThe issue relates to error messagingEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Experience EnhancementNoncontroversial enhancementsGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do thisSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions