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.
15 lines
331 B
Text
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
|