microsoft / microsoft/TypeScript

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

Abierto
#62,183 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Bug Domain: check: Error Instability Help Wanted Needs Human Review
Lenguaje dominante
Go
Estrellas
111k
Forks
14.3k
Merge medio
2 d 4 h
PR fusionados (30 d)
132

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la prueba inline de fourslash.ts y reproduce la secuencia de edit, signature-help, backspace y diagnostic del ejemplo de Playground. Sigue la ruta de retrigger de signature-help para la llamada a rest-parameter inferida. Se considera terminado cuando el código sin cambios no produce ningún semantic diagnostic después de eliminar la coma, mientras signature help sigue visible.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
typescript
Área
compilers
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.