Skip to content

Getters are not control flow analysed #8437

Description

@tinganho
class A {
    private something: string;

    public get id(): string | null {
        return null;
    }

    public doSomethingUseful() {
        if (this.id) {
            this.something = this.id; // Error can be null
        }
    }
}

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions