microsoft / microsoft/TypeScript
TS4082 occurs when using `composite: true`
オープン
まだ誰も着手していません。
Needs More Info
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
Bug Report
🔎 Search Terms
TS4082, composite
🕗 Version & Regression Information
- I was unable to test this on prior versions because
compositeis a new feature added to typescript (not actually)
⏯ Playground Link
Playground link with relevant code
💻 Code
// This throws
export default (
a = () => {
interface Props {}
return {} as Props
},
) => {};
// This works
let a = () => {
interface Props {}
return {} as Props
}
🙁 Actual behavior
When composite is enabled, the export default statement throws TS4082. And disabling composite fixes this issue.
🙂 Expected behavior
They should both throw, or both not throw :(
This issue only occurs when using an interface. Using a type alias won't cause this issue.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、compositeを有効にした状態でリンク先のTypeScript Playgroundの再現コードを実行し、exportされたコールバックとローカルのコールバック、およびinterfaceの場合とtype-aliasの場合を比較します。TS4082を報告するコンパイラの経路を追跡して回帰テストを追加します。完了条件は、既存のtype-aliasの場合を後退させることなく、同等な2つのコールバック形式が一貫した動作をすることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100