Microsoft/TypeScript

Confusing error message for labels used before definition

Open

#30,408 创建于 2019年3月14日

在 GitHub 查看
 (16 评论) (2 反应) (0 负责人)TypeScript (6,726 fork)batch import
Domain: Error MessagesEffort: ModerateExperience EnhancementGood First IssueHelp WantedSuggestion

仓库指标

Star
 (48,455 star)
PR 合并指标
 (平均合并 6天 17小时) (30 天内合并 9 个 PR)

描述

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

贡献者指南