Skip to content

Varible name suggested same as foreach varible name #31304

@vsfeedback

Description

@vsfeedback

In 15.8.7
Using the following code makes Visual Studio suggest I use the name item for class Item, even though that name is already defined.

Note that var is NOT an Item class.

This is obviously incorrect as there will be two different varibles with the same item name.

foreach (var item in returnedShipment.items)
{
  shipment.itemReferences.Add(item.item_reference);
  Item <name item is suggested here>
}

devenv_2018-10-18_11-01-46 2

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/361110/varible-name-suggested-same-as-foreach-varible-nam.html
VSTS ticketId: 708453

These are the original issue comments:
(no comments)
These are the original issue solutions:
(no solutions)

Metadata

Metadata

Assignees

Labels

Area-IDEBugDeveloper CommunityThe issue was originally reported on https://developercommunity.visualstudio.comResolution-FixedThe bug has been fixed and/or the requested behavior has been implemented

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions