The previous semantic analysis does not consider when the last part-ref
is scalar or complex part. Refactor the previous code and bring all the
checks into one place. The check starts from the designator by
extracting the dataref wrapped including the substring and complex part
and recursively check the base objects.
Co-authored-by: Peter Klausler <pklausler@nvidia.com>
This message is misspelled and inaccurate, and the loop does not do what I think you think it does. It is traversing the subscripts of an array reference like A%C(:,:), not multiple component part-refs.