[Issue 4648] "In" contracts in interfaces missbehaving

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 5 09:07:23 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=4648


Denis Karabaza <truesmiler at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |truesmiler at gmail.com


--- Comment #2 from Denis Karabaza <truesmiler at gmail.com> 2011-06-05 09:02:54 PDT ---
Same problem, when overriding contracted function (D 2.053, windows and
ubutnu).
So, it seems to be about all the contract inheritance.

class A {
  void f(int a)
  in { writeln(a); }
  out { writeln(a); }
  body {}
}

class B: A {
  override void f(int a) { writeln(a); }
}

void main() {
  A a = new B;
  a.f(42); // prints <garbage>, 42, <garbage>
}

-- 
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