On Thursday, 19 September 2013 at 01:41:15 UTC, mrd wrote:
$ ./bug
body, value=2
out contract, value=0

Why argument "value" in contract isn't equal 2 ?

Why should it be? value is a mutable argument, and the out contract evaluates it at the return point, which is after it's set to 0. It is no different than using value in the body just before the return point.

If you want to preserve the original arguments until the return point, use const and create a mutable duplicate.

Ivan Kazmenko.

Reply via email to