Skip to content

Make call to super() implicit within constructor #5910

Closed
@nippur72

Description

@nippur72

Calling super() within a constructor is a bit redundant and annoying... can we have it called implicitly if call to super is omitted?

For example this

class Manager extends Employee {
   constructor() {
      this.title = "The Manager";
   }
}

should be equivalent to

class Manager extends Employee {
   constructor() {
      super(); // call to default constructor added implicitly      
      this.title = "The Manager";
   }
}

(C# also does a similar thing and it's a nice feature).

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeclinedThe issue was declined as something which matches the TypeScript visionOut of ScopeThis idea sits outside of the TypeScript language design constraintsSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions