Inheritance bug or strange behavior?

BlitzMax Forums/BlitzMax Programming/Inheritance bug or strange behavior?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I dont care if it is supposed to be in a modern OO languge or not. My only difference of opinon with Dream is that I didnt thing it was an error to be able to do it.

I cannot honestly thou dissagree with Dream that it a stupid thing to do. Cos it is. Its not a useful tool at all. I did admit earlier that possibly it might be useful in some weird code model, but I just think it is a way to confuse you when you are useing the type.

If I want a different field in the exteneded type, I would give it a new name, if I wanted the same variable to have a different value in the extended type, I would simply give it a new value.

@Jesse,
Im really supprised that you did know you where createing a new value. But given that you did know that, can you now see that you need to cast, even if you had given different names?
Type a
	Field z%
End Type
Type b Extends a
	Field y% = 2
End Type
Type c Extends a
	Field x% = 3
End Type
Local me:a = New c
Print C(me).x
'Print me.x