Class TypeUnifier
Pairwise checker for unification of type slims to types.
Inheritance
Namespace: System.Reflection
Assembly: Nuqleon.Linq.Expressions.Bonsai.dll
Syntax
public class TypeUnifier : Object
Constructors
TypeUnifier()
Instantiates a type unifier with safe flag set to false.
Declaration
public TypeUnifier()
TypeUnifier(Boolean)
Instantiates a type unifier.
Declaration
public TypeUnifier(bool safe)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | safe | true if no exceptions should be thrown, false otherwise. |
Properties
Entries
Set of types unified as a result of calling Unify.
Declaration
public ReadOnlyDictionary<TypeSlim, Type> Entries { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyDictionary<TypeSlim, System.Type> |
Methods
ResolveProperty(Type, PropertyInfoSlim)
Attempts to get the property info from the given CLR type that corresponds to the given slim property info.
Declaration
protected virtual PropertyInfo ResolveProperty(Type declaringTypeRich, PropertyInfoSlim propertySlim)
Parameters
Type | Name | Description |
---|---|---|
System.Type | declaringTypeRich | The CLR type declaring the property. |
PropertyInfoSlim | propertySlim | The slim property. |
Returns
Type | Description |
---|---|
System.Reflection.PropertyInfo | The property info from the CLR type or null if not found. |
Unify(ReadOnlyCollection<Type>, ReadOnlyCollection<TypeSlim>)
Attempts to unify a collection of CLR types with a collection of slim types.
Declaration
protected bool Unify(ReadOnlyCollection<Type> typeRiches, ReadOnlyCollection<TypeSlim> typeSlims)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.ReadOnlyCollection<System.Type> | typeRiches | The collection of CLR types. |
System.Collections.ObjectModel.ReadOnlyCollection<TypeSlim> | typeSlims | The collection of slim types. |
Returns
Type | Description |
---|---|
System.Boolean | true if each of the pairwise unifications are successful, false otherwise. |
Unify(Type, TypeSlim)
Attempts to unify a CLR type and a slim type.
Declaration
public bool Unify(Type typeRich, TypeSlim typeSlim)
Parameters
Type | Name | Description |
---|---|---|
System.Type | typeRich | The CLR type. |
TypeSlim | typeSlim | The slim type. |
Returns
Type | Description |
---|---|
System.Boolean | true if the unification was successful, false or exception thrown if safe is true or false, respectively. |
UnifyArray(Type, ArrayTypeSlim)
Attempts to unify a CLR type and a slim array type.
Declaration
protected virtual bool UnifyArray(Type typeRich, ArrayTypeSlim typeSlim)
Parameters
Type | Name | Description |
---|---|---|
System.Type | typeRich | The CLR type. |
ArrayTypeSlim | typeSlim | The slim type. |
Returns
Type | Description |
---|---|
System.Boolean | true if the unification was successful, false or exception thrown if safe is true or false, respectively. |
UnifyGeneric(Type, GenericTypeSlim)
Attempts to unify a CLR type and a slim generic type.
Declaration
protected virtual bool UnifyGeneric(Type typeRich, GenericTypeSlim typeSlim)
Parameters
Type | Name | Description |
---|---|---|
System.Type | typeRich | The CLR type. |
GenericTypeSlim | typeSlim | The slim type. |
Returns
Type | Description |
---|---|
System.Boolean | true if the unification was successful, false or exception thrown if safe is true or false, respectively. |
UnifyGenericDefinition(Type, GenericDefinitionTypeSlim)
Attempts to unify a CLR type and a slim generic definition type.
Declaration
protected virtual bool UnifyGenericDefinition(Type typeRich, GenericDefinitionTypeSlim typeSlim)
Parameters
Type | Name | Description |
---|---|---|
System.Type | typeRich | The CLR type. |
GenericDefinitionTypeSlim | typeSlim | The slim type. |
Returns
Type | Description |
---|---|
System.Boolean | true if the unification was successful, false or exception thrown if safe is true or false, respectively. |
UnifyGenericParameter(Type, GenericParameterTypeSlim)
Attempts to unify a CLR type and a slim generic parameter type.
Declaration
protected virtual bool UnifyGenericParameter(Type typeRich, GenericParameterTypeSlim typeSlim)
Parameters
Type | Name | Description |
---|---|---|
System.Type | typeRich | The CLR type. |
GenericParameterTypeSlim | typeSlim | The slim type. |
Returns
Type | Description |
---|---|
System.Boolean | Always throws exception; see comment. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | The base type unifier does not support unification of a slim generic parameter type and a CLR type. |
UnifySimple(Type, SimpleTypeSlim)
Attempts to unify a CLR type and a simple slim type.
Declaration
protected virtual bool UnifySimple(Type typeRich, SimpleTypeSlim typeSlim)
Parameters
Type | Name | Description |
---|---|---|
System.Type | typeRich | The CLR type. |
SimpleTypeSlim | typeSlim | The slim type. |
Returns
Type | Description |
---|---|
System.Boolean | true if the unification was successful, false or exception thrown if safe is true or false, respectively. |
UnifyStructural(Type, StructuralTypeSlim)
Attempts to unify a CLR type and a structural slim type.
Declaration
protected virtual bool UnifyStructural(Type typeRich, StructuralTypeSlim typeSlim)
Parameters
Type | Name | Description |
---|---|---|
System.Type | typeRich | The CLR type. |
StructuralTypeSlim | typeSlim | The slim type. |
Returns
Type | Description |
---|---|
System.Boolean | true if the unification was successful, false or exception thrown if safe is true or false, respectively. |