Class used before declaration

Hamish Rodda rodda at kde.org
Sun Jan 11 03:55:06 UTC 2009


On Saturday 10 January 2009 03:02:53 Niko Sams wrote:
> Hi,
>
> I have another problem with Php support, in Php the following is possible:
> $a = new Foo;
> class Foo {}
>
> But in the TypeBuilder I can't find Foo - as its type and declaration
> not yet created.
>
> A second DeclarationBuilder run would work - but that is not very efficent.

Separate the type builder and the declaration builder, and run them in two 
passes.  That's why we have the separate abstract*builder classes and the 
inheritance and run order is specified by the language support plugin.

Cheers,
Hamish.




More information about the KDevelop-devel mailing list