Derived type definition locations

Sorry for quoting only the part about the type definition. The answer how it can be propagated outside is specified in the ASSOCIATE semantics (see my previous post). Note that the function result type (i.e. the type of the evaluated selector) is public, so the associating entity has a known type:

          associating entity
          v
associate(f => foo())
               ^
               selector

I was surprised to discover this obscure corner of the language myself. Some related threads where I was exploring ASSOCIATE include: