Skip to content

Annoying IntelliSense behavior with multiply defined variables (18.3.0 Insiders [11109.51.main] but probably also 17.14) #80730

@dpugh

Description

@dpugh

IntelliSense doesn't list ambiguous variables (e.g. variables that are multiply defined) leading to some unfortunate behavior if quickly type something followed by expecting the variable.

I am rewriting this function to add “double width” to the parameter list. Note this causes an error on line 90 – since I define a local variable of that name there – but there is no indication of an error on line 73.

Image

I then – on line 83 – type “if (wid” expecting to get the width parameter but instead – before the tab – I get this, so tab selects CaretWidthOption. Imagine how confusing this is if I’m working in a larger function.
My expectation is that things like IntelliSense would use the preceding definition of width rather than suppressing it entirely because there’s an error or ambiguity.

Image

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