pub fn is_list_concat(node: &AIRNode, left: &AIRNode, right: &AIRNode) -> boolExpand description
True when a BinaryOp { op: Add, left, right } is list concatenation and
must be lowered to the target’s concat idiom rather than a native +.
Two independent signals, either of which suffices:
- The checker’s
bock_types::checker::LIST_CONCAT_META_KEYstamp — set on a+whose operands resolved toList[T]. This is the precise signal for every+the checker’s body pass reaches. - A syntactic fallback: one operand is a list literal (
xs + [todo]/[head] + tail). A list literal can only be+-combined with another list (numeric/string+never has a[...]operand), so this is unambiguous — and it covers+sites the checker’s body pass does not currently visit (e.g. insideimplmethod bodies, which are not yet type-checked), where the stamp is absent.
Each backend calls this from its NodeKind::BinaryOp { op: Add, .. } arm. See
the metadata key’s docs for the per-target lowering rationale.