[Issue 6417] Wrong context point for delegates inside contracts of class member functions
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jul 31 15:32:25 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6417
kennytm at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kennytm at gmail.com
Platform|x86 |All
Summary|Problem with count inside |Wrong context point for
|out{} of class method |delegates inside contracts
| |of class member functions
OS/Version|Windows |All
--- Comment #1 from kennytm at gmail.com 2011-07-31 15:32:23 PDT ---
Reduced test case:
-------------------------------
//import core.stdc.stdio;
class Bug6417 {
void bar()
in {
int i = 14;
assert(i == 14);
auto d = (){
assert(i == 14, "in contract failure"); // <-- fail
};
//printf("%p %p\n", d.ptr, &this);
d();
}
out {
int i = 10;
assert(i == 10);
(){
assert(i == 10, "out contract failure"); // <-- also fail
}();
}
body {}
}
void main() {
(new Bug6417).bar();
}
-------------------------------
When running, the "in contract failure" assertion will be thrown.
--
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