Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28524 Discussions

default initialization for derived types

joseph_battelle
Beginner
373 Views
Is default initialization in base types supposed to work with derived types in the current compiler? I'm getting weird error messages:
[fortran]program C3
    type :: t
        integer :: x=0, y=1        
    end type t   
    
    type, extends(t) :: t1
        integer :: z
    end type t1
    
    type(t)  :: v0 = t(y=1) !ok, default initializer for x
    type(t1) :: v1 = t1(x=0, y=1, z=5) !ok, explicit
    type(t1) :: v2 = t1(t=t(x=1, y=2), z=5) !ok, explicit base    
    type(t1) :: v3 = t1(z=3) ! error #8212: Omitted field is not initialized. Field initialization missing:   
end program C3[/fortran]
Note the error message refers to not those defined in type(t).
0 Kudos
1 Solution
Steven_L_Intel1
Employee
373 Views
Interesting. I know we had some issues with default initialization before, but this is a new one. I'll report it (DPD200156822). Thanks.

View solution in original post

0 Kudos
2 Replies
Steven_L_Intel1
Employee
374 Views
Interesting. I know we had some issues with default initialization before, but this is a new one. I'll report it (DPD200156822). Thanks.
0 Kudos
Steven_L_Intel1
Employee
373 Views
I expect this issue to be fixed in our November release.
0 Kudos
Reply