[J3] Question on function result characteristic in context of an extensibe type with SAME_TYPE_AS intrinsic

Vipul Parekh parekhvs at gmail.com
Wed Jul 3 10:22:45 EDT 2019


Consider the following:

module m
   type :: t
      integer :: i = 0
   end type
contains
   function new_t( i ) result(n)
      integer, intent(in) :: i
      type(t) :: n
      n%i = i
   end function
   function f( u ) result(l)
      type(t), intent(in) :: u
      logical :: l
      l = same_type_as( A=u, B=new_t(i=42) )
  end function
end module

One processor compiles the above code ok whereas another one issue an
error with the same_type_as intrinsic in connection with argument B
not being an extensible type.

A question therefore: does the above code conform to the standard?

Thanks,
Vipul Parekh


More information about the J3 mailing list