microsoft / microsoft/TypeScript

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

オープン
#63,779 コメント 13 件 リアクション 0 件 担当者 1 名 GitHub で見る

@ahejlsberg がすでに取り組んでいます。

2025年12月2日 から。

主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

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;
```

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

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

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