- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
CONTAINS
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This has been fixed for a release later this year.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page