I'm using a code mutator to implement my "pseudo-source" idea that I described in another discussion.
I mutate all nodes that have locations to add the respective location in the file generate by the C# source emitter.
When I have to mutate method definition, I call GetMutableCopy(methodDefinition);. It will return a new MethodDefinition which is initialized using the Copy() method. Copy(), among the other things, will set the Body property to the same value of the
Now, method bodies have a reference to the defining method so the new MethodDefinition's Body property will contain a reference to a method body that has a reference to another method definition.
I don't see a place where this is fixed and in fact even if I add a location to the MethodDefinition, when the Body.GenerateIL() is called no location is available in the referenced defining method.