PostSharp SDK 2023.0 / / Class Reference / Post­Sharp.​Sdk.​Aspect­Infrastructure Namespace / Method­Mapping­Writer Class / Method­Mapping­Writer Methods / Method­Mapping­Writer.​Clone Method

MethodMappingWriter.Clone Method

Clones the current MethodMappingWriter.

Namespace:  PostSharp.Sdk.AspectInfrastructure
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 2023.0.3.0 (2023.0.3.0)
public virtual MethodMappingWriter Clone()

Return Value

Type: MethodMappingWriter
A clone of the current MethodMappingWriter.

Because of optimizations, instances of MethodMappingWriter are stateful. Therefore, the same instance cannot be shared among non-sequential InstructionSequence. A MethodMappingWriter should typically be cloned before using it to emit code in a InstructionSequence following a conditional branching instruction.

See Also