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(slim_check): do not crash when binders contain a function type #11231
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm the new code is (more) correct (than before).
maintainer merge
if not (← Meta.inferType expr).isProp then | ||
return .done expr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the meaning clearer this way (although I know you weren't the one introducing this spelling).
if not (← Meta.inferType expr).isProp then | |
return .done expr | |
unless (← Meta.inferType expr).isProp | |
return .done expr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does unless
support else
? I think in an else
/if
chain, using unless
makes things a little weirder to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it does, but I claim that's a feature. The unless
clause indicates a condition on which you want to immediately abort, which is not what an else
/if
chain indicates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to use "this if isn't really part of this patch" to avoid having to do anything in this CL. If you feel strongly that unless
is underused, perhaps open a follow-up with 10 or so replacements across mathlib and see what people think.
bors merge
🚀 Pull request has been placed on the maintainer queue by YaelDillies. |
🚀 Pull request has been placed on the maintainer queue by YaelDillies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors d+
✌️ eric-wieser can now approve this pull request. To approve and merge a pull request, simply reply with |
…11231) Previously ```lean import Mathlib open scoped BigOperators in example (n : ℕ) : ∑ f : Unit → Fin (n + 1), f () = 0 := by slim_check ``` failed with ``` application type mismatch SlimCheck.NamedBinder "a._@._hyg.23" (Unit → Fin (n + 1)) argument Unit → Fin (n + 1) has type Type : Type 1 but is expected to have type Prop : Type ```
Pull request successfully merged into master. Build succeeded: |
…11231) Previously ```lean import Mathlib open scoped BigOperators in example (n : ℕ) : ∑ f : Unit → Fin (n + 1), f () = 0 := by slim_check ``` failed with ``` application type mismatch SlimCheck.NamedBinder "a._@._hyg.23" (Unit → Fin (n + 1)) argument Unit → Fin (n + 1) has type Type : Type 1 but is expected to have type Prop : Type ```
…11231) Previously ```lean import Mathlib open scoped BigOperators in example (n : ℕ) : ∑ f : Unit → Fin (n + 1), f () = 0 := by slim_check ``` failed with ``` application type mismatch SlimCheck.NamedBinder "a._@._hyg.23" (Unit → Fin (n + 1)) argument Unit → Fin (n + 1) has type Type : Type 1 but is expected to have type Prop : Type ```
…11231) Previously ```lean import Mathlib open scoped BigOperators in example (n : ℕ) : ∑ f : Unit → Fin (n + 1), f () = 0 := by slim_check ``` failed with ``` application type mismatch SlimCheck.NamedBinder "a._@._hyg.23" (Unit → Fin (n + 1)) argument Unit → Fin (n + 1) has type Type : Type 1 but is expected to have type Prop : Type ```
…11231) Previously ```lean import Mathlib open scoped BigOperators in example (n : ℕ) : ∑ f : Unit → Fin (n + 1), f () = 0 := by slim_check ``` failed with ``` application type mismatch SlimCheck.NamedBinder "a._@._hyg.23" (Unit → Fin (n + 1)) argument Unit → Fin (n + 1) has type Type : Type 1 but is expected to have type Prop : Type ```
…11231) Previously ```lean import Mathlib open scoped BigOperators in example (n : ℕ) : ∑ f : Unit → Fin (n + 1), f () = 0 := by slim_check ``` failed with ``` application type mismatch SlimCheck.NamedBinder "a._@._hyg.23" (Unit → Fin (n + 1)) argument Unit → Fin (n + 1) has type Type : Type 1 but is expected to have type Prop : Type ```
Previously
failed with