procedure(assign) leads to strange error message

procedure(assign) leads to strange error message

Hello,

I noticed that using a line like "procedure(assign), deferred:: assign_data" leads to an
error message that bears little or no relevance to the statement:

sort_syntax_error.f90(11): error #5082: Syntax error, found 'ASSIGN' when expecting one of: ) TYPE BYTE CHARACTER CLASS DOUBLE DOUBLECOMPLEX DOUBLEPRECISION INTEGER LOGICAL ...

procedure(assign), deferred :: assign_data

------------------^

I f I change the name "assign" to something else, the message disappears.

This happens with Intel Fortran 11 on Windows but also with version 12.0.3 on Linux, so I guess
it is a front-end problem.

Here is a small program to reproduce it:

! abstract_sort.f90 --

! Show how to define a generic sortable type

!

! Module for sortable objects

!

module sortable_types

type, abstract :: sortable

! No particular data

contains

procedure(assign), deferred :: assign_data

end type sortable

end module sortable_types

Regards,

Arjen

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Steve Lionel (Intel)'s picture

Amusing. I'll let the developers know. Even without that, this code needs ASSIGN to have an explicit interface visible, but the error remains when I add this. I wonder if there is some remnant of the pre-F77 CALL ASSIGN left in the compiler...

Steve

Sure, it is a fragment of a larger program, but I was really surprised to see this one.

IIRC, ASSIGN was a statement, I have seen it once or twice in an actual program, but
I have never actually used it myself.

Regards,

Arjen

Steve Lionel (Intel)'s picture

Yes, ASSIGN is a statement - part of assigned GOTO and assigned formats. These are "deleted features", but we still support them. Issue ID is DPD200173075.

Steve
Steve Lionel (Intel)'s picture

This was fixed in the 13.0 compiler.

Steve

Login to leave a comment.