I have a base class in C# like:
public class A{
public A something() {
//...
}
}
And a derived class like:
public class B:A
When I do:
B obj = new B();
obj = obj.something();
VS throws an error saying (something like) "A can't be converted to B". Isn't it supposed to return B and not A?
Update: Thank you all.
I've changed A.something(string) and now is A.something(int). The values passed to it are always ints, so... B (and other "sister" classes) are just a midstep in a full refactoring of the code, so they will disappear.
The case is that I have 4 classes that do the same and I'm changing'em for a unified one. Thus the need to return "B" objects for now.