Skip to content

Unable to constrain the callback function parameter length #6416

@falsandtru

Description

@falsandtru

Generalization of #4241.

type F   = (cb: (a: number, b: string) => number) => number;
var f: F = (cb: (a: number) => number) => cb(0); // should be a compile error
f((a, b) => a + b.length); // runtime error

Metadata

Metadata

Assignees

No one assigned

    Labels

    By DesignDeprecated - use "Working as Intended" or "Design Limitation" instead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions