lean4-htt/tests/lean/run/9937.lean
Cameron Zwarich 0c9bb4b861
fix: lower overapplied constructors to unreachable (#10032)
This PR changes the handling of overapplied constructors when lowering
LCNF to IR from a (slightly implicit) assertion failure to producing
`unreachable`. Transformations on inlined unreachable code can produce
constructor applications with additional arguments.

In the old compiler, these additional arguments were silently ignored,
but it seems more sensible to replace them with `unreachable`, just in
case they arise due to a compiler error.

Fixes #9937.
2025-08-21 15:05:09 +00:00

15 lines
331 B
Text

def Construction : List Unit → Type
| [] => Unit
| _ :: _ => Unit → Unit
@[inline]
def List.asConstruction : (l : List Unit) → Construction l
| [] => ()
| _ :: _ => λ _ => ()
def f1 : List Unit := List.replicate 1 ()
def value : Unit := f1.asConstruction ()
/-- info: () -/
#guard_msgs in
#eval IO.println value