(j3.2006) finalizer infelicity

Michael Ingrassia michaeli
Wed Nov 21 14:11:36 EST 2007


I thought I had already sent this to the mailing list, but I don't see it in
the archives so maybe I didn't.  There is a possible interp raised:  
do our semantics really require us to call a 
finalizer ([59:5] "it is called") when that
finalizer could not have been called explicitly ?  Do they forbid us
to bind such finalizers?  Or am I misunderstanding
something that is otherwise clear?  (There's a first time for everything!)

This program appears to be standard-conforming:

MODULE FOO
TYPE Q
  INTEGER I
CONTAINS
  FINAL :: S
END TYPE Q

CONTAINS

SUBROUTINE S(X)
TYPE(Q) :: X(2)
END SUBROUTINE S

END MODULE FOO

SUBROUTINE R()
USE FOO
TYPE(Q) :: X2(2)
TYPE(Q) :: X3(3)
END SUBROUTINE R

CALL R()
END

but not if you add

TYPE(Q) :: X1(1)

because in that case our protocol insists that finalizer S be called for
X1--the Johnnie Cochran clause at [04-007:59:4-5]:  
"If the ranks match you must dispatch" (paraphrased),
but (informally speaking) there's no semantics available 
for passing a "too-small" array actual argument to a bigger dummy argument.

 	--Michael I.




More information about the J3 mailing list