Skip to content

Lab: probe --type-at: each build's type of an expression at a line #98

Backlog

Description

@mareklangiewicz

Lab issue (neospector lua/myemmylabcli.lua probe_cmd, lua/myemmylab.lua M.probe_table). Part of #17. From the 2026-11-26 retro.

Problem

Placing a flow or inference bug needs the type an expression has at a point, on each build. probe only shows hits, so the type is read off by hand: assign the expression to a ---@type boolean local and read the mismatch message. On 2026-11-26 this settled the plenary iterators.lua:351 line (#14 comment 7201050437):

local function f(param)
  local input = param[1]
  local input_len = #input
  local start = string.find(input, ",", 1, true)
  if not start then
    start = input_len + 1
  end
  ---@type boolean
  local t5 = start
  return t5
end
return f

gndx emmylua probe --bin=<1472 build> reveal.lua: 0.25.1 integer, upstream integer?, fork integer, 1472 integer?. The reveal locals were hand-written, five times in one file. A build that reports no mismatch (an any) shows nothing, which reads as "no data", not as any.

Want

  • probe --type-at=LINE:EXPR (repeatable): the lab copies the fixture, inserts ---@type boolean + local __t<n> = EXPR after LINE, and prints one row per EXPR with each build's type, any/unknown where no mismatch comes back.
  • The inserted lines must not shift the reported line numbers of the fixture's own hits.

Notes

  • The insertion is itself a read of EXPR, so flow after it can differ (a read can narrow). Rows say "after LINE". (unprobed)
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

    needs-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions