ecmwf-ifs / loki

Freely programmable source-to-source translation for Fortran
https://sites.ecmwf.int/docs/loki/
Apache License 2.0
29 stars 12 forks source link

Derived-type inheritance #295

Closed awnawab closed 5 months ago

awnawab commented 5 months ago

This PR adds the ability to propagate all the non-overridden symbols from a parent to a child type. It should be noted that per the Fortran standard, only type-bound procedures can be shadowed by children and data/procedure members cannot, but I have kept the implementation agnostic to the type of symbol being inherited.

github-actions[bot] commented 5 months ago

Documentation for this branch can be viewed at https://sites.ecmwf.int/docs/loki/295/index.html

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 97.87234% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 94.95%. Comparing base (c212156) to head (7650790). Report is 6 commits behind head on main.

Files Patch % Lines
loki/ir/nodes.py 93.33% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #295 +/- ## ======================================= Coverage 94.95% 94.95% ======================================= Files 153 153 Lines 32086 32132 +46 ======================================= + Hits 30466 30511 +45 - Misses 1620 1621 +1 ``` | [Flag](https://app.codecov.io/gh/ecmwf-ifs/loki/pull/295/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecmwf-ifs) | Coverage Δ | | |---|---|---| | [lint_rules](https://app.codecov.io/gh/ecmwf-ifs/loki/pull/295/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecmwf-ifs) | `96.39% <ø> (ø)` | | | [loki](https://app.codecov.io/gh/ecmwf-ifs/loki/pull/295/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecmwf-ifs) | `95.12% <97.87%> (+<0.01%)` | :arrow_up: | | [transformations](https://app.codecov.io/gh/ecmwf-ifs/loki/pull/295/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecmwf-ifs) | `92.17% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ecmwf-ifs#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

awnawab commented 5 months ago

Many thanks for the feedback @reuterbal and for spotting the potentially empty declarations 🙏