microsoft / microsoft/TypeScript

The last overload gave the following error. Type 'unknown' is not assignable to type 'Foo'

Offen
#63,779 13 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@ahejlsberg arbeitet bereits daran.

Seit 02.12.2025.

Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
132

Beschreibung

I started to get this error today after updating vscode extension to this version:

```
Identifier
typescriptteam.native-preview
Version
0.20250821.1
Last Updated
2025-08-21, 09:18:07
```

```
No overload matches this call.
The last overload gave the following error.
Argument of type 'DialogConfig, DialogRef>, BasePortalOutlet>' is not assignable to parameter of type 'DialogConfig, DialogRef>, BasePortalOutlet>'.
Types of property 'providers' are incompatible.
Type 'StaticProvider[] | ((dialogRef: DialogRef>, config: DialogConfig, DialogRef<...>, BasePortalOutlet>, container: BasePortalOutlet) => StaticProvider[]) | undefined' is not assignable to type 'StaticProvider[] | ((dialogRef: DialogRef>, config: DialogConfig, DialogRef<...>, BasePortalOutlet>, container: BasePortalOutlet) => StaticProvider[]) | undefined'.
Type '(dialogRef: DialogRef>, config: DialogConfig, DialogRef<...>, BasePortalOutlet>, container: BasePortalOutlet) => StaticProvider[]' is not assignable to type 'StaticProvider[] | ((dialogRef: DialogRef>, config: DialogConfig, DialogRef<...>, BasePortalOutlet>, container: BasePortalOutlet) => StaticProvider[]) | undefined'.
Type '(dialogRef: DialogRef>, config: DialogConfig, DialogRef<...>, BasePortalOutlet>, container: BasePortalOutlet) => StaticProvider[]' is not assignable to type 'StaticProvider[] | ((dialogRef: DialogRef>, config: DialogConfig, DialogRef<...>, BasePortalOutlet>, container: BasePortalOutlet) => StaticProvider[])'.
Type '(dialogRef: DialogRef>, config: DialogConfig, DialogRef<...>, BasePortalOutlet>, container: BasePortalOutlet) => StaticProvider[]' is not assignable to type '(dialogRef: DialogRef>, config: DialogConfig, DialogRef<...>, BasePortalOutlet>, container: BasePortalOutlet) => StaticProvider[]'.
Types of parameters 'dialogRef' and 'dialogRef' are incompatible.
Type 'DialogRef>' is not assignable to type 'DialogRef>'.
The types of 'config.providers' are incompatible between these types.
Type 'StaticProvider[] | ((dialogRef: DialogRef>, config: DialogConfig>, DialogContainer>, container: DialogContainer) => StaticProvider[]) | undefined' is not assignable to type 'StaticProvider[] | ((dialogRef: DialogRef>, config: DialogConfig, DialogContainer>, container: DialogContainer) => StaticProvider[]) | undefined'.
Type '(dialogRef: DialogRef>, config: DialogConfig>, DialogContainer>, container: DialogContainer) => StaticProvider[]' is not assignable to type 'StaticProvider[] | ((dialogRef: DialogRef>, config: DialogConfig, DialogContainer>, container: DialogContainer) => StaticProvider[]) | undefined'.
Type '(dialogRef: DialogRef>, config: DialogConfig>, DialogContainer>, container: DialogContainer) => StaticProvider[]' is not assignable to type 'StaticProvider[] | ((dialogRef: DialogRef>, config: DialogConfig, DialogContainer>, container: DialogContainer) => StaticProvider[])'.
Type '(dialogRef: DialogRef>, config: DialogConfig>, DialogContainer>, container: DialogContainer) => StaticProvider[]' is not assignable to type '(dialogRef: DialogRef>, config: DialogConfig>, DialogContainer>, container: DialogContainer) => StaticProvider[]'.
Types of parameters 'dialogRef' and 'dialogRef' are incompatible.
Type 'DialogRef>' is not assignable to type 'DialogRef>'.
Type 'ModalConfirmation' is not assignable to type 'ModalConfirmation'.
Type 'unknown' is not assignable to type 'NeighborOut'.ts(2769)
```

The methods the error above is referencing are from "@angular/cdk": "20.2.0"

```
/**
* Opens a modal dialog containing the given component.
* @param component Type of the component to load into the dialog.
* @param config Extra configuration options.
* @returns Reference to the newly-opened dialog.
*/
open(component: ComponentType, config?: DialogConfig>): DialogRef;
/**
* Opens a modal dialog containing the given template.
* @param template TemplateRef to instantiate as the dialog content.
* @param config Extra configuration options.
* @returns Reference to the newly-opened dialog.
*/
open(template: TemplateRef, config?: DialogConfig>): DialogRef;
open(componentOrTemplateRef: ComponentType | TemplateRef, config?: DialogConfig>): DialogRef;
```

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.