Beispiel #1
0
 /// <summary>
 /// Converts a value to the required type.
 /// </summary>
 /// <param name="value">The value to convert.</param>
 /// <param name="targetType">The required target type.</param>
 /// <param name="flags">The conversion flags.</param>
 private Value Convert(
     Value value,
     TypeNode targetType,
     ConvertFlags flags) =>
 value.Type == targetType || targetType.IsRootType
     ? value
     : CodeGenerator.CreateConversion(
     value,
     targetType,
     flags);
Beispiel #2
0
 /// <summary>
 /// Converts a value to the required type.
 /// </summary>
 /// <param name="value">The value to convert.</param>
 /// <param name="targetType">The required targt type.</param>
 /// <param name="flags">The conversion flags.</param>
 private Value Convert(Value value, TypeNode targetType, ConvertFlags flags)
 {
     if (value.Type == targetType || targetType == StructureType.Root)
     {
         return(value);
     }
     return(CodeGenerator.CreateConversion(
                Builder,
                value,
                targetType,
                flags));
 }