Sign in Join
FPDoc Onlineexperiment

TIfOperation.NodeType function

Member of TIfOperationpublicIn unit fpExprPars

Get the result type for conditional operation

Declaration

pascal
function NodeType: TResultType; override

Function result

Returns the result type of the conditional

Description

The NodeType method determines and returns the result type for the conditional operation based on the types of the then-branch and else-branch expressions. The result type is typically the common type that both branches can be converted to.

The method analyzes both branch expressions to determine a compatible result type that can accommodate values from either branch, ensuring type safety in conditional expressions.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.