microsoft / microsoft/TypeScript

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

Ouverte
#62,183 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Bug Domain: check: Error Instability Help Wanted Needs Human Review
Langage dominant
Go
Étoiles
111k
Forks
14.3k
Merge moyen
2 j 4 h
PR mergées (30 j)
132

Description

### 🔎 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_

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par le test inline fourslash.ts et reproduisez la séquence edit, signature-help, backspace et diagnostic dans l’exemple Playground. Suivez le signature-help retrigger path pour l’appel de rest-parameter inféré. C’est terminé lorsque le code inchangé ne produit aucun semantic diagnostic après la suppression de la virgule, tandis que signature help reste visible.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
compilers
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.