Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks for fields with 2 modifiers #6

Open
rMazeiks opened this issue Apr 21, 2021 · 1 comment
Open

Breaks for fields with 2 modifiers #6

rMazeiks opened this issue Apr 21, 2021 · 1 comment

Comments

@rMazeiks
Copy link

When confronted with...

class Foo {
  private readonly bar: string;
  private readonly baz: number;
}

...the tool should output...

    public getBar(): string {
        return this.bar;
    }

    public getBaz(): number {
        return this.baz;
    }

...but instead generates...

    public getReadonly(): bar: {
        return this.readonly;
    }

    public setReadonly(readonly: bar:): void {
        this.readonly = readonly;
    }

    public getReadonly(): baz: {
        return this.readonly;
    }

    public setReadonly(readonly: baz:): void {
        this.readonly = readonly;
    }

With only the private modifier, everything works as expected. With only the readonly modifier, getters are generated correctly, but setters are also generated, even though they shouldn't be. It would be nice if the extension supported such corner cases.

@rMazeiks
Copy link
Author

Likely related to #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant