Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

Compiler does not catch type bound function argument's intent mismatch

abhimodak
New Contributor I
602 Views
In the snippet below, I believe the compiler is missing to catch intent(INOUT) vs Intent(IN) in subroutine Inspect.

Note that if the commented calls are used then there is a compile-time error. Thus, only if I am using type bound function syntax then the error goes undetected.

Abhi

==================


[fortran]Module OM
   
   Implicit None
   
   Type newCar
      Integer :: n
   Contains
      Procedure :: Check
      Procedure :: Inspect
      Procedure :: Test
   End Type newCar

Contains
   
   Subroutine Inspect(Car)
      Class(newCar), Intent(IN) :: Car
      Integer :: m
      !Call Check(Car)
      !Call Car%Check
      !m = Test(Car)
      m = Car%Test()
   End Subroutine Inspect
   
   Subroutine Check(Car)
      Class(newCar), Intent(INOUT) :: Car
   End Subroutine Check
   
   Function Test(Car) Result(i)
      Integer :: i
      Class(newCar), Intent(INOUT) :: Car
      i = 0
   End Function Test
   
End Module OM[/fortran]
0 Kudos
2 Replies
Steven_L_Intel1
Employee
602 Views
Abhi,

Thanks for bringing this to our attention. I have escalated it to the developers and will let you know when it is fixed.
0 Kudos
Steven_L_Intel1
Employee
602 Views
This issue will be fixed in Update 3 to Intel Visual Fortran Composer 2011.
0 Kudos
Reply