lean4-htt/tests/lean/run/10181.lean
Cameron Zwarich de38a16fa9
fix: use IR decls in toIR for applications without mono decls (#10256)
This PR corrects a mistake in `toIR` where it could over-apply a
function that has an IR decl but no mono decl.

Fixes #10181.
2025-09-05 05:32:19 +00:00

15 lines
469 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Lean.CoreM
open Lean Meta Core
def asTask {α} (t : CoreM α) : CoreM (BaseIO Unit × Task (CoreM α)) := do
let task ← (t.toIO (← read) (← get)).asTask
return (IO.cancel task, task.map (prio := .max) fun
| .ok (a, s) => do set s; pure a
| .error e => throwError m!"Task failed:\n{e}")
def asTask' {α} (t : CoreM α) : CoreM (Task (CoreM α)) := (·.2) <$> asTask t
def f : CoreM Name := do
let t1 ← asTask' do mkFreshUserName `f
t1.get