Skip to content

Dead code in PL IR: unused fold_func_param, write-only prev_columns, unreachable display_ids #5793

@prql-bot

Description

@prql-bot

The nightly survey (2026-04-12) identified several pieces of dead code in the PL IR and related modules. These are structural enough that they may warrant maintainer review before removal.

1. fold_func_param is never called

fold.rs:289 exports fold_func_param but it has zero callers. The default fold_func implementation uses struct spread and only folds body and args, skipping FuncParam::default_value and Func::env. This means all PlFold implementors miss expressions within default parameter values and captured environments.

This could be a latent correctness issue if any fold pass needs to visit those fields, or it could be intentional if those fields are always resolved before folding occurs.

2. Lineage::prev_columns is write-only

lineage.rs:21 defines prev_columns which is populated by Lineage::clear() but never read anywhere. The comment says it is "A hack that allows name retention when applying ExprKind::All { except }", but no code reads it. It is also #[serde(skip)].

3. display_ids parameter is always false

lineage.rs:74 display_lineage accepts display_ids: bool but the only call site always passes false, making the true branch unreachable. Appears to be an unfinished debugging aid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions