Skip to content

CS0103 fixer for missing LHS of assignment incorrectly suggests turning missing variable into a type name. #57157

@ascott18

Description

@ascott18

Version Used:
VS 2022 17.0.0 Preview 5.0
.NET 6 rc2

Steps to Reproduce:

  1. Attempt to assign something to an undefined name (variable/field/property/param), where this name happens to be a match to an un-imported type.
  2. Pull up intellisense to run the fixer to generate a field
  3. See the first suggestions being to add using statements and turn the LHS of the assignment into a type name.

Expected Behavior:
Suggestions to add usings are not present when the error is an undefined LHS of an assignment.

Actual Behavior:
image

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions