lean4-htt/tests/lean/4240.lean
2024-06-07 13:59:22 +02:00

25 lines
561 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.

/-! Check for bug accidentally marking `m` as owned. -/
class MyClass (α : Type u) where
instance : MyClass Nat where
inductive MyOption (α : Type u) where
| none
| some (key : α)
namespace MyOption
def isSomeWithInstance [MyClass α] : MyOption α → Bool
| none => false
| some _ => true
def isSome : MyOption α → Bool
| none => false
| some _ => true
end MyOption
set_option trace.compiler.ir.result true in
def isSomeWithInstanceNat (m : { m : Array (MyOption Nat) // 0 < m.size }) : Bool :=
(m.1.uget 0 m.2).isSomeWithInstance