Class InjectLiteralType
Give Literal expressions a non-unknown type if they
appear e.g. in "a + b", where a is literal and b is double, or
"a ? b : c" where b is int. Also inject the correct type if
Content is parsable as an integer etc.
Inheritance
InjectLiteralType
Assembly: MetricSetTransformers.dll
public class InjectLiteralType : ChangeExpressions, IGenericExpressionVisitor<IEnumerable<Expression>>, IExpressionVisitor, IGenericVisitor<IEnumerable<Expression>>
Methods
View Source
Declaration
protected override Expression Change(BinaryOperation expr)
Parameters
Returns
Overrides
View Source
Give literals the correct type if their content is parsable. This should not
be necessary, but MDLCore produces Computation objects with content "1.3" and
C# type "int".
Declaration
protected override Expression Change(Literal expr)
Parameters
Returns
Overrides
View Source
In an expression like a? b: c where one of b, c is a Literal
with Unknown type, use the type of the other to infer the type
of the Literal.
Declaration
protected override Expression Change(TernaryOperation expr)
Parameters
Returns
Overrides
Implements
Extension Methods