Skip to content

Generated setter declarations have incorrect return type #218

@scisci

Description

@scisci

Versions of relevant software used

0.12.0

What happened

The generated return value for setters is void, but protoc actually returns this so you can chain your setters.

export class Thing extends jspb.Message {
  getId(): string;
  setId(value: string): void;
}

What you expected to happen

export class Thing extends jspb.Message {
  getId(): string;
  setId(value: string): this;
}

How to reproduce it (as minimally and precisely as possible):

Should behave the same for all messages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions