Skip to content

TS 3.7: --declaration output for getter only property now is a getter instead of readonly #33939

Closed
@mjbvz

Description

@mjbvz

TypeScript Version: 3.7.0-dev.20191010

Search Terms:

  • --declaration
  • getter
  • d.ts

Repo:
For the TS file foo.ts:

export class Foo {
    get bar(): boolean { return true; }
}
  1. Run tsc foo.ts --declaration

Expected
In TS 3.6, the output d.ts uses readonly:

export declare class Foo {
    readonly bar: boolean;
}

Actual behavior:
In TS 3.7, the output d.ts use a getter instead:

export declare class Foo {
    get bar(): boolean;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions