Re: Contract programming

2014-12-17 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 17 December 2014 at 21:17:57 UTC, John Colvin wrote: On Wednesday, 17 December 2014 at 21:07:12 UTC, Oleg wrote: Is this behavior normal or it's bug? [code] import std.stdio; class A { float func( float x ) in { assert( x > 0 ); stderr.writeln( "A.func in

Re: Contract programming

2014-12-17 Thread John Colvin via Digitalmars-d-learn
On Wednesday, 17 December 2014 at 21:07:12 UTC, Oleg wrote: Is this behavior normal or it's bug? [code] import std.stdio; class A { float func( float x ) in { assert( x > 0 ); stderr.writeln( "A.func in block" ); } body { stderr.writeln( "A.func

Contract programming

2014-12-17 Thread Oleg via Digitalmars-d-learn
Is this behavior normal or it's bug? [code] import std.stdio; class A { float func( float x ) in { assert( x > 0 ); stderr.writeln( "A.func in block" ); } body { stderr.writeln( "A.func body block" ); return x / 3; } } class B : A {