J3/04-322 Date: 13 May 2004 To: J3 From: Richard Maine Subject: Referencing deferred bindings NUMBER: TITLE: Referencing deferred bindings KEYWORDS: Type-bound procedure, deferred binding DEFECT TYPE: STATUS: J3 consideration in progress QUESTION: I thought that the intent was that it would be impossible to reference a deferred binding. However, it doesn't appear to me that this intent was achieved. Consider the following program (Sorry, but I don't have any compilers up to syntax-checking this). program defer type, abstract :: t contains procedure (sub), deferred :: deferred_proc end type t type, extends(t) :: t2 contains procedure :: deferred_proc => sub2 end type t2 class(t), pointer :: x nullify(x) call x%deferred_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? Note that x%deferred_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. Nor is it clear that there is an intent to prohibit invocation of type-bound procedures for disassociated pointer objects; except in the case of deferred bindings, this seems well-defined and potentially useful. Because x is disassociated, its dynamic type is the same as its declared type, thus making the interpretation of x%nondeferred_proc reasonably clear. ANSWER: No, this is not a valid program. The standard does not provide an interpretation of this program, so [2:10] applies. (This deserves a better answer, but that's the only one I can get from the standard.) EDITS: SUBMITTED BY: Richard Maine HISTORY: J3/04-322 m169 Submitted