Repository navigation
[Backport releases/v4.34.0] fix: show goal of empty nested by block at positions indented past the enclosing tactic - #15104
Merged
Conversation
…the enclosing tactic (#15095) This PR fixes the goal view showing the state after `have` instead of the goal of an empty nested `have ... := by` block on the following line, where the next tactic is about to be typed (#15053, regression of #1927 from #13229). The `isEmptyBy` heuristic in `InfoTree.goalsAt?` was removed in #13229 because empty `by` blocks no longer produce `.missing` syntax. Instead of checking for emptiness, `by` blocks and tokens are now flagged as `hangingBy`, and whether they count as indented is decided by the enclosing tactic by comparing the hover column with its own column, which matches where the parser would put a tactic typed at that position. Co-authored-by: Claude Fable 5.1 <[email protected]> (cherry picked from commit 1163653)
FawadHa1der
added a commit
to FawadHa1der/lean4
that referenced
this pull request
Oct 23, 2026
298 upstream commits. The line's merge base with v4.35.0 is master (leanprover#14729); the line also carries the v4.34.0 release branch's backports (leanprover#14788, leanprover#14791, leanprover#14833, leanprover#14838, leanprover#14849, leanprover#14477's intrinsic- verification change, leanprover#14938, leanprover#15104), which v4.35.0 holds as the master originals, several reworked since. Eighteen files conflicted; how each was resolved: - Upstream-only files (no fork commit touches them): v4.35.0's version, byte for byte — CMakeLists.txt (version 4.35), src/Init/{Core,Prelude}.lean, src/Lean/Compiler/LCNF/ToDecl.lean, src/Lean/Elab/{BuiltinDo/For,Do/Basic,Tactic/Do/Contract}.lean, src/Lean/Server/InfoUtils.lean (drops the v4.34.0-only backport leanprover#15104, which v4.35.0 does not carry), tests/elab/ {csimp_macroinline,experimentalIntrinsic,intrinsicVerification}.lean; tests/elab/14383.lean (a v4.34.0-backport test v4.35.0 does not have) removed. Afterwards every upstream-only file equals v4.35.0; the 57 files that differ are the fork's own. - src/include/lean/lean.h, src/runtime/object.cpp: the conflicts were upstream's reference-count ("sticky"/rc_model) code against its v4.34.0 backport: v4.35.0's side; the line's older lean_dec_ref_cold (backport, with LEAN_LAZY_RC, which v4.35.0 removed) deleted so v4.35.0's is the only one. Kept: the fork's pointer-width LEAN_SCALAR_PTR_LITERAL (lean.h) and task manager (0035/0038, object.cpp) — each file now differs from v4.35.0 by exactly those. - src/stdlib.make.in: the `lean` link keeps the fork's ${LEAN_WASM_SYMTAB} (0039) and takes upstream's new ${CMAKE_DYN_EXE_LINKER_FLAGS_MAKE} (leanprover#14884), which is empty under Emscripten (-rdynamic and the shared libraries are added only outside it) and needed by native64. - src/Lean/Shell.lean: both imports (the fork's Lean.Compiler.InitAttr, upstream's Std.Async.Process). - src/runtime/uv/event_loop.cpp: v4.35.0's line (a comment differed). - .github/workflows/{build-template,ci}.yml: the fork's CI. - stage0/: v4.35.0's, with the line's two pointer-width gates re-applied by hand (the patch's context moved); wasm64-build/stage0-line-edits.patch refreshed from `git diff --text v4.35.0 -- stage0`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport 1163653 from #15095.