lean4-htt/tests/lean/run/instanceReducible.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

38 lines
1 KiB
Text

module
/-! Applying `[instance]` after the fact should check for appropriate reducibility. -/
public def unexposed : Inhabited Nat := inferInstance
/-- warning: instance `unexposed` must be marked with `@[expose]` -/
#guard_msgs in
attribute [instance] unexposed
/-- warning: instance `unexposed` must be marked with `@[reducible]` or `@[instance_reducible]` -/
#guard_msgs in
attribute [local instance] unexposed
@[expose]
public def exposed : Inhabited Nat := inferInstance
/-- warning: instance `exposed` must be marked with `@[reducible]` or `@[instance_reducible]` -/
#guard_msgs in
attribute [instance] exposed
/-- warning: instance `exposed` must be marked with `@[reducible]` or `@[instance_reducible]` -/
#guard_msgs in
attribute [local instance] exposed
@[expose, instance_reducible]
public def exposedAndReducible : Inhabited Nat := inferInstance
#guard_msgs in
attribute [instance] exposedAndReducible
#guard_msgs in
attribute [local instance] exposedAndReducible
instance bla : Add Int := ⟨Int.add⟩
#guard_msgs in
attribute [irreducible] bla