Well, I am completely confused here. I have a class ... say MyClass . It has several properties of another class of my type, say MyHelperClass (along with other properties).
I do the following:
Dim inst As MyClass = New MyClass() With { .p1 = sv1, .p2 = sv2, .h1 = getHelperClass(a1), .p3 = sv3, .p4 = sv4, .h2 = getHelperClass(a2), .p5 = sv5, ... .pN = svN }
* where .p # is some property, .sv # is some valid value .. h # is a property of type MyHelperClass , and getHelperClass (a #) returns an instance of the specified class.
Now I have a weird thing where the assignment operator for h1 works fine. No problems. The assignment operator for h2, however, gives me the following blue error:
Operator '=' is not defined for types myLib.MyHelperClass and myLib.MyHelperClass.
I just don't get this error at all! I donβt even know where to start figuring this out. HELP!
201105.06 0305: Signatures for type h1 List(Of myLib.Address) , where Address is a very simple class with typical address fields (name, address, city, state, zip code, etc.). The return type getHelperClass also a List(Of myLib.Address) .
As SSS hinted in his answer, I would expect that = would not work naturally if I used it to test equality in a class without operators, however I use it as an assignment operator, and not an equality with which I don't see any Problems. I expect the result of getHelperClass be assigned to h2. But instead, he tells me that = not type-specific. Is it possible that for some reason the compiler interprets it as =(EQUALS) instead of =(ASSIGN) ?
As for the comments of this line, and this happens on the first, I need to wait until I get back to the office tomorrow to check it out. Will report.