Microsoft/TypeScript

Confusing error message for labels used before definition

Open

#30 408 ouverte le 14 mars 2019

Voir sur GitHub
 (16 commentaires) (2 réactions) (0 assignés)TypeScript (6 726 forks)batch import
Domain: Error MessagesEffort: ModerateExperience EnhancementGood First IssueHelp WantedSuggestion

Métriques du dépôt

Stars
 (48 455 stars)
Métriques de merge PR
 (Merge moyen 6j 17h) (9 PRs mergées en 30 j)

Description

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

Guide contributeur