Export/use of namespaces: What is an "accessible identifier"?
2.1 says: When no identifier local to the current namespace is present, the unprefixed identifier is resolved against the identifiers accessible from the used namespaces. An error is raised during identifier resolution if more than one same-named identifier is accessible from the used namespaces.
Now in this code:
namespace a
struct foo
export foo
namespace b
struct bar:
foo: int
export foo
namespace c use a, b
struct baz inherits foo # mark
Will the marked line produce an error, because both namespaces a
and b
export an identifier foo
, or is this fine, because only in a
, the identifier is the name of a struct?
In other words: Is any identifier that is exported/used considered "accessible" or only identifiers that are relevant to the same context?