Convert argument for sum aggregation
Source position: fpexprpars.pp line 678
public function TAggregateSum.ConvertArgument( |
aIndex: Integer; |
aNode: TFPExprNode; |
aType: TResultType |
):TFPExprNode; override; |
aIndex |
|
The index of the argument to convert |
aNode |
|
The node containing the argument |
aType |
|
The type to convert the argument to |
Returns the converted argument
The ConvertArgument method converts an expression node argument to an appropriate numeric type for summation. It handles type conversion between different numeric types to ensure compatibility during the sum calculation process.
The method takes the argument index, the expression node containing the value, and the target result type, then performs the necessary conversion to make the value compatible with the sum operation.
This conversion ensures that mixed numeric types can be properly summed together while maintaining appropriate precision and avoiding type-related runtime errors.