Section 10.2.2.4, paragraph 3 states that, for procedure pointer assignment:
If the pointer object has an explicit interface, its characteristics shall be the same as the pointer target ...
Thus, it's illegal for a procedure pointer with an explicit interface to be
associated with a procedure whose interface is implicit. However, there's no
prohibition that disallows a procedure pointer with an implicit interface from
being associated with a procedure whose interface is explicit.
We were incorrectly emitting an error message for this latter case.
We were also not covering the case of procedures with explicit
interfaces where calling them requires the use of a descriptor. Such
procedures cannot be associated with procedure pointers with implicit
interfaces.
Nit: could be useful with a comment indicating that we have an "OK" path out of the function here, cf. ln 942.
It could also be useful if the error message mentioned which condition of 15.4.2.2 is violated. That would then apply to all checks through CanBeCalledViaImplicitInterface(), and I'd say it is better to land this patch first, and work on that as a follow-up (I could also help if you'd like). What do you think?