Thread overview | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
June 12, 2010 [dmd-beta] dmd 2.047 beta (once again) | ||||
---|---|---|---|---|
| ||||
New std.concurrency, std.container, std.typecons http://ftp.digitalmars.com/dmd2beta.zip |
June 13, 2010 [dmd-beta] dmd 1.062 and 2.047 beta | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | I have found the following regression in dmd 1.062 (works with 1.058). Fawzi module bug1; class A{ int f(int a){ return a; } static A defaultA; static this(){ defaultA=new A(); } } void TT(T)(T rIn, int delegate(int) arg=&A.defaultA.f) { arg(2); } void instantiateTT(){ TT!(real)(4); } // with 1.062 // bug1.d(15): Error: cannot inline default argument &defaultA.f |
June 13, 2010 [dmd-beta] dmd 1.062 and 2.047 beta | ||||
---|---|---|---|---|
| ||||
Posted in reply to Fawzi Mohamed | thinking more about this maybe it is not a bug but a feature :)
Indeed it is not clear which value of defaultA should be used, and what should happen if defaultA is reassigned.
It did seem to work correctly: the value after the static initializer was used, but maybe in some cases the value before the static initializer would be used.
If this is the case it is strange that defining a function with such a default argument works....
Fawzi
On 13-giu-10, at 16:23, Fawzi Mohamed wrote:
> I have found the following regression in dmd 1.062 (works with 1.058).
>
> Fawzi
>
> module bug1;
>
> class A{
> int f(int a){
> return a;
> }
> static A defaultA;
> static this(){
> defaultA=new A();
> }
> }
>
>
> void TT(T)(T rIn,
> int delegate(int) arg=&A.defaultA.f)
> {
> arg(2);
> }
>
> void instantiateTT(){
> TT!(real)(4);
> }
>
> // with 1.062
> // bug1.d(15): Error: cannot inline default argument &defaultA.f
>
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
|
June 13, 2010 [dmd-beta] dmd 1.062 and 2.047 beta | ||||
---|---|---|---|---|
| ||||
Posted in reply to Fawzi Mohamed | Can you put it on bugzilla, please?
Fawzi Mohamed wrote:
> thinking more about this maybe it is not a bug but a feature :)
>
> Indeed it is not clear which value of defaultA should be used, and what should happen if defaultA is reassigned.
>
> It did seem to work correctly: the value after the static initializer was used, but maybe in some cases the value before the static initializer would be used.
>
> If this is the case it is strange that defining a function with such a default argument works....
>
> Fawzi
> On 13-giu-10, at 16:23, Fawzi Mohamed wrote:
>
>> I have found the following regression in dmd 1.062 (works with 1.058).
>>
>> Fawzi
>>
>> module bug1;
>>
>> class A{
>> int f(int a){
>> return a;
>> }
>> static A defaultA;
>> static this(){
>> defaultA=new A();
>> }
>> }
>>
>>
>> void TT(T)(T rIn,
>> int delegate(int) arg=&A.defaultA.f)
>> {
>> arg(2);
>> }
>>
>> void instantiateTT(){
>> TT!(real)(4);
>> }
>>
>> // with 1.062
>> // bug1.d(15): Error: cannot inline default argument &defaultA.f
>>
>> _______________________________________________
>> dmd-beta mailing list
>> dmd-beta at puremagic.com
>> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>
> _______________________________________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/dmd-beta
>
>
|
June 13, 2010 [dmd-beta] dmd 1.062 and 2.047 beta | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On 13-giu-10, at 18:12, Walter Bright wrote: > Can you put it on bugzilla, please? http://d.puremagic.com/issues/show_bug.cgi?id=4304 > > Fawzi Mohamed wrote: >> thinking more about this maybe it is not a bug but a feature :) >> >> Indeed it is not clear which value of defaultA should be used, and what should happen if defaultA is reassigned. >> >> It did seem to work correctly: the value after the static initializer was used, but maybe in some cases the value before the static initializer would be used. >> >> If this is the case it is strange that defining a function with such a default argument works.... >> >> Fawzi >> On 13-giu-10, at 16:23, Fawzi Mohamed wrote: >> >>> I have found the following regression in dmd 1.062 (works with 1.058). >>> >>> Fawzi >>> >>> module bug1; >>> >>> class A{ >>> int f(int a){ >>> return a; >>> } >>> static A defaultA; >>> static this(){ >>> defaultA=new A(); >>> } >>> } >>> >>> >>> void TT(T)(T rIn, >>> int delegate(int) arg=&A.defaultA.f) >>> { >>> arg(2); >>> } >>> >>> void instantiateTT(){ >>> TT!(real)(4); >>> } >>> >>> // with 1.062 >>> // bug1.d(15): Error: cannot inline default argument &defaultA.f |
Copyright © 1999-2021 by the D Language Foundation