public override MSAst TransformCore(ScriptGenerator generator) { return(generator.ConvertTo( _destinationType.Type, ConversionResultKind.ExplicitCast, _child.Transform(generator))); }
public override MSAst TransformCore(ScriptGenerator generator) { var transformedOperator = _operand.Transform(generator); if (transformedOperator.Type == _targetType.Type) { return(transformedOperator); } if (Type == TypeManager.CoreTypes.String) { return(MSAst.Call( transformedOperator, CommonMembers.ObjectToString)); } return(generator.ConvertTo( Type, IsImplicitConversionRequired ? ConversionResultKind.ImplicitCast : ConversionResultKind.ExplicitCast, transformedOperator)); }