Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No deprecation warning with dot-notation #3270

Closed
1 task done
adomani opened this issue Feb 7, 2024 · 0 comments · Fixed by #3969
Closed
1 task done

No deprecation warning with dot-notation #3270

adomani opened this issue Feb 7, 2024 · 0 comments · Fixed by #3969
Labels
bug Something isn't working

Comments

@adomani
Copy link
Contributor

adomani commented Feb 7, 2024

Prerequisites

  • Put an X between the brackets on this line if you have done all of the following:
    • Check that your issue is not already filed.
    • Reduce the issue to a minimal, self-contained, reproducible test case. Avoid dependencies to mathlib4 or std4.

Description

If a deprecated theorem allows dot-notation and is used with dot-notation, then there is no deprecation warning.

Context

This appeared in this Zulip discussion.

Steps to Reproduce

@[deprecated] theorem Nat.deprfl (n : Nat) : n = n := rfl

-- expected: deprecation warning
example {n : Nat} : n = n := Nat.deprfl n

-- unexpected: no deprecation warning
example {n : Nat} : n = n := n.deprfl

Expected behavior: n.deprfl should trigger a deprecated warning, just like Nat.deprfl.

Actual behavior: n.deprfl does not trigger a deprecated warning.

Versions

"4.6.0-rc1", "4.7.0-rc2"
Linux

(The same behaviour also happens in the online Lean server.)

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

@adomani adomani added the bug Something isn't working label Feb 7, 2024
github-merge-queue bot pushed a commit that referenced this issue May 9, 2024
Fixes #3270 by moving the deprecation check from
`Lean.Elab.Term.mkConsts` to `Lean.Elab.Term.mkConst`, so
`Lean.Elab.Term.mkBaseProjections`, `.elabAppLValsAux`, `.elabAppFn`,
and `.elabForIn` also hit the check. Not all of these really need to hit
the check, so I'll run `!bench` to see if it's a problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant