- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I experience unexpected behavior when allocating a polymorphic array from a part of another polymorphic array. I have added a fully working program demonstrating the problem.
In both cases, I would have expected to get a TargetItems array with 5 elements. But in the first case, I get an array with 10 elements, i.e. the full size of the SourceItems array.
I have seen this behavior with the latest IVF 17.0.0.109 as well as several previous versions.
Another issue: In the debugger (using IVF 17 and VS 2015 Update 3), all arrays are shown as undefined even after the allocate...
Best regards,
Thomas
program AllocateSourceIssueWithArraySlice implicit none type :: baseType integer aValue end type class (baseType), ALLOCATABLE :: SourceItems(:) class (baseType), ALLOCATABLE :: TargetItems(:) ALLOCATE( baseType::SourceItems(10)) print *, 'Allocating with arrayslice in SOURCE= statement' ALLOCATE( TargetItems, SOURCE=SourceItems(1:5) ) print *, 'Size SourceItems (expected 10): ', SIZE(SourceItems) print *, 'Size TargetItems (expected 5): ', SIZE(TargetItems) DEALLOCATE(TargetItems) print *, 'Allocating with arrayslice via assosciate construct' ASSOCIATE (Source => SourceItems(1:5)) ALLOCATE( TargetItems, SOURCE=Source ) END ASSOCIATE print *, 'Size SourceItems (expected 10): ', SIZE(SourceItems) print *, 'Size TargetItems (expected 5): ', SIZE(TargetItems) end program
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks - escalated as issue DPD200414141. Interesting that if the source array is not polymorphic, it works correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The fix for this might not make Update 1, but if not, definitely Update 2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve Lionel (Intel) wrote:
The fix for this might not make Update 1, but if not, definitely Update 2.
Thanks for the update on this issue.
Steve, in my original post I also mentioned that I am unable to see the variables in the above program in the debugger (VS2015 Update 3/IVF 17). Is that something specific to my installation or do have this issue as well?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The debugger issue is unrelated - the debugger still has problems with polymorphic variables. I will check with our debugger folk to make sure they're aware of this (DPD200414790).
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page