polymorphing

BlitzMax Forums/BlitzMax Beginners Area/polymorphing

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.

This is an extract of a program I am working on:
Type a
	Field z%
End Type
Type b Extends a
	Field z% = 2
End Type
Type c Extends a
	Field z% = 3
End Type
Local me:a = New c
Print me.z


I am trying to display the field z% with the value of 3 but I get 0. I am assuming it accessing the field z in the a type. can anybody tell me what I am doing wrong. Or is this a compiler bug?