Bug 7117 – Regression(2.057, 1.072): out contract for class member functions are broken
Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2011-12-16T09:18:00Z
Last change time
2015-06-09T05:11:52Z
Keywords
wrong-code
Assigned to
nobody
Creator
leandro.lucarella
Comments
Comment #0 by leandro.lucarella — 2011-12-16T09:18:04Z
When upgrading from 1.071 to 1.072 I had problems with out contracts for class member functions. Here is a minimal testcase:
---
module bug;
extern (C) int printf(char*, ...);
class Sad
{
// only happens with class member functions, struct member functions work
// well and static class member function works well also
void func ( int n )
out
{
printf("out: %d\n", n);
assert ( n == 23, "DMD IS SO BROKEN");
}
body
{
printf("body: %d\n", n);
assert ( n == 23, "Expected to work");
return ;
}
}
void main(char[][] args)
{
auto c = new Sad;
c.func(23);
}
---
I tried to do a git bisect to come up with the exact commit that broke this but it was impossible because there are commits that doesn't compile. It would be nice if you could only commit changes that compiles to allow bisecting the code to find exactly where regressions were introduced.
(this was tested in both 32 and 64 bit version in Linux)
Comment #2 by dlang-bugzilla — 2012-01-03T12:41:24Z
(In reply to comment #0)
> I tried to do a git bisect to come up with the exact commit that broke this but
> it was impossible because there are commits that doesn't compile.
"git bisect skip" should help in such situations.
Comment #3 by clugdbug — 2012-01-04T05:54:59Z
(In reply to comment #2)
> (In reply to comment #0)
> > I tried to do a git bisect to come up with the exact commit that broke this but
> > it was impossible because there are commits that doesn't compile.
>
> "git bisect skip" should help in such situations.
Not in this case. Almost every commit was broken.
Comment #4 by leandro.lucarella — 2012-01-04T11:50:21Z
(In reply to comment #2)
> (In reply to comment #0)
> > I tried to do a git bisect to come up with the exact commit that broke this but
> > it was impossible because there are commits that doesn't compile.
>
> "git bisect skip" should help in such situations.
Good to know, but that kill the automation of git bisect run :(
Comment #5 by dlang-bugzilla — 2012-01-04T14:03:39Z
From git bisect's man page:
> The special exit code 125 should be used when the current source code cannot be tested. If the script exits with this code, the current revision will be skipped (see git bisect skip above).
Comment #6 by leandro.lucarella — 2012-01-04T14:38:08Z
(In reply to comment #5)
> From git bisect's man page:
>
> > The special exit code 125 should be used when the current source code cannot be tested. If the script exits with this code, the current revision will be skipped (see git bisect skip above).
Nice! I didn't know that. Thanks!
Comment #7 by bugzilla — 2012-01-25T12:38:42Z
*** This issue has been marked as a duplicate of issue 7335 ***