- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to use parameterized derived types and have run into a problem which I have distilled into the following code:
module t_mod
implicit none
type T(k)
integer, kind :: k = 4
integer(kind=k) :: d
contains
procedure, public, pass(x) :: check_v
end type T
contains
logical function check_v(k, x)
integer :: k
class(T) :: x
check_v = (k == x%d)
end function check_v
end module t_mod
I get the following compilation error:
error #8262: For a type-bound procedure that has the PASS binding attribute, the first dummy argument must have the same declared type as the type being defined.
How should I declare k in order for this to compile ?
Thanks.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a bug that will be fixed in version 16. It's not fixed in the current beta but should be in the first beta update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. I was using the current v16 beta so I'll wait for the update.
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