Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
175 Views

Wrong constructor for extended type

Jump to solution

The code below gives the following error: "error #6593: The number of expressions in a structure constructor differs from the number of components of the derived type.   [TYPERESTRIC_UNITVECT]", but according to me the code should be correct.

PROGRAM wrong_constructor
    IMPLICIT NONE

    TYPE VECTOR
	    REAL(8),POINTER,DIMENSION(:)::rpt=>null(),rptp=>null(),rpts=>null()
    END TYPE VECTOR

    TYPE,ABSTRACT::typerestric
        INTEGER:: ir = -1
        INTEGER numrestrics
	    REAL(8)::penaltycoef_rel=1.d0
    END TYPE typerestric

    TYPE,EXTENDS(typerestric)::typerestric_unitvect
        TYPE(VECTOR),POINTER:: u
    END TYPE typerestric_unitvect

    TYPE(VECTOR),TARGET::u
    TYPE(typerestric_unitvect) RS
    
    RS=typerestric_unitvect(ir=1,numrestrics=1,penaltycoef_rel=1.d0,u=u)
    
END PROGRAM wrong_constructor

 

0 Kudos

Accepted Solutions
Highlighted
Black Belt Retired Employee
175 Views

The compiler seems to get confused by the two uses of "u" in the constructor. If I rename the variable to "u2" it works.  Please submit this in a bug report to Intel.

View solution in original post

0 Kudos
6 Replies
Highlighted
Black Belt Retired Employee
176 Views

The compiler seems to get confused by the two uses of "u" in the constructor. If I rename the variable to "u2" it works.  Please submit this in a bug report to Intel.

View solution in original post

0 Kudos
Highlighted
175 Views

Thank you very much, Steve, I didn't notice this. Moreover, it happens only with extended types, if all the variables are defined in the type without extension, the bug dissapears too.

0 Kudos
Highlighted
175 Views

Steve Lionel (Ret.) (Blackbelt) wrote:

The compiler seems to get confused by the two uses of "u" in the constructor. If I rename the variable to "u2" it works.  Please submit this in a bug report to Intel.

Done.

0 Kudos
Highlighted
Moderator
175 Views

Thank you for your report. I have escalated this issue to our compiler engineering.

0 Kudos
Highlighted
175 Views

Thank you Devorah.

0 Kudos
Highlighted
Moderator
149 Views

this issue was fixed in PSXE 2020 Update 2, compilers 19.1.2


0 Kudos