Skip to content

any type in callback parameter #1584

Closed
Closed
@NN---

Description

@NN---

Is it intended behavior ?

function x(f: (g: number) => void): void { f(1); }

x(function (d) {
   // d is number
});

Adding parentheses around the function makes 'd' to be any type:

function x(f: (g: number) => void): void { f(1); }

x((function (d) {
  // d is any
}));

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