8000 Either type not expanded for overload resolution · Issue #16412 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content
Either type not expanded for overload resolution #16412
Closed
@mjbvz

Description

@mjbvz

From microsoft/vscode#28293

TypeScript Version: 2.4.0-20170609
Code

interface IFace {
	do(x: number): number
	do(x: string): string
}

function func(param: number | string, obj: IFace) {
	obj.do(param);
}

Expected behavior:
No compile errors. We have do overloads for both both types of params

Actual behavior:
Compile error. No overload found for do with argument of type number | string

// cc @roblourens

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already createdVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0