Hi, the following code produces an error with ifort 2018u2 on x64 platform:
module test1 implicit none type, abstract :: tp1 private contains private procedure(iequals), public, pass, deferred :: equals end type tp1 abstract interface function iequals(this, obj) import tp1 logical :: iequals class(tp1), intent(in) :: this class(tp1), intent(in) :: obj end function iequals end interface end module test1 module test2 use test1, only: tp1 implicit none type, extends(tp1) :: tp2 private integer :: var2 contains private procedure, public, pass :: equals => equalsfunc end type tp2 contains function equalsfunc(this, obj) implicit none logical :: equalsfunc class(tp2), intent(in) :: this class(tp1), intent(in) :: obj select type(obj) type is(tp2) equalsfunc = (this % var2 == obj % var2) class default equalsfunc = .false. end select end function equalsfunc end module test2 module test3 use test1, only: tp1 use test2, only: tp2 implicit none type, extends(tp1) :: tp3 private type(tp2) :: var3 contains private procedure, public, pass :: equals => equalsfunc end type tp3 contains function equalsfunc(this, obj) implicit none logical :: equalsfunc class(tp3), intent(in) :: this class(tp1), intent(in) :: obj select type(obj) type is(tp3) equalsfunc = (this % var3 == obj % var3) class default equalsfunc = .false. end select end function equalsfunc end module test3
Error message is:
error #6355: This binary operation is invalid for this data type. [VAR3]
on line 78. Is this a bug and is there any workaround that I can temporarily make it through ? Thanks for any help.