(j3.2006) question about generic resolution
Malcolm Cohen
malcolm at nag-j.co.jp
Tue Mar 23 20:18:54 EDT 2010
Hi Bill,
The "POINTER vs ALLOCATABLE" generic feature is fundamentally misguided.
> Either of the specific interfaces appears to be viable as a callee. I assume
> that we intend that suba is called.
Bad assumption. There is no such intent.
> However, I don't see anything in [303:12.5.5.2] (resolving generics) that
> says this.
The whole point of our generic distinguishability rules is to avoid ambiguous
situations like this.
> Did these two new features just fly by each other, or (hopefully) did I miss
> some part of the text that points out where the above example goes wrong, or
> is disambiguated.
It is just broken.
The obvious fix is to disallow the ambiguous generic. That has the unfortunate
side-effect of completely removing the "POINTER vs. ALLOCATABLE" generic
feature. However, that feature is so limited that
(a) it is certainly not a poster child for allowing an ambiguous overload with a
"priority" rule for selection;
(b) removing it results in the loss of virtually no useful functionality.
Cheers,
--
................................Malcolm Cohen, Nihon NAG, Tokyo.
More information about the J3
mailing list