Skip to content

As a developer I want advanced static code analysis regarding implications between statements #2539

@mmews-n4

Description

@mmews-n4

See the example below.

Example

function f(arg1: any+) {
    const val1 = arg1?.val; // implication 1: if val1 is truthy => arg1 is also truthy
    const val2 = val1?.prop; // implication 2: if val2 is truthy => val1 is also truthy
    const query = val2 ? {
        someProp: val1.prop // here we know based on implication 2 that val1 is truthy
    } : null;
    query;
}

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