- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Another strange one with parameterized derived types: the following simple code results in a compiler error, incorrectly in my opinion. But simply uncommenting the unrelated lines 17-26 makes the code compile ok:
module m
implicit none
private
type, public :: t(n)
private
integer, len :: n = 1
integer :: m_x(n)
contains
procedure, pass(this), public :: x => get_t_x
end type t
contains
!subroutine load_t_x(this, dat)
!
! class(t(*)), intent(inout) :: this
! integer(kind=kind(this%m_x)), intent(in) :: dat(:)
!
! this%m_x = dat
!
! return
!
!end subroutine load_t_x
function get_t_x(this) result(retval)
class(t(*)), intent(in) :: this
!..
integer(kind=kind(this%m_x)) :: retval(this%n)
retval = this%m_x
return
end function get_t_x
end module m
The compiler output is:
------ Build started: Project: p, Configuration: Debug|x64 ------ Compiling with Intel(R) Visual Fortran Compiler XE 15.0.2.179 [Intel(R) 64]... m.f90 C:\..\m.f90(32): error #6160: This component is not a field of the encompassing structure.compilation aborted for C:\..\m.f90 (code 1)
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Escalated as issue DPD200367089 - thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I expect this to be fixed in 16.0.1 (2016 Update 1)
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