Skip to content

don't support multiple constructors? #16518

@GerryLon

Description

@GerryLon

TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)

Code

// A *self-contained* demonstration of the problem follows...
class Person {
    private name: string;

    constructor() {
        
    }

    constructor(name: string) {
        this.name = name;
    }
}

Expected behavior:
compile pass

Actual behavior:
error: Multiple constructor implementations are not allowed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions