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

Constraints of functions passed as argument are not checked #14766

Copy link
Copy link
@gcnew

Description

@gcnew
Issue body actions

TypeScript Version: nightly

Code

declare function p(x: 'hello'): 'hello';
declare function g<T extends string>(x: T): T;

declare function h(f: (x: number) => number): number;
declare function f<T extends number>(f: (x: T) => T): T;

h(p); // Error as expected
h(g); // Uncaught error
f(g); // Uncaught error

Expected behavior:
All of the above invokations should be errors.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already createdAn existing issue was already created

    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.