Skip to content

Getter/Setter declaration emit for javascript is missing #33643

Closed
@weswigham

Description

@weswigham

The PR adding getter/setter declaration emit, and the PR adding the JS declaration emitter (both merged this week), did not really interact. So the JS declaration emitter is currently missing emit for getter/setter pairs. This in JS:

class Q {
    get x() {
        return 12;
    }
}

currently emits this declaration file:

declare class Q {
    readonly x: number;
}

when it should be

declare class Q {
    get x(): number;
}

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions