Class StructuralTypeSubstitutionExpressionVisitor
Visitor to rewrite the expression nodes whose type is a structural type.
Inheritance
Inherited Members
Namespace: System.Linq.CompilerServices
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public class StructuralTypeSubstitutionExpressionVisitor : TypeSubstitutionExpressionVisitor
Constructors
StructuralTypeSubstitutionExpressionVisitor(IDictionary<Type, Type>)
Creates a new structural type substitution visitor using the specified type map.
Declaration
public StructuralTypeSubstitutionExpressionVisitor(IDictionary<Type, Type> typeMap)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.Type, System.Type> | typeMap | Dictionary mapping original types to their rewrite targets. |
Methods
AreStructurallyComparable(Object, Type)
Checks whether the value's type is structurally comparable with the specified type.
Declaration
protected virtual bool AreStructurallyComparable(object originalValue, Type newType)
Parameters
Type | Name | Description |
---|---|---|
System.Object | originalValue | Value whose type to check for structural comparability with the specified type. |
System.Type | newType | Candidate type the value will get converted to. |
Returns
Type | Description |
---|---|
System.Boolean |
|
ConvertConstant(Object, Type)
Converts constant nodes containing a rewritten type.
Declaration
protected override object ConvertConstant(object originalValue, Type newType)
Parameters
Type | Name | Description |
---|---|---|
System.Object | originalValue | Original constant expression node value. |
System.Type | newType | New structural type to rewrite the constant to. |
Returns
Type | Description |
---|---|
System.Object | Resulting object obtained from converting the original value to the new type. |
Overrides
ConvertConstantStructural(Object, Type)
Converts values of structural types to a new representation.
Declaration
protected virtual object ConvertConstantStructural(object originalValue, Type newType)
Parameters
Type | Name | Description |
---|---|---|
System.Object | originalValue | Original constant expression node value. |
System.Type | newType | New structural type to rewrite the constant to. |
Returns
Type | Description |
---|---|
System.Object | Resulting object obtained from converting the original value to the new type. |