Hi,

I have a simple question and I am unsure about the answer.

Suppose we have class A with an ivar _var.

Now, I subclass A with B. Since I don't know the declaration of A, I also need an ivar and call it _var and they probably have the same type.

What happens? Do I get a compiler error? Does the compiler smartly renames the two variables like _var_A and _var_B? Does the second declaration get ignored and the code refers to the same variable? I would expect the renaming behaviour, but the latter also makes

I wonder if there is risk calling vars like "_size" or "width" "height" which have common names enough to be declared up in the hierarchy.
I am debugging code that works on Mac and not on GS, so I got the doubt.

Riccardo

_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to