- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there
the code
Module testmod
Type, abstract :: myroot(k)
Integer(4), kind :: k
End type myroot
Type, extends(myroot), abstract :: myvec(lb1,ub1)
Integer(8), len :: lb1=1,ub1
End type myvec
Type, extends(myvec) :: myvec_int
Integer(k) :: val(lb1:ub1)
End type myvec_int
End Module testmod
Program Test
use testmod
Implicit none
Type(myvec_int(8,:,:)), allocatable :: a
Allocate(myvec_int(8,ub1=5)::a)
a%lb1=6
End Program Test
compiles with 17.05, 18.0 and 18.0.1, where from my understanding "a%lb1=6" should yield a compile time error. Is that correct??
Cheers
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I agree with you, though I have spent the last 10 minutes or so paging back and forth through the standard to see if I could find the right words.
What I ended up deciding was that type parameters are NOT data-objects, so they can't be assigned to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve,
thanks for looking into the standard.
Interestingly the compile time error comes up when changing the code to:
Module testmod
Type, abstract :: myroot(k)
Integer(4), kind :: k
End type myroot
! Type, extends(myroot), abstract :: myvec(lb1,ub1)
! Integer(8), len :: lb1=1,ub1
! End type myvec
Type, extends(myroot) :: myvec_int(lb1,ub1)
Integer(8), len :: lb1=1,ub1
Integer(k) :: val(lb1:ub1)
End type myvec_int
End Module testmod
Program Test
use testmod
Implicit none
Type(myvec_int(8,:,:)), allocatable :: a
Allocate(myvec_int(8,ub1=5)::a)
a%lb1=8
End Program Test
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That doesn't astonish me. Please report it through the Intel Online Service Center.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was pointed to this:
C610 (R611) Each part-name except the leftmost shall be the name of a component of the declared type of the preceding part-name.
Type parameters are not components, so this is invalid.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page