Open sandboxFocus

Property ThisType

ThisType

Gets a dynamic object that must be used to get access to static members of the type (e.g. meta.ThisStatic.MyStaticMethod()). If the current declaration is an extension member, the property returns the declaring type, not the receiver type.

Declaration
public static dynamic ThisType { get; }
Property Value
Type Description
dynamic
Remarks

The ThisType property exposes the state of the target type as it is after the application of all aspects. It corresponds to InvokerOptions.Final. To access the prior layer (or the base type, if there is no prior layer), use BaseType. To access instance members, use This.

Because ThisType returns a dynamic value, static members accessed through it are validated at template expansion time, not at template compilation time.

See Also