(j3.2006) Question about submodule using its ancestor modue
Malcolm Cohen
malcolm
Fri Nov 21 21:04:05 EST 2014
Bill Long writes:
>Is the USE statement in the submodule below conforming?
>
>module m1
> real :: x
>end module m1
>
>submodule (m1) bar
> use m1
>end submodule bar
I am 99.99% sure that this was not intended to be permitted. It is
CERTAINLY not permitted by the submodule TR itself.
It looks like something went wrong with the resolution of UTI 5001 - this
was complaining about the fact that the above was prohibited via constraint,
but yet the reference of a module to itself was not prohibited by
constraint. This was marked as resolved late in F2008 development but with
no paper reference, as even at that time I could not work out why the UTI
had disappeared without a note in the 011... as I recall, not many people
were interested in helping to resolve the 500x series of UTI...
>Option 2: No. The submodule is an extension of m1 and this amounts to a
>recursive access to the module.
It does look like Option 2 is probably what we were thinking. Maybe based
on the statement that a submodule is an extension of a module, and the
scoping unit of the module is the eventual host of the scoping unit of the
submodule - after all, there is no question of any other scoping unit whose
eventual host is the module scope being allowed to USE the module.
This certainly bears further investigation, and doubtless the text in the
standard ought to be clarified. Possibly via interp.
Cheers,
--
............................Malcolm on holiday.
More information about the J3
mailing list