Skip to content

Suggestion: interface to allow overloading variables (similar to unions in C lang) #2958

@sandeepkalra

Description

@sandeepkalra

Hi,

I have code that I want to rewrite in typescript, and for that I want to do few things that looks like this:

interface msg {
    x: number;
    Run: ()=>string;
    Run: (number) => string;
}

interface msg {
    Code: number;
    Message: string;
    Message: Object;
}

and many more similar things. Typescript has concept of 'overload' for functions. This is almost in same lines and more probably in line with "C" 'unions' style.

Is it possible to accept this as a feature request if this is not present and/or proposed yet for Typescript?

Thanks,

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