[dmd-internals] dmd commit, revision 687

Don Clugston dclugston at googlemail.com
Sat Sep 25 22:56:27 PDT 2010


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	    }


More information about the dmd-internals mailing list