Skip to content

transformer: missing initializer for TypeScript class constructor when argument is readonly #4032

@Dunqing

Description

@Dunqing

In

class Boo {
  constructor(
    readonly prop: number = 0
  ) {}
}

Out

class Boo {
    constructor(prop = 0) {}
}

Expected

class Boo {
    constructor(prop = 0) {
        this.prop = prop;
    }
}

Metadata

Metadata

Assignees

Labels

A-transformerArea - Transformer / TranspilerC-bugCategory - Bug

Type

No type

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions