PostSharp SDK 6.10 / / Class Reference / Post­Sharp.​Sdk.​Code­Model Namespace / Type­Signature­Extensions Class / Type­Signature­Extensions Methods / Type­Signature­Extensions.​Is­Assignable­To Method / Type­Signature­Extensions.​Is­Assignable­To Method (IType­Signature, IType­Signature, Generic­Map)

TypeSignatureExtensions.IsAssignableTo Method (ITypeSignature, ITypeSignature, GenericMap)

Determines whether instances of the current type is assignable to locations of a specified type (i.e. whether the current type derives or implements this type) and specifies a GenericMap.

Namespace:  PostSharp.Sdk.CodeModel
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: 6.10.14.0 (6.10.14.0)
Syntax
C#
public static bool IsAssignableTo(
	this ITypeSignature derivedType,
	ITypeSignature baseType,
	GenericMap genericMap
)

Parameters

derivedType
Type: PostSharp.Sdk.CodeModel.ITypeSignature
The derived type.
baseType
Type: PostSharp.Sdk.CodeModel.ITypeSignature
The type that the current type may derive or inherit.
genericMap
Type: PostSharp.Sdk.CodeModel.GenericMap
Map that has to be applied on generic arguments of baseType before the comparison is performed. It is generally wrong to pass an empty generic map (like Empty). The identical generic map should be passed instead.

Return Value

Type: Boolean
true if the current type can be assigned to (i.e., derives or implements) baseType, otherwise false.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ITypeSignature. 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).
Remarks
There are some exceptions to the rule that a type can be assigned to another if it derives or implements it. For instance, an Int32 is assignable to an UInt32.
See Also