Skip to content

Extra write-only property when not expected #197

@FransBosuil

Description

@FransBosuil

A class that contains a GetAccessor and a SetAccessor with the same name is converted into a class that contains 2 properties with the same name but with different modifiers. The second modifier is "write-only" which makes the flow check throw a [cannot-read] error because the property is not readable.

Can you please indicate how this can be resolved without touching the typescript file? Thank you.

Input
export declare class ABC { get id(): string | number; set id(value: number | string); }

Output
declare export class ABC { id: string | number; -id: any; }

Error

Cannot get abc.id because property id is not readable. [cannot-read]

     419│           ....some((abc) => ids.has(abc.id))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions