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

[Merged by Bors] - fix(frontends/lean/builtin_cmds): add modifiers/attrs/docstring check to local command #711

Closed
wants to merge 1 commit into from

Conversation

kmill
Copy link
Contributor

@kmill kmill commented Apr 23, 2022

The notation commands are supposed to reject modifiers/attrs/docstrings, but using them via the local command circumvents the check. This adds the check for local notations.

@@ -24,6 +24,15 @@ struct cmd_meta {
cmd_meta(decl_attributes const & attrs, decl_modifiers const & mods,
optional<std::string> const & doc = optional<std::string>()):
m_attrs(attrs), m_modifiers(mods), m_doc_string(doc) {}

void throw_exception_if_nonempty() const & {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to admit this is the first time I've come across ref-qualifiers.

Copy link
Contributor Author

@kmill kmill Apr 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to admit I meant to write just const and am only barely aware of ref-qualifiers! The const & restricts throw_exception_if_nonempty to only be callable with lvalues, which is ok but a little weird.

@gebner
Copy link
Member

gebner commented Apr 29, 2022

Thanks!
bors r+

bors bot pushed a commit that referenced this pull request Apr 29, 2022
… to `local` command (#711)

The notation commands are supposed to reject modifiers/attrs/docstrings, but using them via the `local` command circumvents the check. This adds the check for `local` notations.
@bors
Copy link

bors bot commented Apr 29, 2022

@bors bors bot changed the title fix(frontends/lean/builtin_cmds): add modifiers/attrs/docstring check to local command [Merged by Bors] - fix(frontends/lean/builtin_cmds): add modifiers/attrs/docstring check to local command Apr 29, 2022
@bors bors bot closed this Apr 29, 2022
@bors bors bot deleted the kmill_fix_local_cmd branch April 29, 2022 13:22
bors bot pushed a commit to leanprover-community/mathlib that referenced this pull request Jun 15, 2022
Most of the changes in this upgrade are a consequence of leanprover-community/lean#675, which removed almost all of `init/data/set.lean` from lean core so it could be migrated to mathlib. Other relevant core changes are leanprover-community/lean#714, which removed a few order decidability instances, and leanprover-community/lean#711, which caused a docstring to be rejected.

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>



Co-authored-by: Mauricio Collares <mauricio@collares.org>
Co-authored-by: Floris van Doorn <fpvdoorn@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants