microsoft / microsoft/TypeScript

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

未关闭
#63,779 13 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@ahejlsberg 已经在做这个了。

开始于 2025年12月2日。

主要语言
Go
星标
111k
派生
14.3k
平均合并
2 天 4 小时
30 天内合并 PR
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. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。