MODULE bugs
  TYPE date
     INTEGER :: year, month, day
  END TYPE date
  TYPE person
     CHARACTER(:), ALLOCATABLE :: name
     INTEGER                   :: ID
     TYPE(date)                :: birthday
  END TYPE person
  TYPE, EXTENDS(person) :: employee
     REAL                      :: salary
     CHARACTER(:), ALLOCATABLE :: job_title
  END TYPE employee

  
  
  TYPE(person)   :: john_doe
  TYPE(employee) :: staffer

CONTAINS
  SUBROUTINE get_salary(john_doe,ans)
# ifndef no_oop2003
    CLASS(person),  INTENT(inout) :: john_doe
# else
    TYPE(employee), INTENT(inout) :: john_doe
# endif    
    REAL,           INTENT(out)   :: ans

# ifndef no_oop2003
    SELECT TYPE (john_doe)
    TYPE is  (employee)
# endif
       ans = john_doe%salary
# ifndef no_oop2003
    CLASS default
       ans = -1
    END SELECT
# endif
  END SUBROUTINE get_salary
END MODULE bugs

       
