lean4-htt/tests/elab/issue10821.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

63 lines
1.4 KiB
Text

set_option linter.deprecated true
/-!
Checks that deprecated names in projection notation cause just
the name to be marked, not the whole expression.
-/
def Nat.inc (n : Nat) : Nat := n + 1
@[deprecated inc (since := "2025-10-17")]
def Nat.inc' (n : Nat) : Nat := n + 1
/--
@ +3:5...9
warning: `Nat.inc'` has been deprecated: Use `Nat.inc` instead
-/
#guard_msgs (positions := true) in
example (n : Nat) : Nat :=
n
|>.inc'
/--
@ +2:7...11
warning: `Nat.inc'` has been deprecated: Use `Nat.inc` instead
-/
#guard_msgs (positions := true) in
example (n : Nat) : Nat :=
n |>.inc'
/--
@ +2:6...10
warning: `Nat.inc'` has been deprecated: Use `Nat.inc` instead
-/
#guard_msgs (positions := true) in
example (n : Nat) : Nat :=
(n).inc'
/--
@ +2:4...8
warning: `Nat.inc'` has been deprecated: Use `Nat.inc` instead
-/
#guard_msgs (positions := true) in
example (n : Nat) : Nat :=
n.inc'
/--
@ +2:4...8
error: Invalid field `incc`: The environment does not contain `Nat.incc`, so it is not possible to project the field `incc` from an expression
n
of type `Nat`
-/
#guard_msgs (positions := true) in
example (n : Nat) : Nat :=
n.incc
/--
@ +2:4...8
error: Invalid field `incc`: The environment does not contain `Nat.incc`, so it is not possible to project the field `incc` from an expression
n
of type `Nat`
-/
#guard_msgs (positions := true) in
example (n : Nat) : Nat :=
n.incc.foo