On 3-6-2010 14:58, Lars T. Kyllingstad wrote: > On Thu, 03 Jun 2010 00:02:03 +0200, Simen kjaeraas wrote: > >> On Wed, 02 Jun 2010 23:12:38 +0200, Adam Ruppe >> <[email protected]> wrote: >> >>> On 6/2/10, Simen kjaeraas <[email protected]> wrote: *snip* >>> >>> I haven't tried your code, but it looks similar to my own code, which >>> had this problem: >>> >>> alias Typedef!Int Handle; >>> alias Typedef!Int OtherHandle; >>> >>> void foo(Handle h) { } >>> >>> OtherHandle b; >>> >>> foo(b); // compiles, but shouldn't. Problem is that Handle and >>> OtherHandle are both alias of the same underlying thing, so the >>> compiler considers them the same thing! With the old typedef, I'm >>> pretty sure it would (correctly IMO) complain here. >> >> My code sidesteps that by including instantiation line and file, making >> each instantiation unique (as long as you don't do multiple typedefs on >> one line). > > Cool trick! :) > > -Lars
Cool trick indeed, but why do we need a trick for something so basic!? A few years from now we'll wonder why compiling moderately sized D projects takes a long time. When you can do something, it doesn't mean that you should. L.
