Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OO NooB...

1 view
Skip to first unread message

SpreadTooThin

unread,
Oct 11, 2009, 7:38:27 PM10/11/09
to
I just had a side effect that I wasn't expecting.
I have a class, let's call it myClass:MemoryBlock (ie my class
inherits from MemoryBlock)
In myClass I defined a Constructor that takes a string as a parameter.

Later on in another class, let's call it an otherClass, I declare a
constructor that takes myClass as a parameter to the constructor.

By accident, instead of passing an instance of myClass to the
otherClass constructor, I passed a string.

The constructor of myClass was not called and that has caused some odd
things to happen because the instance of myClass isn't correct in the
instance of the otherClass.

What did I do wrong? How come no error or warning of incompatible
parameter types?

0 new messages