Re: Why it doesn't compile in D 2.0?

2010-01-16 Thread Don
aarti_pl wrote: W dniu 2010-01-16 15:30, Lutger pisze: Perhaps this is or should be a bug. You can override dup to work in ctfe: char[] dup(string str) { return str.dup; } class Test { string t1 = "test"; //Ok! char[] t2 = "test".dup; //Compile error char[] t3 = "test".dup(); //Ok! } The spe

Re: Why it doesn't compile in D 2.0?

2010-01-16 Thread Simen kjaeraas
Lutger wrote: Perhaps this is or should be a bug. You can override dup to work in ctfe: char[] dup(string str) { return str.dup; } class Test { string t1 = "test";//Ok! char[] t2 = "test".dup;//Compile error char[] t3 = "test".dup(); //Ok! } The problem with

Re: Why it doesn't compile in D 2.0?

2010-01-16 Thread Lutger
On 01/16/2010 04:18 PM, aarti_pl wrote: W dniu 2010-01-16 15:30, Lutger pisze: Perhaps this is or should be a bug. You can override dup to work in ctfe: char[] dup(string str) { return str.dup; } class Test { string t1 = "test"; //Ok! char[] t2 = "test".dup; //Compile error char[] t3 = "test"

Re: Why it doesn't compile in D 2.0?

2010-01-16 Thread aarti_pl
W dniu 2010-01-16 15:30, Lutger pisze: Perhaps this is or should be a bug. You can override dup to work in ctfe: char[] dup(string str) { return str.dup; } class Test { string t1 = "test"; //Ok! char[] t2 = "test".dup; //Compile error char[] t3 = "test".dup(); //Ok! } The spec even mentions i

Re: Why it doesn't compile in D 2.0?

2010-01-16 Thread Lutger
On 01/16/2010 02:01 PM, aarti_pl wrote: W dniu 2010-01-16 13:26, Simen kjaeraas pisze: aarti_pl wrote: class Test { string t1 = "test"; //Ok! char[] t2 = "test".dup; //Compile error } void main(char[][] args) { } Error: hello.d(3): Error: cannot evaluate _adDupT((& D12TypeInfo_Aya6__initZ)

Re: Why it doesn't compile in D 2.0?

2010-01-16 Thread aarti_pl
W dniu 2010-01-16 13:26, Simen kjaeraas pisze: aarti_pl wrote: class Test { string t1 = "test"; //Ok! char[] t2 = "test".dup; //Compile error } void main(char[][] args) { } Error: hello.d(3): Error: cannot evaluate _adDupT((& D12TypeInfo_Aya6__initZ),"test") at compile time hello.d(3): Erro

Re: Why it doesn't compile in D 2.0?

2010-01-16 Thread Simen kjaeraas
aarti_pl wrote: class Test { string t1 = "test"; //Ok! char[] t2 = "test".dup; //Compile error } void main(char[][] args) { } Error: hello.d(3): Error: cannot evaluate _adDupT((& D12TypeInfo_Aya6__initZ),"test") at compile time hello.d(3): Error: cannot evaluate _ad

Why it doesn't compile in D 2.0?

2010-01-16 Thread aarti_pl
class Test { string t1 = "test"; //Ok! char[] t2 = "test".dup; //Compile error } void main(char[][] args) { } Error: hello.d(3): Error: cannot evaluate _adDupT((& D12TypeInfo_Aya6__initZ),"test") at compile time hello.d(3): Error: cannot evaluate _adDupT((& D12TypeInfo