Forum Discussion
VB.Net MyClass operator bug report
Hi guys,
I am new to this forum so sorry if this is in the wrong place.
I encountered something I would consider to be a bug in the VB.Net language. I am still using Visual Studio 2019 with a .Net Framework 4.7.2 library project so perhaps this has already been fixed in a newer release but I would like to report it just in case it has not already.
When I use the MyClass operator in a class' constructor to target a readonly auto property (which in my particular case is marked as Overloads (it overloads a readonly property of the same name but different type in the base class) and has a generic value type without any constraints) in order to assign it a value, the "Errors" pane in the bottom of my Visual Studio window says "Property '<propertyname>' is ReadOnly". However, it is an auto property so I believe it should be assignable from the constructor. When I swap out MyClass for Me it does work. Is this intended behavior or a bug.
For now I will just be using Me instead of MyClass but I am curious whether this is a known bug or not and hope to, perhaps, in the future be able to use MyClass. (Especially in my specific case due to the ambiguity of the property).
Thanks.
SgtBeen