Open sandboxFocus

Struct InvocationArgument

Describes the argument passed to one parameter at a call site.

Namespace: Metalama.Extensions.Interceptors
Assembly: Metalama.Extensions.Interceptors.dll
Syntax
[CompileTime]
public readonly struct InvocationArgument

Properties

Name Description
Expression

Gets the argument expression written at the call site, for inspection only. The value is null when the argument is omitted (DefaultValue) and when the compiler materializes it from several expressions (ParamsElements). For a ref, out or in argument, it is the expression after the modifier.

IsNull

Gets a value indicating whether the instance is the default value of the struct, which the engine never creates and whose members are all null or default.

Kind

Gets a value indicating whether the argument is written explicitly, is a default value, or is an expanded params collection.

Parameter

Gets the parameter of the intercepted method.

Source

Gets the source of the argument, or null when the argument is not written explicitly.

Type

Gets the static type of the argument expression, or null when the expression has no type, for example a null literal, a lambda, a default literal or a collection expression.