Improve scoping behaviour and IR representation of interfaces
reuterbal opened this issue · comments
This is a follow-up to #134, which was fixed with a workaround in #141.
Our current representation of interfaces as ScopedNode
embeds them into the parent scope. This is useful because it automatically registers symbols declared by the interface in the parent scope's symbol table, but it also puts the recursive lookup mechanism in place for symbols. That's technically not correct Fortran behaviour as interface blocks cannot use symbols from the parent scope (the primary purpose is to declare something that doesn't live in the current scope).
An overhaul of that representation of interfaces is required, possibly also with a reconsideration of how we represent procedures in there. Currently, we use standard Subroutine
objects for that, which are unaware that they are not actual subroutines/functions.