Skip to content

CK_FN constant evaluation warns and returns undef when the function is missing (silent fallback) #1859

Closed

Description

@ehartford

No Silent Fallbacks

src/CodegenDispatch.w, the ConstKind.CK_FN branch of the constant evaluator: when a function constant's symbol is in neither fn_values nor the LLVM module it prints warning: [ck-fn] NOT FOUND sym=... name=... and returns wl_get_undef(...) — an undefined function value that compiles and misbehaves at run time.

Expected

A named BUG (sema_phase_bug) with the symbol: a function constant with no function is a compiler defect, never an undef.

Why filed, not fixed in the D65 batch

Turning it into an abort could break any program that reaches it today harmlessly (an unused reference), and the corpora that would show that are the coordinator's battery, not an agent's. Needs one battery with the BUG in place; grep the corpus logs for [ck-fn] NOT FOUND first.

Activity

  1. ehartford commented on Oct 3, 2026

    @ehartford
    ContributorAuthor

    Fixed on main by 792351b (stack #2007, battery green on 0f13a62). CK_FN constant evaluation with no function is a named BUG (sema_phase_bug), never undef.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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