I would like to have a derived type, a
, which is empty. From this derived type I would like to define further types which extend a. Suppose all of these type extensions contain some generic
procedure name, value
, i.e value => valuea1
, value => valuea2
, etc.
If I then want to pass variables of class a to some other procedure, I need to declare the relevant dummy argument of that procedure with class(a)
. If I do this, however, then referencing the value
of the dummy argument leads to compilation failure because the class a is actually empty - only the type extensions contain the procedure.
I could presumably get around this by having some procedure called value
inside the type definition of a (then overriding in the extensions). However, given that I never want to declare any object with type a, this seems messy. It it possible to get around this?