- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The compiler complains that the component spec in the structure constructor is not of the same type and kind as the component. But it is... isn't it?
MODULE m
IMPLICIT NONE
TYPE, PUBLIC :: NodeRef
TYPE(Node), POINTER :: item => NULL()
END TYPE NodeRef
TYPE, PUBLIC :: Node
TYPE(NodeRef), ALLOCATABLE :: upstream(:)
END TYPE Node
CONTAINS
SUBROUTINE s(self)
TYPE(Node), INTENT(INOUT), TARGET :: self
self%upstream = [NodeRef(self)]
END SUBROUTINE s
END MODULE m
>ifort /c /check:all /warn:all /standard-semantics "2015-09-24 nodes.f90"
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0 Build 20150815
Copyright (C) 1985-2015 Intel Corporation. All rights reserved.
2015-09-24 nodes.f90(17): error #6795: The target must be of the same type and kind type parameters as the pointer. [SELF]
self%upstream = [NodeRef(self)]
-----------------------------^
compilation aborted for 2015-09-24 nodes.f90 (code 1)
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, IanH
Yes, you are correct. This is a known issue in compiler. You may find a similar discussion before:
http://software.intel.com/en-us/forums/topic/375845
I have added your case in our existing record DPD200248768. We will let you know if any update.
Thanks
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page