Metalama 1.0 / / Metalama Documentation / Aspect API / Metalama.​Framework.​Aspects / meta / Compile­Time

Method CompileTime

CompileTime<T>(T)

Coerces an expression to be interpreted as compile time. This is typically used to coerce expressions that can be either run-time or compile-time, such as a literal. Since ambiguous expressions are interpreted as run-time by default, this method allows to change that behavior.

Declaration
public static T CompileTime<T>(T expression)
Parameters
Type Name Description
T expression

An expression.

Returns
Type Description
T

Exactly expression, but coerced as a compile-time expression.

Type Parameters
Name Description
T
See Also