Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Generics with 'extends' for return types cause type check failure. #13993

Copy link
Copy link
@na-o-ys

Description

@na-o-ys
Issue body actions

TypeScript Version: 2.2.0

Code

interface I { attr: string }

type M = <T extends I>() => T
const v: M = () => ({})

v().attr

Expected behavior:

Type '() => {}' is not assignable to type 'M'. Type '{}' is not assignable to type 'I'.

Actual behavior:

The compilation is successful.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueA PR has been merged for this issueNeeds InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.