j3-fortran / generics

BSD 3-Clause "New" or "Revised" License
36 stars 8 forks source link

Issue with 'innermost scoping unit' constraint #119

Closed aury6623 closed 4 weeks ago

aury6623 commented 1 month ago

There are a few issues with the constraints removed in this edit:

Given that, this PR contains my suggested new wording. I think we can combine all of these into a single constraint, plus a note.

The new constraint wording is loosely based on a similar constraint from the F2023 standard:

C746 A \<type-param-name> in a \<type-param-def-stmt> in a \<derived-type-def> shall be one of the \<type-param-name>s in the \<derived-type-stmt> of that \<derived-type-def>.

But I couldn't find any perfectly analogous existing constraint that I could directly borrow wording from.

If we choose not to combine all 4 of these constraints into 1, we should at least combine the last two, as: "Each \<deferred-type> or \<deferred-class> shall appear...", since we do that in the constraint right above those which deals with the EXTENDS attribute.