Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

segfault @[try_suggestion] accepts a suggester whose type gained section variables in a mutual block

Open
#15,744 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Domain
compilers

Research direction

Start with the reproducer in the issue and inspect how @[try_suggestion] handles suggester declarations inside a mutual block, especially when a type gains section variables. Run the reproducer to confirm the segfault, then trace the relevant elaboration or registration path. Done means the example completes without a segfault and the suggestion behavior remains correct; the issue names no source file or test.

Written by the indexing model from the issue text.

Description

bug

The following code:

import Lean.Elab.Tactic.Try
open Lean Meta Elab Tactic
opaque P : Prop
axiom p : P
variable {α : Type} [Inhabited α]
mutual
def usesVar : α := default
@[try_suggestion]
def sugg (goal : MVarId) (_ : Try.Info) : MetaM (Array (TSyntax `tactic)) := goal.withContext do
  let term ← PrettyPrinter.delab (mkConst ``p)
  return #[← `(tactic| exact $term)]
end
example : P := by try?

Resulted in this output:

Segmentation fault (core dumped)        (exit code 139)
Dominant language
Lean
Stars
9.6k
Forks
1.1k
Avg merge
23h 57m
Merged PRs (30d)
264

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from leanprover/lean4

All issues in leanprover/lean4

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.