Open sandboxFocus

Class TypeExtensions

Provides extension methods for IType.

Inheritance
TypeExtensions
Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public static class TypeExtensions

Methods

Name Description
DefaultValue(IType)

Generates the default(T) syntax for the type.

DerivesFrom(INamedType, INamedType, DerivedTypesOptions)

Determines if a type derives from another one, given as an INamedType.

DerivesFrom(INamedType, Type, DerivedTypesOptions)

Determines if a type derives from another one, given as a Type.

GetAsyncInfo(IType)

Gets the AsyncInfo for a type.

Is(IType, IType, ConversionKind, TypeComparison)
Is(IType, SpecialType, ConversionKind)
Is(IType, Type, ConversionKind, TypeComparison)
IsConvertibleTo(IType, IType, ConversionKind, TypeComparison)

Equivalent to the is operator in C#. Gets a value indicating whether the current type is assignable to another given type, given as an IType.

IsConvertibleTo(IType, SpecialType, ConversionKind)

Equivalent to the is operator in C#. Gets a value indicating whether the current type is assignable to another given type, given as a reflection Type.

IsConvertibleTo(IType, Type, ConversionKind, TypeComparison)

Equivalent to the is operator in C#. Gets a value indicating whether the current type is assignable to another given type, given as a reflection Type.

ToSerializableId(IType)

Gets a SerializableTypeId for the type.

ToTypeOfExpression(IType)

Gets an IExpression representing 'typeof' expression for the given type.