Thread overview | |||||
---|---|---|---|---|---|
|
September 24, 2010 [dmd-internals] dmd commit, revision 687 | ||||
---|---|---|---|---|
| ||||
dmd commit, revision 687 user: walter msg: add Don's new relaxed purity rules http://www.dsource.org/projects/dmd/changeset/687 |
September 26, 2010 [dmd-internals] dmd commit, revision 687 | ||||
---|---|---|---|---|
| ||||
Posted in reply to dsource.org | On 25 September 2010 02:52, dsource.org <noreply at dsource.org> wrote:
> dmd commit, revision 687
>
>
> user: walter
>
> msg:
> add Don's new relaxed purity rules
>
> http://www.dsource.org/projects/dmd/changeset/687
Great stuff!
In this part of FuncDeclaration::isPure() in func.c, I think that
should be: purity >= PUREconst.
Otherwise a member function like this one becomes PUREweak:
void foo(const X x) const pure;
2544 if (purity > PUREweak && needThis())
2545 { // The attribute of the 'this' reference affects purity strength
2546 if (type->mod & (MODimmutable | MODwild))
2547 ;
2548 else if (type->mod & MODconst && purity > PUREconst)
2549 purity = PUREconst;
2550 else
2551 purity = PUREweak;
2552 }
|
September 26, 2010 [dmd-internals] dmd commit, revision 687 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don Clugston |
Don Clugston wrote:
>
> Great stuff!
> In this part of FuncDeclaration::isPure() in func.c, I think that
> should be: purity >= PUREconst.
> Otherwise a member function like this one becomes PUREweak:
> void foo(const X x) const pure;
>
>
> 2544 if (purity > PUREweak && needThis())
> 2545 { // The attribute of the 'this' reference affects purity strength
> 2546 if (type->mod & (MODimmutable | MODwild))
> 2547 ;
> 2548 else if (type->mod & MODconst && purity > PUREconst)
> 2549 purity = PUREconst;
> 2550 else
> 2551 purity = PUREweak;
> 2552 }
>
I think you're right. Fixed.
|
Copyright © 1999-2021 by the D Language Foundation