J3/04-323 Date: 13 May 2004 To: J3 From: Richard Maine Subject: Type-bound procedures and undefined association status NUMBER: TITLE: Type-bound procedures and undefined association status KEYWORDS: Type-bound procedure, dynamic type DEFECT TYPE: STATUS: J3 consideration in progress QUESTION: It appears that the dynamic type is undefined for a pointer with undefined association status. This impacts type-bound procedures. Consider the following program. program undefined type :: t contains procedure :: nondeferred_proc => sub end type t type, extends(t) :: t2 contains procedure :: nondeferred_proc => sub2 end type t2 class(t), pointer :: x call x%nondeferred_proc contains subroutine sub write (*,*) 'Hello.' end subroutine sub subroutine sub2 write (*,*) 'Goodbye.' end subroutine sub2 end program defer Is this a valid program? If not, what restriction of the standard does it violate? If so, what does it print. Note that x%nondeferred_proc does not require the value of x (4.5.7) and thus is not a reference to x (2.5.6). Therefore, [83:23-24] does not prohibit this. If x were disassociated, its dynamic type would be t and the interpretation of this would be reasonably clear. However, the standard does not appear to specify the dynamic type of x when its association status is undefined. Nor can I find any prohibition that applies to this case. ANSWER: Beat's me. (This one really needs a better answer.) :-( EDITS: SUBMITTED BY: Richard Maine HISTORY: J3/04-323 m169 Submitted