Repository navigation
Description
Parent issue. Upstream is mentioned as plain text here ("upstream EmmyLuaLs#1364"): in this repo, #1364 would mean a fork issue.
Whether to draft, mark ready, ping, or close an upstream PR is Marek's call. Agents prepare things locally. Before writing an upstream PR from a fork fix, re-measure on upstream main (corpus diff with upstream main as base, plus "before" tests run against main's source). Fork numbers don't carry over (see AGENTS.md).
Open upstream PRs (state as of 2026-11-17)
| upstream PR | draft | branch | what |
|---|---|---|---|
| 1335 | no | fix-union-member-hover-1321 | 2026-12-05: main 2d2374f merged in (36af75b, pushed), MERGEABLE; test-file conflict only; both tests RED on main's build_hover.rs, GREEN here. Before: hover: field docs for members read through a union (upstream issue 1321) |
| 1337 | no | fix-metatable-index-declared-type-1319 | 2026-12-05: main 2d2374f merged in (175a240, pushed), MERGEABLE. PARTLY SUPERSEDED: main lets a member's ---@type win in member_type, so the member_type and types.rs parts were dropped; kept: signature_returns unknown row + metatable_index_is_closure (each alone RED on main for test_issue_1319_guarded_return_keeps_both_paths). Title + body rewritten 2026-12-05 (dropped part explained, Part of #1319). Before: declared member type beats __index (1319) |
| 1338 | no | feat-partial-field-docs-1318 | 2026-12-05: main 2d2374f merged in (7fb99f3, pushed), MERGEABLE; main already accepts the Partial<T> literal; the docs half (member.rs + access.rs) RED on main for both docs tests, GREEN here. Before: Partial<T> fields accepted, keep T's docs (1318) |
| 1340 | no | fix-string-table-index-1334 | 2026-11-26: main 4c18e8e merged in (886db49, lint fix 2e64d8d) and the cost fixed (6911ca1), pushed; MERGEABLE; explained in a PR comment (2026-11-26). The cost: the missing-member fallback asked undeclared types (vim.Range, TSNode) for an index signature, which marks the query incomplete and sweeps the caches on every read (gitsigns +77%, refactoring +91%, snacks +32%); names_undeclared_type answers None first. After: ab within noise (gitsigns +0.9%, refactoring −1.1%, snacks +2.5%), corpus vs main +124 net over 541 lines (321 agree with 0.25.1), CPU 49.4→50.2 s; the fix alone removed 43 sweep-made false hits (none on main or 0.25.1). Regression test pins the cache revision (red on the branch, green on main's files). index signature reads have the value type (1334) |
| 1341 | no | fix-object-index-undefined-field | undefined-field accepts keys matching an object index signature |
| 1353 | no | up-cross-file-call-return | a call to another file's member closure returns its signature |
| 1355 | no | up-duplicate-set-field-nested-target | 2026-12-05: main 2d2374f merged in (34d7b26, pushed), MERGEABLE. HALF SUPERSEDED: upstream 76c776b (receiver-path grouping) covers the nested-target half, so set_table_path was dropped; kept: the nil-module-field half (RED on main). Title + body rewritten 2026-12-05 (nil-field half only). Before: duplicate-set-field on different tables and nil module slots |
| 1359 | no | up-decl-return-slot | READY 2026-11-26: 97ce97c pushed, body updated (guard + corpus), CI 15 pass, marked ready, MERGEABLE. Before: 2026-11-26 (comments 7196565503, corrected by 7199113155): mini.icons WAS a 1359 bug: the port dropped the fork's is_value_list guard on the any fallback. Fixed in 97ce97c (local, NOT pushed; test RED→GREEN, 1997 pass, lint pass; corpus vs main: 95 lines, −53 net, 74 agree). The other adds are correct reports or main bugs (fork fixes e7f7c4b, ddd327e, both with no upstream PR). Push, then ready-or-hold: Marek's call. Before: 2026-11-26: main 4c18e8e merged in and pushed (5366d8b), MERGEABLE; tests 1996+243, lint pass. Corpus on 4c18e8e: −52 net over 138 lines, 95 agree with 0.25.1 (unchanged from 48ef52a); CPU 49.4→50.2 s. Still draft; bot review answered 2026-11-26 (claims re-probed on 5366d8b and main 4c18e8e). Before: NOT READY 2026-11-23: merged locally (worktree declslot, 28ab072). Corpus on 48ef52a: −52 net, 92 of 132 lines agree with 0.25.1, but adds suspect lines (treewalker heading.lua:157 expected nil but found integer?, telescope make_entry.lua:131). Read 2026-11-24 (comment): both are main bugs it exposes (treewalker = main's local x = nil contract, fork 3dcb757, no upstream PR yet); bot reply redrafted there. local a, b = f() gives each target its own slot |
| 1360 | no | up-flow-memo-guards | SUPERSEDED 2026-12-05: test_and_narrows_after_merge_of_earlier_guard is RED on the PR's base 4136671 and GREEN on main 2d2374f without the change. CLOSED 2026-12-05 (Marek), comment 7429385942. Before: a memoized flow state keeps the guards a later query brings. Main merged in 43f8b0e (2026-11-17); body updated with the corpus trace (comments below) |
| 1361 | yes | up-member-falsy-branch | NOT READY 2026-11-23: on main 48ef52a snacks.nvim times out (>120 s; main 7.6 s). Cause found (comment 2026-11-23): an upstream main hang that 1361 only exposes, fixed by upstream 1365; 1361 + 1365's 5294c22 finishes snacks in 7.3 s. Waits on 1365. Local merge + bot follow-up 17f9a2e4 in worktree falsy, NOT pushed. false branch of a member test keeps owners whose member can be falsy |
| 1362 | yes | up-class-overload-callable | 2026-12-05: main 2d2374f merged in (ba202fd, pushed), MERGEABLE; conflict = upstream's Option<bool> callability + alias_callability (8238cb0, b740a84), the @overload and generic-class rules re-placed in it (has_call_candidate); both PR tests RED on main's checker, GREEN here; 17 call_non_callable tests pass. Before: READY 2026-11-23: main merged in, bot review answered (15abbd8: generic alias + unresolved base tests). Corpus on 48ef52a: −114 call-non-callable, all agree with 0.25.1. macOS CI jobs cancelled (no runner); re-run asked. a class's @overload makes it callable (the fork's biggest load-bearing fix: 2242 hits) |
| 1364 | yes | fix-table-field-param-docs | 2026-11-26: main 4c18e8e merged in and pushed (3e4032d), MERGEABLE; tests 2000+245, lint pass. Corpus on 4c18e8e: +52 net over 85 lines (need-check-nil +22, undefined-field +22, preferred-local-alias +7: as on 48ef52a); CPU 49.4→50.5 s. Still draft. Before: NOT READY 2026-11-23: merged locally (worktree fieldparamdocs, 7b68eb5). Corpus on 48ef52a: +53 net (need-check-nil +22, undefined-field +22, preferred-local-alias +7); the undefined-field ones mostly match 0.25.1. Read 2026-11-24 (comment): 39 lines are on the fork too; the 19 that are not are main's unresolved-member nil (upstream 1451) and index-signature reads (1340). ---@param on a table-field function reaches its body |
| 1365 | no | fix-union-eq-repeated-member | CLOSED 2026-12-05 (Marek): superseded by upstream b740a84 (union refactor dedups members in LuaType::union; from_vec goes through it). Both PR regression tests pass on main 2d2374f without the complex.rs change. Before: a union with a repeated member equals itself (async.nvim overflow). 2026-11-23: merged main 48ef52a (435e835), + hang test 0ed22c1 (snacks.nvim fixture: main hangs since upstream EmmyLuaLs#1418; red 10/10, green 10/10), pushed; corpus up1365-1123: async.nvim, bufferline.nvim, neovim-runtime now finish, no stable hit change (13 lines = main's own flips); body + comment updated. Worktree uniondupeq. Unblocks 1361. |
| 1367 | yes | fix-index-write-value-type | NOT READY 2026-11-23: ported locally onto main (worktree indexwrite, 9ad4012a, not pushed; class check via class_contract_for_owner, index_key_type re-added). Corpus on 48ef52a: +60 assign-type-mismatch, +18 inject-field (old base: +11). Explained 2026-11-24 (comment): 51 of 78 are on the fork too (annotations, main's literal inject-field rule); 27 are main's index-read bug (upstream 1334 / PR 1340) showing through. Waits on 1340 like 1361 on 1365. a write through a table index is held to the value type (fork e1b65c9) |
| 1368 | yes | fix-global-member-type-across-files | READY 2026-11-23: ported onto main's MemberUse resolve_member (63eb37e), bot review answered (285f472). No corpus change on 48ef52a. macOS CI job cancelled (no runner); re-run asked. a global member's ---@type holds in every file |
| 1370 | no | fix-closure-param-cycle-guard | closure param evaluation inherits the cycle guard (tuis.nvim overflow). CppCXY's clone question answered 2026-11-17, no reply yet |
| 1371 | no | fix-solver-self-mentioning-binding | 2026-12-05: main 2d2374f merged in (17cf6d8, pushed), MERGEABLE; test-file conflict only; the test overflows its stack on main's function_solver.rs, GREEN here. Before: binding mentioning a bound generic stays out of the solver (mason.nvim OOM). Conflicts resolved 2026-11-17 (main merged in 5f7d76f), as CppCXY asked |
| 1421 | yes | fix-bare-question-optional | bare ? type literal lowers to nil, so LuaLS `T |
| 1445 | yes | fix-bare-question-optional | MERGED 2026-11-23 (upstream commit 53c20d3): bare ? lowers to nil, so ---@param n integer|? is optional (param half of 1421, fixes upstream issue 1425; #37, closed) |
| 1423 | yes | fix-missing-member-nullable-param | READY 2026-11-23: main merged in (conflict: both sides appended a test), bot review answered (a7c3980). Corpus on 48ef52a: −226 param-type-mismatch, all agree with 0.25.1. a missing union member is nil only for a param that rejects nil (fork a5c2132, #40) |
| 1447 | yes | up-member-write-skip-path | 2026-12-05: main 2d2374f merged in (91025b2, pushed), MERGEABLE; flow.rs conflicts = upstream's Result<_, DeferredMemberRead> walk, member_entry_type kept at the walk-start spots; 4 of 6 tests RED on main's flow.rs, GREEN here; 252 flow tests pass. Before: READY 2026-11-20 (opened as draft the same day): a member read before its write starts from the declared field; a function statement and a bare-nil read keep the old base (fork 72c462e → 67e6bfb, #41). Bot review answered at 2c009e2; rule narrowed in 76f8fb5, regression test a9affd2, body rewritten 2026-11-21. CI green. Awaiting maintainer review |
| 1437 | yes | fix-record-field-order | 2026-12-05: main 2d2374f merged in (f294f2c, pushed), MERGEABLE; test-file conflict only (both appended); test RED on main's simple_type.rs ({10,11,12}), GREEN here; 113 assign_type_mismatch tests pass. Before: READY 2026-11-23: main 48ef52a merged in (7c47b1f), bot review answered. 4-run repeat on the noisy trees: main varies on 16 lines in 4 files, this on 5 lines in blink only. a record literal's first mismatching field is the same every run: fields walked in key order, not hash order (fork 29b1a45, #59; addresses one source of upstream issue 1091) |
| 1448 | yes | fix-arg-min-last-required | READY 2026-11-23 (opened as draft 2026-11-22): the argument minimum is the last required param's position (fork 9115450, #78). 1445 merged; main 48ef52a merged in (1e001d7, 2026-11-23): +8 true missing-parameter, obsidian's 25 false hits gone; body updated |
| 1449 | yes | fix-attribute-overload-arity | READY 2026-11-23 (macOS jobs cancelled, no runner; re-run asked). attribute overload arity takes the last required param's position; hover reuses the checker's helper (fork 178f8ab, #81). Opened 2026-11-22. Re-measured on main 48ef52a (0f3a1ee, 2026-11-23): no corpus change. |
| 1450 | yes | fix-enum-key-base-type | READY 2026-11-23 (opened as draft 2026-11-22; re-measured on main 48ef52a, 02a8a83): an enum or named key fits a table of its base type; numeric_key_expanded removed (fork dbcc1da+c0e09ab1+1c80f90a+e18788c1, #82). The upstream corpus can't see it (all hits are in neovim-runtime) |
| 1451 | yes | fix-missing-member-of-unresolved-type | 2026-12-05: main 2d2374f merged in (d5616bb, pushed), MERGEABLE; test-file conflict only; RED on main's vm.rs, GREEN here. Before: READY 2026-11-23 (opened as draft 2026-11-22): a member missing from an unresolved name or an alias of a union is unknown, not nil (fork 8f00f19+4a14dd93, #83). Re-measured on main 48ef52a (1f72bc3): −2866 corpus hits; the blink config/sources.lua variation is main's own noise |
| 1456 | yes | perf-flow-read-memo | MERGED 2026-11-24 (upstream merge commit 1460735). Was READY 2026-11-23 (CI green, bot review answered at 0a68b20): a value read stops at the memo after a skipped merge and at a write (port of fork d9b600a + the memo half of 1f7c158 onto main 48ef52a; 3262c88 and the token half of 1f7c158 serve fork-only code). Opened 2026-11-23: 6400 × x = x + 1 115 s → 0.30 s, 1600 untouched merges 7.1 s → 0.20 s; corpus unchanged |
| 1458 | no | perf-member-use-named | 2026-12-05: main 2d2374f merged in (2b97f7a, pushed), MERGEABLE; upstream deleted phase_tests/ (92d2e12), so the p10 test moved to semantic_db/tests/query_tests.rs (test_named_members_are_the_full_list_filtered_by_name); perf test times out (5 s) on main's query.rs, GREEN here; 212 tests pass. A name-keyed member use reads the owner's by-name bucket in resolve_member_id |
| 1465 | yes | fix/resources-stamp | Opened as draft 2026-11-26: an unpacked resources dir is stamped VERSION+<hash of the embedded files>, judged in that dir, and the embedded trees are removed before an unpack (fork b596edb, #93; the same file as on the fork, applied cleanly onto main 4c18e8e as d6bd22c). On main: both tests red on their mutants (bare-version stamp, skipped removal), full suite 1995 and lint pass. No corpus leg: emmylua_check never reads the unpacked copy |
| 1471 | yes | fix-union-any-member-missing | Opened as draft 2026-11-26. Pushed 2026-11-26 (3e470e6 on main 4c18e8e); A union with an any/unknown component has no missing member (fork ddd327e). Tests RED→GREEN (any|string, unknown|string; the fork's pcall test was NOT RED on main, replaced), 1996 pass, lint pass. Corpus unionany-3e470e68-1126 vs main: −11 param-type-mismatch, all agree with 0.25.1, no adds |
| 1472 | no | fix-nullable-integer-arithmetic | READY 2026-11-26 (Marek). 2026-11-26: fork 45ec12c ported as e7d8170 (one raised_on_nil for # and -; the first port had left it out), pushed, body updated; corpus unchanged vs 298256f (57856 = 57856, only #59 flips). 2026-11-26: the 27 unexplained adds read (comment 7201050437): one 1472 defect, #x with no len answer kept the operand's nil (1 + #t[1] on any[]). Fixed in 298256f (squashed with a test-helper cleanup, pushed 2026-11-26; test RED→GREEN, 1998 pass, lint pass); corpus nilarith-ea6fd33a-1126 vs 055f184: need-check-nil −3 (the 3 lines), param −8 and assign −2 (lengths no longer nil-typed, mostly agree with 0.25.1), the rest #59 flips (corpus repeat: diffview config.lua, gitsigns compat.lua vary); ab vs main within noise. PR body updated 2026-11-26 (corpus need-check-nil +322 on 293 lines, 185 agree; param −48; assign −24 +5; the 27-line reading); still draft; ready-or-hold: Marek's call. Before: Opened as draft 2026-11-26. Pushed 2026-11-26 (2d41b6e + 055f184 on main 4c18e8e); integer? - 1 is integer, arithmetic and # on a nullable operand are need-check-nil (fork e7f7c4b+65c2b821, 4391566). Adapts 3 upstream tests (test_inline_variable_cast_in_arithmetic, the two #calls loop tests). Large effect: corpus nilarith-055f1846-1126 vs main: need-check-nil +325 on 297 lines (186 agree with 0.25.1; 27 lines neither 0.25.1 nor fork report), param −40, assign −21+4, return −3. Body asks upstream whether the number channel is deliberate |
Merged so far: 1304, 1305, 1336, 1354, 1372, 1373, 1445, 1456.
Regenerate the fork↔PR mapping with gndx emmylua fork rather than editing it by hand. Upstream main still has the quadratics fixed by fork 3262c88 / d9b600a / 1f7c158 (measured on 48ef52a, 2026-11-23: 6400 × x = x + 1 takes 115 s upstream, 0.33 s on the fork; 1600 untouched merges 7.1 s vs 0.23 s). The 2026-11-08 hold is lifted: Marek, 2026-11-23, "We shouldn't hold back any speedups." They are being ported upstream.
Sub-issues: candidates for new upstream PRs, and local branches waiting for a decision.
Activity
__indexstack overflow), c6fd72f0 (nearest-loop lookup) #13fix-closure-statement-docs: keep, rebase or drop #31?type literal lowers to nil (LuaLST|?), fork 14c7537a #37mareklangiewicz commentedon Nov 17, 2026
2026-11-17: upstream 1360, 1371 merged with main; 1370 answered; 1423 opened
vm.rs:781: upstream's owntype_of_expr_inheritclonescomputingthe same way; the set holds the in-progress chain (nesting depth) and clones only on aclosure_paramscache miss. Offeredstd::mem::take+ restore instead.is_in_cycle, upstream 1401). 1912 tests pass. The bug is still on main: the PR'stest_and_narrows_after_merge_of_earlier_guardfails on 4136671 alone.up-41366714-1117→memo-43f8b0ea-1117: 58021 → 57696, 706 changed lines. Removed 508 (488 agree with 0.25.1), added 198 (30 agree).assign-type-mismatch+36 −36 andundefined-field+23 −23 balance (constructor-field flakiness as in Quirk: which failing constructor field gets reported flips between runs #9, plus moved lines).unnecessary-if(LazyVimutil/cmp.lua:156,if session thenwheresession = active() and snip._session or niland_sessionis only ever assignednil) reduced to a fixture: main reports thatifwhen nothing sits between the assignment and theif, and misses it when an unrelatedif not ok then … enddoes. The branch reports both. With_sessiontypedtable?, main wrongly reports theifand the branch doesn't. So that added hit is the memo no longer hiding a guard. The other added categories (param-type-mismatch32,need-check-nil21 not agreeing) are not traced yet.mareklangiewicz commentedon Nov 17, 2026
Upstream 1360: the added corpus lines, traced (2026-11-17)
Follow-up to the comment above. 53 added
param-type-mismatch/need-check-nillines (memo-43f8b0ea-1117vsup-41366714-1117) don't agree with 0.25.1.Method: a reference build of main 4136671 with
trace_decl's memo off (if true || tree.is_in_cycle(flow_id)), i.e. the uncached walk the memo is meant to cache. Control: on 1360's own repro it reports 0need-check-nil, like the branch (main: 1). Run per tree underMemoryMax=3G MemorySwapMax=0, 180 s.41 of 53: the reference reports them too. These are hits the memo was hiding.
diffs.nvim (11): the reference times out even at 900 s (exponential without the memo), so these were read by hand.
runtime/cache.lua233, 251, 254, 256, 259, 266 (self.hunk_cache/self.ft_retry_pending may be nil): main already reports the same message on almost every other read of those fields in the file (170, 212, 225, 273, 283, 294–296). The branch fills in the reads main skipped. The message itself is wrong (both fields are declared non-optional), and main already has it.commands.lua2207, 2218, 2225, 2242: same hits, better messages. Main saidfound nilfordiff_lines, the branch saysfound string[]?.review.lua:559:normalized.targetafterif not normalized.target then return endreadsstring?. A fixture shows main reports this too, with no memo involved: a member guard doesn't hold when the receiver is a local narrowed fromNorm?byif not normalized then return end. Main's memo hides it in the real file.which-key
mappings.lua:258(1): differentially reduced (branch reportsfound nil, main doesn't) to:---@cast mapping wk.Mapping|wk.Spec;if mapping.desc == "x" then mapping.desc = nil end;if mapping.group and mapping.desc then mapping.desc = mapping.desc:gsub(…). The cause is main's member flow after a conditional write:Main drops the path that skips the write. The fork has the same bug. With a union receiver (
M|S), 1360 letsunnecessary-ifsee that wrong type, which gives the added "Impossible/Unnecessaryif" hits on code like that. Separately, the missing-union-member rule reports a colon call's receiver at the first argument's range (258:39 is"^%+").Verdict: no added line comes from 1360's own logic. Each one is either the uncached walk's answer or an existing main bug that the memo was hiding. Two of those main bugs are worth their own fork issues: the conditional member write dropping the skip path, and a member guard not holding on a nil-narrowed receiver. 1360 makes the first one visible as false
unnecessary-ifhits.Side note: on diffs.nvim restricted to
runtime/cache.lua+ the 29 type files, the branch ran in 7 s and main in 62 s.if not t.x then return enddoes not narrowt.xon main (fork and 0.25.1 do) #42mareklangiewicz commentedon Nov 17, 2026
Upstream 1360's body updated (2026-11-17): the three-codebase blast-radius table is replaced by the 54-tree corpus numbers above (508 removed / 488 agree with 0.25.1; 198 added, traced), and the main bugs it exposes are described (#41, #42). Speed note gained the 62 s → 7 s diffs.nvim measurement.
mareklangiewicz commentedon Nov 23, 2026
2026-11-23: every open draft re-measured on upstream main 48ef52a
Each branch had main 48ef52a merged in, then
gndx emmylua test, a red run of its new tests against main's source (--red-at=origin/main:…), lint, and a full corpus run diffed againstup-48ef52a0-1123. All new tests go RED → GREEN on main.Marked ready: 1448, 1449, 1450, 1451, 1437, 1423, 1362, 1368. Bot reviews answered on 1437, 1423, 1362 and 1368. 1362, 1368 and 1449 show cancelled macOS build jobs (the jobs never got a runner; no step ran), and a re-run needs maintainer rights, so each PR has a one-line ask.
Not ready (merges and follow-ups committed locally in their worktrees, NOT pushed; the PRs still sit on their old bases):
falsy): snacks.nvim times out at 120 s on the branch, twice; main does it in 7.6 s. The fork carries the same rule (4c1949d) and finishes snacks, so upstream likely needs a fork-only speedup first (Marek's 2026-11-08 hold covers those).indexwrite): the port onto main's rewritten checker adds +60assign-type-mismatchand +18inject-field(the old base added 11). Not yet explained: main's changed value inference, or the port (class check now class-only viaclass_contract_for_owner;index_key_typere-added).fieldparamdocs): +53 net; the +22undefined-fieldmostly match 0.25.1 (docs now type the closure params), the +22need-check-nil(13 in diffview) and +7preferred-local-aliasare unread.declslot): −52 net, 92 of 132 lines agree with 0.25.1, but adds suspect lines such as treewalkerheading.lua:157expected nil but found integer?(the past-the-end-is-nil slot rule the bot questioned). Bot reply drafted, not posted.Corpus runs kept:
up1437-1123,up1423-1123,up1359-1123,up1361-1123,up1362-1123,up1364-1123,up1367-1123,up1368-1123,rep1437-1123-*;snk1361-1123is scratch.mareklangiewicz commentedon Nov 23, 2026
1361 snacks.nvim timeout, first look (2026-11-23): upstream 1456 does not fix it (1361 + 1456 still times out at 120 s). gdb at 40 s (
gndx emmylua stack): need_check_nil → type_of_expr_at → flow::member_type_more_specific → type_check_cached → Comparisons::intern on big unions.member_type_more_specificandcomparison.rsare identical on the fork and main, so the fork keeps those unions smaller or reaches them less through another of its flow.rs changes; not bisected yet. Side finding: with 1361 alone, the untouched-merge chain read is quadratic (3537 flow steps at n = 16) and 1456 makes it 485.mareklangiewicz commentedon Nov 23, 2026
1361's snacks.nvim timeout is an upstream main hang, fixed by upstream 1365 (2026-11-23)
4a14dd93take 0.17 s. On the full tree main only gets lucky; 1361's false-branch rule routes snacks into the same shape.0.25.1..48ef52a0, fixture, 5 s cutoff): first bad 280987f = upstream fix(flow): avoid false nil warnings in guarded and metatable reads EmmyLuaLs/emmylua-analyzer-rust#1418 need-check-nil rewrite (one commit, 6f69ff1). The fork's merge of it (03cbf9f) was fast from the start.member_type_more_specificon main: the run hangs intype_check(DocFunction{ret: Table|X|X}, Signature). The union has a repeated member. Without 1365,LuaUnionMembers::eqsays such a union is unequal to itself, soComparisons::internnever finds its own key, and each read interns a fresh node. That matches gdb:intern→LuaUnionType::eqon top.17f9a2e4+ 5294c22 → snacks.nvim finished, 7.32 s CPU (main 7.36 s;outcome, machine loaded).Fixture (
emmylua_check -c /dev/null DIR):a.luab.luaLoad-bearing (each cut makes it fast): the second file's call, the global
Gclass route (a typed local is fast), both casts, theifaround the second cast, the genericresolve.Xis undeclared. One file is fast.mareklangiewicz commentedon Nov 24, 2026
Upstream 1367: what its corpus adds on main 48ef52a are (
corpus diff up-48ef52a0-1123 up1367-1123, +78 added lines: +60assign-type-mismatch, +18inject-field)Each added line was looked up in the fork's base run
merge-7d6084b4-1120(same file, line and code; the fork has carried this check since e1b65c9):51 of 78 are on the fork too. Samples read by hand agree with the annotations:
integerslots given anumber(gitsignshunks.lua,max()/min()bounds);table<integer, true>givenboolean?(treesitter-context:238);booleanfield givenboolean?(trouble). Theinject-fieldlines are main's own literal rule, now reached by index writes. Main already flags extra literal keys on a declared assignment, the same as these:a.lua:3 inject-field Field 'pid'panes[#panes + 1] = { id = "b", pid = 2 }(---@class Paneabove it)a.lua:7 inject-field Field 'id'one = { id = "c" }(local one ---@type Pane2+---@class Pane2above)So sidekick
tmux.lua:97,treesitter.lua:183andopencode.lua:40are that shape. A---@classon an assignment statement does not make its literal declare the class, on main or on the fork.27 of 78 are not on the fork, and come from main's index reads, not from 1367. On main a read through an index signature does not give its value type:
local x = p[1]with---@param p table<integer, S>, into---@type integerSSactive[1] and b and active[1] or nil(---@type table<integer, S>,local active = {})S?nilS?local function g2(w) local scope = active[w]; return scope and b and scope or nil endtrue?S?That is snacks
scope.lua:634(expected snacks.scope.Scope? but found true?). The others in this group have the samefound true/(true|…)andtableshapes: lazycache.lua:83, flashstate.lua:92, gitsignslog.lua:191, snackspicker/config/init.lua:152,image/terminal.lua:160,util/highlight.lua:520. Main's read bug is upstream issue 1334 (upstream PR 1340, open since 2026-10-31, now CONFLICTING).Verdict: the port is faithful. 1367's extra lines on main are 1340's bug showing through, the same way 1361 waits on 1365. Belief, not verified: that all 27 go away with 1340. Only the
scope.luashape was reduced; 1340 was not rebuilt on main.Fixtures (scratchpad, will be gone):
px67b(class-on-literal),px67e/px67f(index reads).mareklangiewicz commentedon Nov 24, 2026
Upstream 1364: what its corpus adds on main 48ef52a are (
corpus diff up-48ef52a0-1123 up1364-1123 --against v0251-1120; each line also looked up in the fork basemerge-7d6084b4-1120)On the fork too (39 lines): 16+2
undefined-field(0.25.1 reports them as well, with an older message wording, which is why the tag says "differs"), 7preferred-local-alias, 5need-check-nil, 5unnecessary-if, plus someparam/assign/return-type-mismatch. These are 1364 doing its job: a---@paramon a table-field function now types the body.Not on the fork (19 lines). These are two main bugs that the now-typed param exposes. The fork and an open upstream PR fix each one:
need-check-nil function 'p:find' may be nil---@param p Missing.Picker(unresolved),p:find()need-check-nil c.header may be nil---@field [string] Comp,c.header.namenil: LazyVimsnacks_picker.lua:48-52(snacks.Pickeris not in LazyVim's tree) and sidekickprompt.lua:81(sidekick.select_prompt.Item: snacks.picker.finder.Item, parent unresolved), plus that line'sinteger/numberparam hit. Fork 8f00f19 (A closure param typed by an unresolved name reads fields as nil, so its return mismatches (fork-only; #80 extends it to table literals) #83) = upstream 1451.file_history/render.lua×7 (CompStruct's---@field [integer|string] CompStruct). Same family as 1367's extras, upstream issue 1334 / PR 1340.nui/tree/init.lua:240and lspconfigperlls.lua:24(moved from:26on 1367's run too) are noise trees (A two-target assign-type-mismatch is reported on either line, run to run #59). diffviewinit.lua:196×2 agree with 0.25.1. LazyVimlsp/init.lua:309and diffviewconfig.lua:334were not read.Removed: 8
unnecessary-if, 5param-type-mismatch, 3assign-type-mismatch, all agreeing with 0.25.1.Verdict: the port is faithful. The 19 extras go once 1451 and 1340 land. The body still has no corpus section. Add one with these two groups when the branch is pushed (Marek's call). Belief: the 7 diffview lines are 1340's shape: reduced to a fixture, not run with 1340 built.
mareklangiewicz commentedon Nov 24, 2026
Upstream 1359: the suspect adds are main bugs it exposes, plus the bot reply rewritten (
corpus diff up-48ef52a0-1123 up1359-1123 --against v0251-1120; each added line looked up in the fork basemerge-7d6084b4-1120)Suspect adds that are not on the fork. Each reduces to a shape main already gets wrong, without 1359 (1359 only makes more call results known):
a.lua:2 assign-type-mismatch expected 'nil' but found '1'local x = nil/x = 1a.lua:15 return-type-mismatch expected 'nil' but found 'std.RawGet<…>'__indexclosure whose firstreturnis a nil localheading.lua:157(local level = nil, thenlevel = M.get_heading_level_from_node(…)) is the first row. Main treats a bare inferrednilinitializer as the local's reassignment contract. The fork fixed this in 3dcb757 ("an inferrednilis no assignment contract", 2026-10-24), which has no upstream PR. It is a small, standalone candidate: a 13-line change intypes.rsplus one test. Main flags plainlocal x = nil; x = 1.make_entry.lua:131is the second row. The fork reports nothing there; which fork commit fixes it was not identified.streams.lua:84,97function 'pipe:fileno' may be nil: a member of an unresolved type reads as nil, the same as on 1364 (fork 8f00f19 = upstream 1451).path.lua:877, mini.iconsicons.lua:482, refactoringutils.lua:101, diffviewconfig.lua:93(also added on 1367's run).inject-field×24 in snacks'.teststree, argparse, troubleapi.lua:49, …) are on the fork too.Bot review (2026-11-04), reply rewritten (the earlier draft was lost). Probe of the review's cases,
assign-type-mismatchinto---@type integer:local a, b = 5, thenblocal a, b = one()(---@return string), thenb---@return [string, boolean]..., slot 1booleanbooleanbooleannilnilnilDraft reply for 1359 (post when the branch is pushed, Marek's call):
mareklangiewicz commentedon Nov 24, 2026
New upstream PR 1458 (draft): perf, a name-keyed member use reads the owner's by-name bucket. Fork 7f7ae3a + c06f116, #86. It goes ready after CI and bot reviews, under the speedup rule.
mareklangiewicz commentedon Nov 26, 2026
Upstream 1359: its 5 open lines are read; none is a 1359 bug (
corpus diff up-4c18e8ef-1126 declslot-5366d8bf-1126 --against v0251-1126,--by-line --also=gate-b596edb6-1124for the fork column; fixtures probed on 0.25.1 / main 4c18e8e / fork b596edb / 1359 5366d8b)Two were never adds:
config.lua:93is a removal (agrees with 0.25.1).make_entry.lua:131is a reworded pair: main already reports it (expected ()), 1359 saysexpected nil. It folds away under--by-line. That is the row-2 shape of the 11-24 comment (main's__indexclosure).Three real adds, none on the fork:
debug/utils.lua:101expected integer but found number---@type integer|nil local m, thenout = m - 1: main reportsinteger←number; 0.25.1 and fork reportneed-check-nil. No 1359 shape needed. 1359 only makesspace_start's slot (integer|nil) knownpath.lua:877data may be nilPath:readreturnsself:_read_async(cb)(no value) or a string. 0.25.1, fork and 1359 saydata may be nil; main typesdatastring|()and reports a param mismatch with()in it insteadicons.lua:482expected any but found nilreduce(1359 shows it, main doesn't) → 23 lines, a recursiveMiniIcons.get→ getter →MiniIcons.get. 1359 typesicon(unknown|any)?(mainunknown?, fork()). Main alone:---@param y (unknown|any)?,if type(y) == 'table' then style(y.glyph) endreportsexpected unknown but found nilon main and 1359, nothing on 0.25.1 and fork;any?alone is cleanHow the slot-0 lines happen: main's
assignment_value_slotgives every local with its own valuemulti_return_index = Some(0), so 1359'sdecl_typebranch also runs for plainlocal x = f()(it takesfirst_result()). An experiment that limits the branch toindex > 0(built, not kept) drops the icons hit and plenary's correct one (back to main'sstring|()). So slot 0 is load-bearing, not an accident to strip.Side note, not a blocker: the
anyfallback for a slot past a single value's only slot can merge with a cycle'sunknownintounknown|any, the union main then mis-narrows. Collapsing that union is a possible follow-up, not a 1359 fix.Verdict: every 1359 add is explained (main bugs it exposes, or a correct report). Ready-or-hold is Marek's call.
mareklangiewicz commentedon Nov 26, 2026
Upstream 1359: correction to the comment above, plus root causes (fixtures in the three-way probe, plus 1359 as
bin1)Correction: mini.icons
icons.lua:482was a 1359 bug, not a main bug it exposes. 1359'sdecl_typeturns an unknown slot intoanywhenever the shell is not unknown, so also for an unknown value inside a result list. Main gives every local with its own valuemulti_return_index = Some(0)(assignment_value_slot), so this fires on plainlocal x = f()too. In the reduced recursiveMiniIcons.get,return cached[1], …(an undeclaredcached) gives an unknown first value. Asany, merged with the direct recursive return,iconbecame(unknown|any)?(main:unknown?). The fork never had this bug. Fork f056aee guarded the fallback with!is_list, later!shell.is_value_list()(84cd487), and 1359's port 480f6dd dropped the guard.Fixed on
up-decl-return-slotin 97ce97c (local, NOT pushed): the fork's guard plusTypeShell::is_value_list, whichresult_slot's expanding-tail check now uses too. Testtest_unknown_value_in_result_list_stays_unknown: RED → GREEN (--red-revert=HEAD), tests 1997 pass, lint pass. Corpusdeclslot-97ce97cd-1126against main: 95 changed lines (was 138), −53 net, 74 agree with 0.25.1; CPU 49.4 → 49.6 s. Against 5366d8b: mini.icons −1 (agrees); luarocksupload/api.lua:42need-check-nil comes back (main reports it too: 5366d8b had suppressed it through the sameany); the rest is rewording (24 luarocksinject-fieldnow print as on main) and the #59 flips (blink, diffview).An experiment that limited the whole slot branch to
index > 0dropped plenary's correct report too, so slot 0 stays.Main bugs, now with their fork fixes (each verified on main 4c18e8e unless marked):
integer|nil - 1readsnumber(refactoringdebug/utils.lua:101)vm.rsinteger_operand: every union member must be an integer,nilincludedany/unknowncomponent readsnilas an argument ((unknown|string).k, no guard needed)access.rsmember_missing_in_union:member_type(unknown, key).is_none()counts the component as missing the key; argument-only check, which is why a typed local reads it finestring|()(plenarypath.lua:877)string?local x = f()(agrees with 0.25.1 and fork)make_entry.lua:131expected nil(unannotated__indexclosure, firstreturn overrideafterif override)signature_return_typetypes a returned name by its declarationThe
(unknown|any)?→nilreading in the comment above is themember_missing_in_unionrow: itstype()guard is irrelevant.1359 verdict: with 97ce97c, every 1359 add is a correct report or a main bug shown above. Pushing 97ce97c to the PR branch, and then ready-or-hold, are Marek's call.
mareklangiewicz commentedon Nov 26, 2026
2026-11-26 follow-up: telescope candidate refuted, two upstream branches prepared
make_entry.lua:131: 523b3c5 is NOT the fork fix. A fork build with its re-ask off (nullable_here = false, scratch worktree, discarded) still reports nothing on the real file and on a 27-line reduction (__indexclosure:local override = handle_entry_index(…),if override then return override end,return rawget(…)), where main reportsexpected () but found std.RawGet<…>. The()is the contract fromreturn override, whose value is a call that mayreturnnothing: the same family as plenary'sstring|()(an empty result list read as a value). Root cause on main and the fork fix: still open.fix-union-any-member-missingandfix-nullable-integer-arithmetic(pushed, not opened).#xhalf too: with the arithmetic half alone, 35 added hits were#xoperands (main types#xof a nullablexnullable), all false.mareklangiewicz commentedon Nov 26, 2026
telescope
make_entry.lua:131: root cause on main (follow-up to 7200269245; scratch builds of main 4c18e8e, discarded)Two main bugs meet. Reduced (13 lines,
reducemain-shows / fork-not), then by variants:return_type_mismatch's member branch takesexpected_member_signature_for_closure; forlocal mt = { __index = function(t, k) … end }that is the literal's inferred field type, i.e. this closure's own inferred signature, already projected (instrumented: retBooleanfor a closure whose first return istrue,Variadic(Multi([]))=()for telescope'sreturn override). The same literal returned directly (no local) is not checked. Normally harmless (each return is in its own inferred union); it fails when a return's type drops out of that union, as an opaque alias does. Not fixed in the scratch build: the projected type carries no signature id to filter, and the same function fills param types, so the right cut is a design choice.rawget(t, k)is opaque: main leaksstd.RawGet<T,K>(fork b4aa7db degrades it tostd.RawGet<unknown,unknown>), which is never evaluated, on the fork too: filed as rawget(t, k) with unknown args stays std.RawGet<unknown,unknown>, failing every check (regression since 0.25.1) #96 (regression since 0.25.1).Why the fork is silent on telescope is still not pinned (it has bug 2's opaque value and the same member-branch code). Not chased further.
Fork fixes for related main bugs, no upstream PR: b4aa7db (unbound generics inside a call result's type arguments →
unknown), 27b8996 (rawgetwith a literal key no member answers →unknown; fixesrawget(t, 1)witht: integer[]against---@return integeron main).mareklangiewicz commentedon Nov 26, 2026
upstream 1472: the 27 added lines neither 0.25.1 nor the fork reports, read (2026-11-26)
Source:
corpus diff up-4c18e8ef-1126 nilarith-055f1846-1126 --against v0251-1126 --also=gate-b596edb6-1124 --by-line,+lines withoutagreesand with fork=0: 27 lines. Fixtures were probed on 0.25.1 / upstream 4c18e8e / fork b596edb / nilarith 055f184.1472's own false hit: 3 lines → fix before ready
diffview
utils.lua:720, plenaryscandir.lua:493,:524:n + #args[i]reports#args[i] may be nil. Cause: vm.rsunary_typefalls back tolength_type(..).unwrap_or_else(|| operand.clone()). When no member has alenanswer (any,unknown),#(any|nil)is typedany|nil, and the new arithmetic-operand check reports it. Main has the same fallback, but nothing there checked arithmetic operands. Fixture:---@param t any[]…return 1 + #t[1](1472 only). Candidate fix: drop nil in that fallback, as the PR's#nil-raises rule already does inlength_type. (The siblingargs[i] may be nilon the same line is main's element-read nil, below.)main bugs 1472 exposes (main already reports the same value elsewhere): 8 lines
resultsList.lua:92,153,155. Fixturemember_arr: main reportsline:sub(..)as may-be-nil, the fork doesn't.dashboard.lua:638,639. Fixturedyn_key_write: main reportsself.lines[row]:upper(), the fork doesn't (fork 0883e61).unknownvalue keeps the nil: plenaryiterators.lua:351. Fixturereveal: afterif not start then start = <unknown> + 1 end, main and 1472 typestartasinteger?, the fork asinteger.render.lua:179(expected true but found string; reduced to anorarm reading a missing member,c_noarith, which main reports with no arithmetic) and lualinelualine.lua:127(find(..) + 1isnumberon main too: main keeps the multi-return(integer?,integer?,string?...)as the operand type). Side note: 1472's nil check misses that operand, because the multi-return is not a union.true reports by the code's own types: 7 lines
mini.files
files.lua:2611,2612,2625,2626(H.match_line_offsetreturnsnilexplicitly), lualinelualine.lua:105(string.matchmay return nil), plenaryprofile/p.lua:200(ann = m.A and 0 or (m.a and 3); 0.25.1 reports 2× need-check-nil on that line), diffviewrender.lua:182(infer_width(): integer?; the fork reports it in fixtureand_or; the corpus fork is silent for other reasons).shape limits, as 0.25.1 has them: 3 lines
bloc.lua:18,19:gmatchcaptures after the first arestring?(stdfun(): string?...).hipatterns.lua:939:tofromfind, guarded only throughfrom. 0.25.1 reports this shape in fixturefind_pair.not reduced: 6 lines
treesitter-context
context.lua:213,221(range[3]in a loop), snacksnotifier.lua:458(self:sorthas no@return), diffscommands.lua:2181and lualinelualine.lua:68(nil-guard reassignment, likely the plenary class), dialdate.lua:625(osdate[kind]).Verdict: one 1472 defect (the
#fallback). The rest are consistent with main's existing reports, or true reports.mareklangiewicz commentedon Nov 26, 2026
plenary
string|(): root cause and fork fix 29ddf31 (installed, gated; local, NOT pushed)Cause (main and fork): need-check-nil reads a call's raw result-list type, so
is_nullablemisses the nil inside it. Two sites:prefix_type, which also serves#, andcheck_arithmetic_operand.string|()and(integer?,integer?,string?...)are result lists, not unions with nil. The VM already reads an operand's slot 0 (vm.rs binary/unary operands), and a parenthesized call is projected, which is why(g(1)) + 1was reported andg(1) + 1was not.gmay return nothing)g(1):upper()g(1) + 1/s:find("a") + 1#g(1)(g(1)) + 1Fix: one
value_type_at(the slot 0 of a result list, otherwise the type unchanged), used by both sites. Testtest_call_that_may_return_nothing_may_be_nil_as_a_value: RED → GREEN (--red-revert=HEAD). All 2290 tests pass, lint passes, the gate passes, andgate allplusnvim dev check emmyluaare clean.Corpus
slot0-dirty-1126(29ddf31's code) againstfork-b596edb6-1126: need-check-nil +110 −0, 70 agree with 0.25.1. The other 40 were read by hand and are all true nils: 37 grug-farget_inst()(0.25.1 reports the same nil plus afunction …:helptwin), LazyVimio.popen("uname"):read, and nvim-treesitter#string.match(..)×3.Lua-side answer: luagnd ceaf5e4 (
assert(io.popen('exit 3'))inspec/lua/gndx/exectree.lua, a true positive).Wording, not a bug: plenary
filetype.lua:183(match = filetype.detect_from_modeline(..)) is reported by every build after 0.25.1. Main prints the raw(string|()), and the fork words the same report differently. The assign checker shows the unprojected source. That's cosmetic, so it's not chased.Upstream (Marek's call): the index half is a main gap that predates 1472. The arithmetic half sits on 1472's new check. Options: add the fix to 1472 as one more commit, or open a separate PR for the index half.
need-check-nil: a call read as a value is its first result slot
mareklangiewicz commentedon Nov 26, 2026
Call-result slot 0: shipped (follow-up to 7203338396)
gate allplusnvim dev check emmyluaare clean. 83d4630 projects only a call, like both upstream branches. Corpusfork-83d46306-1126againstslot0-dirty-1126(29ddf31's code): 0 changed lines.docs.lua:71-74:local a, b = f()with---@return number?, number?, thenif a ~= nil and b ~= nil(reduced to 13 lines). Plenaryjob.lua:301,351and grug-farinputs.lua:505were the same false hit. The fork's flow didn't show it. The reduction is now a negative case in each branch's test, and it goes red against a mutant that projects names (--red-patch).nilarith-a023e2f4-1126againstnilarith-e7d81709-1126: need-check-nil +7, all matching 0.25.1, plus the diffview A two-target assign-type-mismatch is reported on either line, run to run #59 flip (±1). 1998 tests pass, lint passes.fix-call-prefix-first-result(worktreecallprefix, 6da5477): a call used as a prefix reads its first result (g(1):upper()). Corpuscallprefix-6da5477c-1126againstup-4c18e8ef-1126: need-check-nil +53 −0, 49 lines match 0.25.1. Of the rest, LazyVimio.popenand grug-farget_inst()were read and are true; the diffview and gitsignsassign-type-mismatch±4 are A two-target assign-type-mismatch is reported on either line, run to run #59 flips. 1994 tests pass, lint passes. 1472 and 1473 add the samevalue_type_at, so the second to merge gets a small conflict.gndx emmylua abwas not run.mareklangiewicz commentedon Nov 28, 2026
2026-11-28: 1472 merged, 1473 rebased
value_type_at, so the code change is justprefix_typecalling it, plus the test. The test fails with that change reverted and passes with it. 2027 + 253 tests pass, lint passes. The PR body was updated for the rebase. The corpus numbers in it were measured before the rebase.marek-main-fixesis 33 behind upstream 21fd014. The next merge meets 1472 inneed_check_nil.rs, which overlaps fork 83d4630. To resolve it, keep upstream's helper and re-add the fork's call sites.