static this sucks, we should deprecate it

Ary Borenszweig ary at
Thu May 28 11:23:48 PDT 2009

Steven Schveighoffer wrote:
> On Thu, 28 May 2009 13:59:10 -0400, Ary Borenszweig 
> <ary at> wrote:
>> Is there something wrong in my reasoning?
> It's just that you aren't always compiling every file at the same time...
> Static this' implementation isn't part of the public interface, so it 
> might not even *be* in the import file (if it's a .di file).

So it should be in the .di file.

   Where do
> you throw the compiler error, if you can't determine the circular 
> reference at comiple time?

You don't throw the error and that's it. What's the worse thing that 
could happen? A bug in the code. You go and you fix it. If there's no 
bug in the code and the compiler yells at you, that's very annonying 
(like in the example you showed).

> I think with the import system the way it is, the only safe prospect is 
> to have it error like it does now.  You either need some attribution 
> like has been suggested in this thread (and have the compiler verify 
> that attribution), or change the import system.

I still can't see what's the problem if the error were not issued by the 
compiler and static this would be run in the order defined by 
dependencies found in static ifs.

Until I see a real example where if the compiler doesn't issue an error 
then something *really bad* would happen, then I won't be able to give 
much more opinion about this. :-(

More information about the Digitalmars-d mailing list