PostSharp SDK 6.10 / / Class Reference / Post­Sharp.​Sdk.​Code­Model Namespace / Generic­Helper Class / Generic­Helper Methods / Generic­Helper.​Get­Canonical­Generic­Instance Method / Generic­Helper.​Get­Canonical­Generic­Instance Method (Field­Def­Declaration)

GenericHelper.GetCanonicalGenericInstance Method (FieldDefDeclaration)

Gets the canonical generic instance of a field.

Namespace:  PostSharp.Sdk.CodeModel
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: (
public static IField GetCanonicalGenericInstance(
	this FieldDefDeclaration field


Type: PostSharp.Sdk.CodeModel.FieldDefDeclaration
field whose canonical generic instance is requested.

Return Value

Type: IField
The canonical generic instance of field, or the unmodified field if the declaring type of field is not a generic type definition.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type FieldDefDeclaration. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
The canonical generic instance of a field is the field defined on the canonical generic instance of the declaring type. For instance, the canonical generic instance of the type MyType`3::myField is MyType`3<!0,!1,!2>::myField.
See Also