Quantcast
Channel: Recent posts
Viewing all articles
Browse latest Browse all 27

Generic interface with the same name as a derived type

$
0
0
English

If I understand the standard correctly then the following program should work

MODULE DType
  IMPLICIT NONE
  PUBLIC

  INTEGER, PARAMETER :: I4B = SELECTED_INT_KIND(9)
  !INTEGER, PARAMETER  :: WP = SELECTED_REAL_KIND(6,37)
  !INTEGER, PARAMETER  :: WP = SELECTED_REAL_KIND(15,307)
  INTEGER, PARAMETER  :: WP = SELECTED_REAL_KIND(32,4931)

  TYPE JD
     INTEGER(I4B) :: JDN = 2451545
     REAL(WP)     :: FD = 0.0_WP, tmp
   CONTAINS
     GENERIC                  :: ASSIGNMENT(=) => setJD
     PROCEDURE, PRIVATE, PASS :: setJD
  END TYPE JD

  INTERFACE JD

Viewing all articles
Browse latest Browse all 27

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>