Closed
Description
VB.Net input code
Private Shared ReadOnly Property StaticTestProperty() As Integer
Get
Static variable As Integer = 1
Debug.Print(variable.ToString)
variable += 1
Return variable
End Get
End Property
Erroneous output
private int _StaticTestProperty_variable = 1;
private static int StaticTestProperty
{
get
{
Debug.Print(_StaticTestProperty_variable.ToString());
_StaticTestProperty_variable += 1;
return _StaticTestProperty_variable;
}
}
static modifier is missing. Conversion of function containing shared variable works.
Expected output
private static int _StaticTestProperty_variable = 1;
private static int StaticTestProperty
{
get
{
Debug.Print(_StaticTestProperty_variable.ToString());
_StaticTestProperty_variable += 1;
return _StaticTestProperty_variable;
}
}
Details
- Product in use: VS extension
- Version in use: 8.5.0.0
- Did you see it working in a previous version, which? no