If I'm not mistaken CompiledMethod instances are immutable. When you run 'compiledMethod methodClass compile: presentation text' another CompiledMethod object is created and installed in the methods dictionary. So in the display block 'aCompiledMethod' references the old method. To make this work you'll need to not reference the compiled method object directly or also refresh the list of methods.

Cheers,
Andrei





On Mon, Jul 3, 2017 at 5:48 PM, Hilaire <hilaire@drgeo.eu> wrote:
Ah sorry no it is not working as expected.

When I saved a modified method, the presenter got its source text
updated (good), but the morph view is reversed to its previous content.

Here is the code I use, anything wrong in the code bellow?

Thanks

Hilaire

sourceIn: composite ^ composite pharoMethod title: 'Source code'
translated; smalltalkClass: [ :each | each methodClass]; display: [
:aCompiledMethod | aCompiledMethod sourceCode ]; act: [ :presentation
:compiledMethod | compiledMethod methodClass compile: presentation text.
presentation update.] on: $s entitled: 'Save' translated

--
Dr. Geo
http://drgeo.eu