Zulip Chat Archive

Stream: lean4

Topic: Panic (unreachable code has been reached) with quotients


Snir Broshi (Dec 17 2025 at 06:54):

def space : Type :=
  Quot (α := Bool × Bool) fun ⟨_, _⟩ ⟨_, _⟩  True

def subspace := { x : space // True }

def foo : subspace  subspace :=
  fun x, _⟩  x.lift sorry sorry

I wonder if this is what took down live.lean-lang.org right now (I'd guess it uses containers so no), or if there's an unrelated maintenance.
repros on nightly (4.28.0-nightly-2025-12-16)

PANIC at Lean.Compiler.LCNF.Expr.forFVarM Lean.Compiler.LCNF.FVarUtil:45:38: unreachable code has been reached
backtrace:
PANIC at Lean.Compiler.LCNF.Expr.forFVarM Lean.Compiler.LCNF.FVarUtil:45:38: unreachable code has been reached
backtrace:
PANIC at Lean.Compiler.LCNF.Expr.forFVarM Lean.Compiler.LCNF.FVarUtil:45:38: unreachable code has been reached
backtrace:
PANIC at Lean.Compiler.LCNF.Expr.forFVarM Lean.Compiler.LCNF.FVarUtil:45:38: unreachable code has been reached
backtrace:

Snir Broshi (Dec 17 2025 at 09:33):

Swapping Bool for a variable type gives a different unreachable panic:

variable (α : Type)

def space : Type :=
  Quot (α := α × α) fun ⟨_, _⟩ ⟨_, _⟩  True

def subspace := { x : space α // True }

def foo : subspace α  subspace α :=
  fun x, h  x.lift sorry sorry
PANIC at _private.Lean.Compiler.LCNF.CompilerM.0.Lean.Compiler.LCNF.normExprImp.go Lean.Compiler.LCNF.CompilerM:204:20: unreachable code has been reached
backtrace:

Henrik Böving (Dec 17 2025 at 10:41):

Can you open an issue please?

Snir Broshi (Dec 17 2025 at 16:46):

Henrik Böving said:

Can you open an issue please?

Opened lean4#11719

Henrik Böving (Dec 18 2025 at 09:16):

lean4#11729 fixed


Last updated: Dec 20 2025 at 21:32 UTC