Skip to content

"Use auto property" code fix loses initialized value #26256

@davkean

Description

@davkean

Version Used: Version 15.7.0 Preview 4.0 [27612.3001.d15.7stg]

Steps to Reproduce:

Public Class Class1
    Private Shared ReadOnly s_editorGuid As New Guid("{04b8ab82-a572-4fef-95ce-5222444b6b64}") <!-- Use auto property

    'Exposing the GUID for the rest of the assembly to see
    Public Shared ReadOnly Property EditorGuid() As Guid
        Get
            Return s_editorGuid
        End Get
    End Property
End Class

Expected Behavior:

I think this is the valid transformation but don't quote me on it:

Public Class Class1

    'Exposing the GUID for the rest of the assembly to see
    Public Shared ReadOnly Property EditorGuid() As Guid = New Guid("{04b8ab82-a572-4fef-95ce-5222444b6b64}")

End Class

Actual Behavior:

Public Class Class1

    'Exposing the GUID for the rest of the assembly to see
    Public Shared ReadOnly Property EditorGuid() As Guid
End Class

Metadata

Metadata

Assignees

Labels

Area-IDEBugResolution-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