[J3] Can multiple specific binding of a generic type-bound procedure points to one specific type-bound procedure?

Daniel Chen cdchen at ca.ibm.com
Tue Jul 15 13:32:11 UTC 2025


Hello all,

Is the following program legal?

```
module m
  type dt
    integer i
  contains
    generic :: ASSIGNMENT(=) => assign
    procedure, pass :: assign => myassign
    generic :: ASSIGNMENT(=) => otherassign
    procedure, pass :: otherassign => myassign
  end type
contains
  subroutine myassign(x,y)
    class(dt), intent(out) :: x
    integer, intent(in) :: y
    x%i = y + 1
  end subroutine
```

Generic defined ASSIGNMENT(=) has 2 specific binding names (“assign” and “otherassign”), but they all point to the same specific module procedure “myassign”.

It seems OK to me as I can’t find any wording in the standard to disallow it.
Any comments are very welcome!

Thanks,
Daniel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20250715/7ad8fca5/attachment.htm>


More information about the J3 mailing list