Hendrik Kühne writes:
> After searching around for a while I observered that Semantic seems
> not be able to apply a 'using namespace' declaration correctly on
> method implementations.
Well, sort of. It does look at using statements when calculating scope,
but it does so on the fly when you look up types. However, in this case,
this is not enough...
> Instead of putting them into the namespace defined by a preceding
> using declaration, Semantic stores these at global scope, causing
> semantic-analyze-proto-impl-toggle to be unable to find the
> implementation for a method declaration.
Yep. On a general note, it's really hard to deal with the using
directive since it can be placed practically anywhere and will change
name lookup from there on; Semantic actually doesn't care for that - it
always implicitly assumes that the using directive applies to the whole
scope, which is incorrect, but we're in good(?) company there[1].
Your problem is even harder, and I'd be very surprised if there's an
easy fix. I currently wouldn't even know where to start. I think we have
to somehow interpret the using directive as a namespace declaration, but
carefully avoiding all the pitfalls since they are of course not the
same.
I guess we could also hack around the problem, by searching for all
Test::bla types and checking if there's a using statement in their
scope. Hmm...
-David
[1] See the note at
http://msdn.microsoft.com/en-us/library/aewtdfs3%28v=vs.80%29.aspx
|