Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Private Property incorrectly marked as unused in VB.NET VS 2022 IDE0051 #61640

Open
vsfeedback opened this issue Jun 1, 2022 · 1 comment
Open
Labels
Area-IDE Bug Feature - IDE0051 help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Milestone

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


Module Program
  Sub Main()
    Test().Wait()
  End Sub

  Async Function Test() As Task
    Await Task.Delay(1)
    Call New SomeValue(17).Output()
  End Function
End Module

Public Class SomeValue
  Private Property Value1 As Integer  '<- Intellisense incorrectly marks IDE0051 here
  Public Property Value2 As Integer  '<- Works ok
  Public Event Released()

  Public Sub New(Value As Integer)
    _Value1 = Value
    _Value2 = Value
  End Sub

  Public Sub Output()
    Console.WriteLine(_Value1)
    Console.WriteLine(_Value2)
  End Sub
End Class




Original Comments

Feedback Bot on 5/26/2022, 06:05 PM:

(private comment, text removed)


Original Solutions

(no solutions)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 1, 2022
@Youssef1313
Copy link
Member

This behavior looks correct to me. The property is indeed unused. _Value1 refers to the backing field.

@vatsalyaagrawal vatsalyaagrawal added Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 2, 2022
@vatsalyaagrawal vatsalyaagrawal added this to the Backlog milestone Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Feature - IDE0051 help wanted The issue is "up for grabs" - add a comment if you are interested in working on it
Projects
None yet
Development

No branches or pull requests

4 participants