Hi,

I have a test case like that: 
-=-=-
testIncrementBy
        prefix := MyObject new numbers: #(1 10); yourself.
        prefix incrementBy: 10.
        self assert: prefix numbers equals: #(1 20).
-=-=-

and the byte code starts like that:
-=-=-
57 <40> pushLit: MyObject
58 <CC> send: new
59 <88> dup
60 <21> pushConstant: #(1 10)
-=-=-

If I run the test case, it is green, but the byte code changes into:
-=-=-
57 <40> pushLit: MyObject
58 <CC> send: new
59 <88> dup
60 <21> pushConstant: #(1 20)
-=-=-

The #incrementBy: method looks like:
-=-=-
incrementBy: aNumber
        numbers at: 2 put: (numbers at: 2) + aNumber
-=-=-

Is it correct that it also changes the method byte code? 
I can put "#(1 10) copy” into the test case. 
I am just curious if it is a feature or bug. 

Tested in Pharo4.0, Latest update: #40613.

Cheers,
Juraj

Reply via email to