- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am facing a compiler error when trying to initialize a parameterized derived type omitting a component with default value.
This only happens when the derived type is accessed by host association, and also in a default initialization in the declaration statement.
module pdt implicit none type :: host_pdt(n) integer, len :: n integer :: x = 99 end type end program test use :: pdt implicit none type :: prog_pdt(n) integer, len :: n integer :: x = 99 end type type(prog_pdt(5)) :: p = prog_pdt(5)() ! it works with locally declared type type(host_pdt(5)) :: h1 = host_pdt(5)() ! error #8212: Omitted field is not initialized. Field initialization missing:type(host_pdt(5)) :: h2 h2 = host_pdt(5)() ! this works, though end
My compiler version is Intel Compiler 18.0 x64 on windows 10, and I am not using any compiler option.
Link Copied
0 Replies
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