irx.analysis.typing

irx.analysis.typing

Source: packages/irx/src/irx/analysis/typing.py

title: Type-computation helpers for semantic analysis.
summary: >-
  Compute expression result types for operators without embedding that logic
  directly into the main semantic visitor.

Functions

binary_result_type(op_code: str, lhs_type: astx.DataType | None, rhs_type: astx.DataType | None) -> astx.DataType | None

title: Compute the semantic result type of a binary operator.
parameters:
  op_code:
    type: str
  lhs_type:
    type: astx.DataType | None
  rhs_type:
    type: astx.DataType | None
returns:
  type: astx.DataType | None

unary_result_type(op_code: str, operand_type: astx.DataType | None) -> astx.DataType | None

title: Compute the semantic result type of a unary operator.
parameters:
  op_code:
    type: str
  operand_type:
    type: astx.DataType | None
returns:
  type: astx.DataType | None