[Issue 5006] New: 'pure' unenforced in a nested function
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Oct 6 14:09:16 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5006
Summary: 'pure' unenforced in a nested function
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-10-06 14:08:53 PDT ---
This D2 code compiles and runs with no errors with dmd 2.049, and it ignores
the "pure" attribute:
int z = 1000;
int foo(int x) {
pure int bar(int y) {
z++;
return x + y + z;
}
return bar(x * x);
}
void main() {
assert(foo(10) == 1111);
}
I expect this code to not compile.
Is DMD missing unit tests for this?
--
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