Microsoft/TypeScript

Confusing error message for labels used before definition

オープン

#30,408 opened on 2019/03/14

 (16 件のコメント) (2 件のリアクション) (0 人の担当者)TypeScript (13,395 件のフォーク)batch import
Domain: Error MessagesEffort: ModerateExperience EnhancementGood First IssueHelp WantedSuggestion

Repository metrics

Stars
 (108,860 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド