J3/15-234r1 To: J3 Members From: Van Snyder Subject: Clarifying generic bindings Date: 2015 October 12 1. Introduction =============== 15-234 was a misguided attempt to repair a problem by addressing the wrong symptoms. The problem is not the relationship of generic identifiers to binding names, which is reasonably clear if somewhat scattered. Rather, it's a confusion between type bound procedures, and the specific procedures that implement those type bound procedures in each extension. Tackling that confusion would be a larger project than we want to undertake at this time. We can at least make it clear that inheritance of generic bindings has nothing to do with overriding. 2. Edits ======== {4.5.7.3p3 has nothing to do with type-bound procedure overriding.} [81:6-7 4.5.7.3p3] Move the paragraph beginning "If a generic..." to be 4.5.7.2p3, between 4.5.7.2p2 and NOTE 4.54 (which begins "A component or type parameter..."). {4.5.7.3p4 ought to be before the example, because it's more important than the example.} [81:8-9] Move 4.5.7.3p4] Move the paragraph beginning "A binding of a type..." to be before NOTE 4.56 (which begins "The following is..."). 3. Original introduction ======================== Maybe the way type-bound generic interfaces work is abundantly clear to some, but I found it to be confusing. It could use some explanation. Notes are proposed here. Maybe it should be normative. 4. Original edits ================= [15:15 1.3.115.6] Insert "or generic interface" after "procedure". After "derived type" insert ", or inherited from its parent type and not overridden," {4.5.5p3 at [76:33-34] specifies that a type-bound generic interface is a type-bound procedure. That part of the edit isn't technically needed, but it is helpful.} [80:11- NOTE 4.55+] Insert a note: " NOTE 4.55a Where a generic interface is inherited, it specifies that the names of specific procedure bindings to the extension type, as they are specified or inherited in the parent type, are part of the generic interface bound to the extension type. If a specific procedure binding is inherited and not overridden (4.5.7.3), it is part of the inherited generic interface. If a specific procedure binding is overridden the overriding binding is part of the inherited generic interface and the inherited binding is not. " [311:11+ 12.5.6p3+] Insert a note: " NOTE 12.43a As a generic interface is inherited (4.5.7.2) into an extension type, it is useful to think of it as having added a row to a two-dimensional array. Each column of the array is identified by the charactistics of a procedure. The rules in 12.4.3.5.5 ensure that columns' identities are distinct. Each row of the array is identified by the dynamic type of the . When a generic type-bound procedure is referenced, the characteristics of the actual arguments, except for the declared type of the if the procedure has a passed-object dummy argument, select a column of the array, and the dynamic type selects a row. The declared type of the is not used for generic resolution if the procedure has a passed-object dummy argument because the reference might be to an inherited specific binding, for which the declared type of the passed-object dummy argument is necessarily an ancestor type. "