Table of Contents

Method EmitAwait

Namespace
MonoMod.Utils
Assembly
MonoMod.Utils.dll

EmitAwait(ILGenerator, Type)

Emits a runtime async await sequence to il.
public static void EmitAwait(ILGenerator il, Type awaitableType)

Parameters

il ILGenerator
The ILGenerator to emit to/
awaitableType Type
The type of the awaitable on stack.

Remarks

The awaitable is expected to be a valie on the top of the IL stack, even if its a value type. After the emitted code, the result (if any) of the awaitable will be on the top of the stack.

EmitAwait(ILProcessor, TypeReference)

Emits a runtime async await sequence to il.
public static void EmitAwait(ILProcessor il, TypeReference awaitableType)

Parameters

il ILProcessor
The ILProcessor to emit to/
awaitableType TypeReference
The type of the awaitable on stack.

Remarks

The awaitable is expected to be a valie on the top of the IL stack, even if its a value type. After the emitted code, the result (if any) of the awaitable will be on the top of the stack.