https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83927

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Seems fixed... I'll try to commit the test case this evening.

I still get

   31 |   M = v_array_par(1)%MyFunc()
      |      1
Error: Cannot convert TYPE(mytype) to REAL(4) at (1)

with

module Types

  implicit none

  type MyType
    real :: x
  contains
    procedure :: MyFunc
  end type

contains

  pure function MyFunc(this) result(M)
    class(MyType), intent(in) :: this
    real                      :: M

    M = this%x
  end function
end module

program Main
  use Types

  implicit none

  type(MyType), parameter :: v_array_par(1) = [ MyType(1) ]
  type(MyType), parameter :: v_scalar_par = MyType(1)
  type(MyType) :: v_array(1)
  real         :: M

  M = v_array_par(1)%MyFunc()
  print *, M

!  M = v_scalar_par%MyFunc()
!  print *, M

  v_array(1) = MyType(1)
  M = v_array(1)%MyFunc()
  print *, M

end program

Reply via email to