lean4-htt/tests/lean/run/instanceReducibility.lean
Leonardo de Moura e02a140080
feat: @[instance_reducible] part 2 (#12263)
This PR implements the second part of #12247.

---------

Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
2026-02-03 04:01:13 +00:00

34 lines
727 B
Text

module
/-! Reducibility of instances should default to `[instance_reducible]` but be overridable. -/
instance i1 : Inhabited Nat := inferInstance
/--
info: @[instance_reducible] private def i1 : Inhabited Nat :=
inferInstance
-/
#guard_msgs in
#print i1
@[reducible] instance i2 : Inhabited Nat := inferInstance
/--
info: @[reducible] private def i2 : Inhabited Nat :=
inferInstance
-/
#guard_msgs in
#print i2
/--
warning: instance `_private.lean.run.instanceReducibility.0.i3` must be marked with `@[reducible]` or `@[instance_reducible]`
-/
#guard_msgs in
@[irreducible] instance i3 : Inhabited Nat := inferInstance
/--
info: @[irreducible] private def i3 : Inhabited Nat :=
inferInstance
-/
#guard_msgs in
#print i3