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

Type bound generics and dotted strings

IanH
Honored Contributor III
554 Views

The following gives acompletly whackedspurious error message that indicates that "operator resolution" for a a user defined operator applied to a component of a derived type is being carried out based on the name of a dummy argument ... in a different procedure .... in a different module.

[fortran]

MODULE A
  IMPLICIT NONE
  PRIVATE
 
  TYPE, PUBLIC :: TypeA
  CONTAINS
    PROCEDURE :: is_op
    GENERIC :: OPERATOR(.is.) => is_op
  END TYPE TypeA
CONTAINS
  PURE FUNCTION is_op(str, idx) RESULT(mvconc)
    CLASS(TypeA), INTENT(IN) :: str
    INTEGER, INTENT(IN) :: idx    
    REAL :: mvconc
    mvconc = 0.0
  END FUNCTION is_op
END MODULE A

MODULE B
  IMPLICIT NONE
  PRIVATE
  PUBLIC :: irrelevant_proc
 
  TYPE, PUBLIC :: TypeB
  END TYPE TypeB
CONTAINS  
  ! Note dummy argument name.
  SUBROUTINE irrelevant_proc(My)    
    TYPE(TypeB), INTENT(IN) :: My
  END SUBROUTINE irrelevant_proc
END MODULE B

MODULE C
  USE A
  IMPLICIT NONE
  PRIVATE
  INTEGER, PARAMETER, PUBLIC :: rising =  1
 
  TYPE, PUBLIC :: TypeC
    TYPE(TypeA) :: exasperation
  END TYPE TypeC
CONTAINS
  SUBROUTINE proc(My)
    TYPE(TypeC), INTENT(INOUT) :: My
    PRINT *, My % exasperation .is. rising
  END SUBROUTINE proc
    
  SUBROUTINE another_proc
    USE B, ONLY: irrelevant_proc
  END SUBROUTINE another_proc
END MODULE C

[/fortran]

[plain]


>ifort /c /check:all /warn:all /standard-semantics DottedStringWTF.f90
Intel(R) Visual Fortran Compiler XE for applications running on IA-32, Version 13.0.0.089 Build 20120731
Copyright (C) 1985-2012 Intel Corporation.  All rights reserved.

DottedStringWTF.f90(11): remark #7712: This variable has not been used.   [STR]
  PURE FUNCTION is_op(str, idx) RESULT(mvconc)
----------------------^
DottedStringWTF.f90(11): remark #7712: This variable has not been used.   [IDX]
  PURE FUNCTION is_op(str, idx) RESULT(mvconc)
---------------------------^
DottedStringWTF.f90(28): remark #7712: This variable has not been used.   [MY]
  SUBROUTINE irrelevant_proc(My)
-----------------------------^
DottedStringWTF.f90(45): error #6866: Dotted string neither a defined operator nor a structure component   [IS]
    PRINT *, My % exasperation .is. rising
--------------------------------^
DottedStringWTF.f90(43): remark #7712: This variable has not been used.   [MY]
  SUBROUTINE proc(My)
------------------^
compilation aborted for DottedStringWTF.f90 (code 1)

[/plain]

0 Kudos
3 Replies
Anonymous66
Valued Contributor I
554 Views
Hello Ian, I have escalated this issue to the developers the issue number is DPD200237125. I will post any updates I receive to this thread. Regards, Annalee Intel Developer Support
0 Kudos
Anonymous66
Valued Contributor I
554 Views

Hello Ian,

A fix has been found for this issue. We are currently planning to include it the next major release which is scheduled for later this year.

Regards, Annalee

0 Kudos
Ron_Green
Moderator
554 Views

This bug was fixed in the recent Composer XE 2013 SP1 release, released in early September ( version 14.0 of the compiler )

ron

0 Kudos
Reply