microsoft / microsoft/TypeScript

Ghost error appearing after signature help in inferred signatures with rest parameter

オープン
#62,183 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
Bug Domain: check: Error Instability Help Wanted Needs Human Review
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

### 🔎 Search Terms

signature help inference signature rest spread nested

### 🕗 Version & Regression Information

- This is the behavior in every version I tried

### ⏯ Playground Link

https://www.typescriptlang.org/play/?ts=6.0.0-dev.20250803#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDgBQTGEwCMAbPAbwCg44wjgAeAQQBo4AhOAXjiTAAbmgB8AChgALBAGcAXHA5wyi8QH1FrAJR9R3bYq4BuGgF8aNGAE9icAMIQhmKAkwo2+-hsWCRUXV59VlMaZFQMHDwANRc3JFwAZRgoAFdsGGYIVPhlbPgAUU58uAAlfVp6KBIAEwgkcms4dWjFWRTkAHNTKtr6xubWRUdnV3dM1lEeuGrMOoam9QLhpzjx5gKpuhm+hebSldH4zPLTCxoa4GxyFzxseva4AvR0K5gAFVtgAEkaxVSkAgAI6pPCyawAW1IEHIoXCaCwuDgsTGCRYJTyOSexSx5TglR2c36TQA2s9XhlPsRfgBdRQo+JJFLpCacIplLbneGRJHkt5ZLGYwp8ATCNA4+ClEV+MTbUCoJA1WTItZothszjldjbeiEYhkSj4rkoBFRBw3WSyZgAMQQwHISv08uAiuVepIFGo20EAHc4OJDHBbfalWdLNzEXh3phOp1gDUClAoNB7BardHOnBna64O1XEhOpxgw7ZE6QAqlebMJabXaSxVtrN5gN1DAY4oM2GLlcbtU4PckI8M3GE0noGoEJcUAh0HaoAB+NodAuBfTMbYZrPll2VvNdbX0YtKmgSbZtzodmMHuCzkOyADyUEUR9kNFXcGH8cTyagqerVo3K9tgJXoiT2Vt2w-GNpgsLZu2uW5+weeByAgC9-W2AA6bCIWAS0Y2ARRSl2RpWCTTBrGYdxrFEN89CeF5+SECBJ04GUoDYsUoDg0BIFgJDB3gbBMFQTpoDtWQAGlgCafgACIAAFgEYjIAHo0B-VThNE8S8Lk0JeOgeBLgQvsB0eH0EGkewROAMSoGsRRmBsnTXDwrcK2VMioAo5h8GTYhYGsaSaNPehsMw7S7N0hQHFs+yJLooI4DYKBOmVbNK283zqNETVgBgTh7A8ndlSoUU-XECKXHSrQ0tkQNiPgMwwocYYkv0YqADJ8W9YBKuq+q6vSxqCrgHqQLgEkooSvCQrpfEppcxAkDi1yJJJJBUihNAaQW5k8DMGCzgM8AjLgGw7FYchyBCq1NhFAoSpzcrpvimL5sUZBXigOAAEU4Aseh5zgABrGSIHQf7tl8LjTEM-jLrwApyx8jJrvIDYipEjLtxzfyIECmwQq8Nbcc8lQkGsbYQZRlIcEydlXpmj6ZIW17JJWsmFuowHAdo+hYf8U6+OMntEPMoSROwKQXOihynO2Iptkltb5Yk56svIyiMbujZRDy7ZWAAJmvApTe2UpjZPcQsOwmrYpJHU4AiuXZtka96HQNQNMUOm0ZgDGsbV93Nu20hdtEd8+QyNhTaeeOrYFuAaQ6lLlHKW36GUikYD9lTWWxDk05jiY4AAHyUePzYrp4QGuVJLmD-2GaD9k3ZisOdqgGkDc1Wuk9CBDLSDCAIG-aBNeVT9Rx-ANxDk60x4nqA5M4KgzG0TDGGILO4Es6z3oche6ghTBkDk7Q6I3yxh+VLgXBXqeoNjL8xygee5IfqAV7Xo0t53sAPeB9ZZH2sAvcE7RgAQj-nJU+58kCX2vucO+3BMAAC8n6ZWnjGEcK9P4P0we-P+G8AFMGAVZUBrlwFyUgagGBV9dA33gr2O4yE4CkAwWobYIBfDhzQCXAuzB2JFmXu-Wu38n6V0ISvTi-geJnX4qrMAyZOg+QhCKTh6DxAAEYyG720jLDux84EQDPhfTgGh3yoU6BoTCEFOjaCcaESwri3FAA

### 💻 Code

```ts
///

// @strict: true
// @target: esnext
// @lib: esnext

//// export interface Pipeable {
//// pipe(this: A, ab: (_: A) => B): B;
//// }
////
//// type Covariant = (_: never) => A;
////
//// interface VarianceStruct {
//// readonly _V: string;
//// readonly _A: Covariant
;
//// readonly _E: Covariant;
//// readonly _R: Covariant;
//// }
////
//// declare const EffectTypeId: unique symbol;
////
//// interface Variance {
//// readonly [EffectTypeId]: VarianceStruct;
//// }
////
//// interface Effect
//// extends Variance,
//// Pipeable {}
////
//// interface Class extends Pipeable {
//// new (): Fields;
//// }
////
//// interface TaggedErrorClass extends Class {
//// readonly _tag: Tag;
//// }
////
//// declare const TaggedError: (identifier?: string) => <
//// Tag extends string,
//// Fields
//// >(
//// tag: Tag,
//// fieldsOr: Fields
//// ) => TaggedErrorClass<
//// Tag,
//// {
//// readonly _tag: Tag;
//// }
//// >;
////
//// declare const log: (
//// ...message: ReadonlyArray
//// ) => Effect;
////
//// export const categoriesKey = "@effect/error/categories";
////
//// export declare const withCategory: >(
//// ...categories: Categories
//// ) => , Ret, C extends { new (...args: Args): Ret }>(
//// C: C
//// ) => C & {
//// new (...args: Args): Ret & {
//// [categoriesKey]: { [Cat in Categories[number]]: true };
//// };
//// };
////
//// export type AllKeys = E extends { [categoriesKey]: infer Q }
//// ? keyof Q
//// : never;
//// export type ExtractAll = Cats extends any
//// ? Extract
//// : never;
////
//// export declare const catchCategory: <
//// E,
//// const Categories extends Array>,
//// A2,
//// E2,
//// R2
//// >(
//// ...args: [
//// ...Categories,
//// f: (err: ExtractAll) => Effect
//// ]
//// ) => (
//// effect: Effect
//// ) => Effect
>, R | R2>;
////
//// class FooError extends TaggedError()("FooError", {}).pipe(
//// withCategory("domain")
//// ) {}
////
//// class BarError extends TaggedError()("BarError", {}).pipe(
//// withCategory("system", "domain")
//// ) {}
////
//// class BazError extends TaggedError()("BazError", {}).pipe(
//// withCategory("system")
//// ) {}
////
//// declare const baz: (
//// x: number
//// ) => Effect;
////
//// export const program = baz(1).pipe(catchCategory("domain",/*1*/ (_) => log(_._tag)));

verify.getSemanticDiagnostics([]);
goTo.marker("1");
edit.insert(",");
verify.signatureHelpPresentForTriggerReason({
kind: "characterTyped",
triggerCharacter: ",",
});
edit.backspace(1);
verify.signatureHelpPresentForTriggerReason({
kind: "retrigger",
});
verify.getSemanticDiagnostics([]);
```

### 🙁 Actual behavior

It's sometimes a little bit tricky to reproduce it in the playground but steps are pretty easy:
1. position ur cursor after `"domain",` in the last statement
2. insert `,`
3. this should trigger the signature help
4. now remove the inserted comma character
5. the signature help should still be visible at this point
6. error is reported

### 🙂 Expected behavior

Given the code is exactly the same at the step 6 as it is before any steps are taken, I don't expect this code to report any errors. Any edit outside of the `catchCategory`'s argument list makes the error go away (a further indication the error should not be there) but edits inside that argument list don't make it go away.

### Additional information about the issue

_No response_

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

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

調査の方向性

inline fourslash.ts テストから始め、Playground の例で edit、signature-help、backspace、diagnostic のシーケンスを再現します。推論された rest-parameter の呼び出しに対する signature-help retrigger path を追跡します。カンマを削除した後、変更されていないコードが semantic diagnostic を生成せず、signature help が表示されたままであれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
compilers
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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