microsoft / microsoft/TypeScript

Issues with Pick causes tsc (on Node12/Win10?) to hang.

オープン
#31,943 コメント 5 件 リアクション 0 件 担当者 1 名 GitHub で見る

@RyanCavanaugh がすでに取り組んでいます。

2019年6月17日 から。

Needs Investigation
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

TypeScript Version: 3.5.2

Search Terms: Pick, mapped types

Problem: Unfortunately, I've not been able to reproduce outside my project in small whittled down samples, but the problem causes tsc to hang and as a result really needs to be investigated. The idea is as follows: I have an interface StoreState which has (among other properties some of which use mapped types) a property called windows. Therefore, the type Pick<StoreState, 'windows'> should be equivalent to { windows: StoreState['windows'] }. Within the content of one of my files, I cast a variable as the latter type and it works like a charm.

const { windows } = state as { windows: StoreState['windows'] };

However if instead I try to clean the code up by using the Pick, it causes the tsc process (and VS code if it's open to that file and I attempt to hover) to hang, take up tons of memory (node/tsc were at over 2gb before I killed it) and never complete the compilation.

Stranger still is that within the same project, but in a different file, I write the following with no issue.

const { windows }: Pick<StoreState, 'windows'> = ...

Due to corporate rules I can't simply upload this project to github, however if someone directly from microsoft (i.e. @RyanCavanaugh) sends me a private message, I could send them a zip file of the source, pointing out where to find the issue. I'm well aware that no one in this forum is interested in my app (especially at this nascent phase in its buildout), but I'm not risking getting fired in order to file a bug when I have an acceptable workaround.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。