[dmd-beta] dmd1beta test
Steve Schveighoffer
schveiguy at yahoo.com
Fri Jan 29 13:43:07 PST 2010
That looks like a bug in your code. If it was allowed before, I wonder what was put into the o instance.
anything between {} has to be evaluated at compile time, I think that rule has been in force for a long time.
The code should be:
Foo o = Foo(getInstance());
-Steve
----- Original Message ----
> From: Moritz Warning <moritz.warning at uni-bielefeld.de>
> To: dmd-beta at puremagic.com
> Sent: Fri, January 29, 2010 7:41:11 AM
> Subject: [dmd-beta] dmd1beta test
>
> I've successfully compiled Tango with dmd1beta.
>
> But one of my apps don't compile anymore.
> Is it a bug?:
>
> uint* getInstance() {
> return new uint;
> }
>
> struct Foo {
> uint* x;
> }
>
> void main(char[][] args){
> Foo o = {getInstance()};
> }
> /*
> main.d(226): Error: Cannot interpret new uint at compile time
> main.d(236): Error: cannot evaluate getInstance() at compile time
> */
>
> --
> Moritz Warning
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
More information about the dmd-beta
mailing list