镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

generic constraint not working #3720

Description

This compiles cleanly:

function foo <T extends { someNumber: number }> (thingWithId: T): T {
    return thingWithId;
}

[1,2].map(foo);

and obviously, numbers don't have a someNumber numeric property.

Activity

  1. RyanCavanaugh commented on Jul 2, 2015

    @RyanCavanaugh
    Member

    See #3410 as mentioned in the Stack Overflow answer

  2. mhegazy commented on May 18, 2017

    @mhegazy
    Contributor

    tracked by #5616

  3. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions