Skip to content

Infer extra parameter types from default valuesΒ #17559

Closed
@falsandtru

Description

@falsandtru

TypeScript Version: nightly (2.5.0-dev.20170801)

Code

const cb: () => void = (a = 0) => a;
((cb: () => void) => cb)((a = 0) => a);

Expected behavior:

a is number type.

Actual behavior:

a is any type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions