ForwardDeclaration usage

Milian Wolff mail at milianw.de
Wed Feb 11 16:23:31 UTC 2009


On Wednesday 11 February 2009, Niko Sams wrote:
> On Wed, Feb 11, 2009 at 4:05 PM, Milian Wolff <mail at milianw.de> wrote:
> > On Mittwoch 11 Februar 2009, Andreas Pakulat wrote:
> >> On 11.02.09 14:15:24, Milian Wolff wrote:
> >> > I introduced a PreDeclarationBuilder for PHP but this introduced a
> >> > bunch of bugs I only now realize. Before I try to fix them, I wanted
> >> > to ask if I could not make it obsolete by using ForwardDeclarations.
> >>
> >> Note: I'm no DUChain expert, however
> >>
> >> > Take this code:
> >> >
> >> > ~~~~
> >> > <?php
> >> > $foo = new Bar;
> >> > class Bar {}
> >> > ~~~~
> >> >
> >> > I.e.: In PHP it is possible to use classes before they are actually
> >> > declared.
> >>
> >> Actually Bar is used before its defined.
> >
> > I always confuse those :)
> >
> >> Anyway, yes I think you could and should use ForwardDeclaration for
> >> that, because thats really what you're telling the PHP interpreter:
> >> Create a new object from the class Bar, which I will define later on.
> >
> > I'll try it out then, as soon as I got the time. But if this is a no-go
> > (zwabel?) I'd love to hear that beforehand :D
>
> I talked with david about exactly this issue and one way to solve this
> issue is using ForwardDeclaration. However I decided to run the
> DeclarationBuilder two times - just because it was much simpler to
> implement.
> If you resolve those ForwardDeclarations into real Declarations and remove
> the invalid ones after building I don't see any problem.


Good to hear that, if there's any additional information in your conversation 
with David, could you forward it to me? German is no problem as you will know 
:)
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090211/9b96f408/attachment.sig>


More information about the KDevelop-devel mailing list