classCaseTyping
final class CaseTyping
Types a CASE expression.
Rule: PG-CASE-TYPING-001. The operand, then each branch's condition and result, then the ELSE result are derived in order. In a searched CASE each condition must be boolean (PG-OPERAND-CHECK-001); with an operand each condition is a value compared with it by =. The result is of the common type of the results and the ELSE result (PG-UNIFICATION-001); a conflict is reported. The result can be NULL when a result can, and when no ELSE is written. Termination: one pass over the branches. Source: https://www.postgresql.org/docs/17/functions-conditional.html#FUNCTIONS-CASE, https://www.postgresql.org/docs/17/typeconv-union-case.html. Status: Implemented.
Methods§
public function derive(
Derivation $derivation,
Environment $environment,
CaseExpression $case,
): ScalarFactDerives the parts of a CASE expression and its result.
Parameters
$derivation | Derivation | |
$environment | Environment | |
$case | CaseExpression |
Returns
Test cases 1
Called from 1
Calls 12
- method-call Derivation::scalar() line 38
- new OperandChecks line 39
- method-call OperandChecks::boolean() line 44
- method-call OperatorTyping::named() line 46
- new OperatorTyping line 46
- method-call Unification::resolve() line 57
- new Unification line 57
- function-call
in_arrayline 58 - method-call Derivation::report() line 59
- method-call OperandChecks::nullability() line 61
- new ScalarFact line 63
- class-const Nullability::Nullable() line 63
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.