[Issue 7457] New: nested pure functions not specified
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Feb 7 10:53:42 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7457
Summary: nested pure functions not specified
Product: D
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: timon.gehr at gmx.ch
--- Comment #0 from timon.gehr at gmx.ch 2012-02-07 10:53:41 PST ---
I think the following behavior of DMD is not mirrored in the documentation.
void main(){
int x;
void foo()pure{x=2;} // error
}
I think the spec is right, making this an error is problematic:
int bar(int delegate()pure dg)pure{return dg();}
int foo(int x)pure{
return bar({return x+1;});// error
}
struct Delegate{
int function(int*)pure fun;
int* context;
int call()pure{return fun(context);}
}
int bar2(Delegate dg)pure{return dg.call();}
int foo2(int x)pure{
return bar2(Delegate(function(int* ptr){return *ptr+1;}, &x)); // fine
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list