In my code I have some PARAMETERs of a derived type which builds on an ABSTRACT type/class with no components:
TYPE, ABSTRACT :: point
CONTAINS PROCEDURE :: dist => pt_to_pt_dist
END TYPE point
TYPE, EXTENDS(point) :: point2d
REAL, DIMENSION(2) :: c !coordinates: c(1) & c(2)
PROCEDURE :: array_to_point2d
GENERIC :: ASSIGNMENT(=) => array_to_point2d
END TYPE point2d
The below declaration statement compiles without problems:
TYPE(point2d),PARAMETER :: apoint=point2d([ 2.0, 3.0 ])
However, if I then print the array apoint%c the actual values don't seem to be initialized at all, and seemingly random numbers are printed, as if it was an ordinary variable that wasn't initialized yet.
If I then change the point2d type to a 'stand-alone' type, ie. I remove the EXTENDS(point) attribute, everything works just fine.
I'm testing the IVF 2013 compiler right now, but I get the same strange behavior using the 2011 compiler.
Is it a compiler bug, or am I doing something wrong?
And I also want to ask if parameterized derived types are far away