Distinguishing between "instance of class" and "class" types in the duchain
Sven Brauch
svenbrauch at googlemail.com
Mon Apr 9 20:32:02 UTC 2012
Hello there,
there's something I'm unsure about how to correctly represent it in
the duchain: the difference between "class" and "instance of a class".
My current solution is that a class declaration creates a structure
type, and if I want to reference the class itself (not an instance of
the class) I create an alias declaration which aliases the class
declaration. That is not really optimal for several reasons tough:
there's always the need to search for declarations if you work with
types, e.g. if handling an assignment, you cannot simply assign B the
type of A, but you have to check if A is a class or an instance of a
class, then create an alias declaration or something else depending on
that... etc; additionaly, it's not possible to store class types in
unsure types that way (a declaration cannot have an unsure type which
could either be a class or None, or similar).
Is there a good way to do this?
Is there a good *idea* which I could implement in the duchain to solve
this problem? It's really messy right now.
Cheers,
Sven
More information about the KDevelop-devel
mailing list