Skip to content

checking if a value in a dictionary exists triggers 'unnecessary-if' diagnostic #307

Description

@protocol-1903
---@type {[string]: string}
local thing = {}
if thing.test then ... end

the above code segment causes the unnecessary-if diagnostic to trigger, even though the dictionary is not complete and does not exactly contain the tested index

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions