Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Promises of different types should not be compatible #9953

@ghost

Description

TypeScript Version: nightly

Code

const x: Promise<string> = Promise.resolve("");
const y: Promise<number> = x;

Expected behavior:
Compiler error on line 2.

Actual behavior:
No error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions