Zulip Chat Archive
Stream: lean4
Topic: bug with spacing
Kenny Lau (Oct 18 2025 at 17:17):
theorem foo (L : List Nat) : True := by
induction L with
| nil => trivial -- start here
- delete the comment
-- start here - add a newline
- type
| cons => trivial - observe that lean complains that
conshasn't been provided - add a space before
| consand then delete the space - it's now magically fixed
Kenny Lau (Oct 18 2025 at 17:17):
Kenny Lau (Oct 18 2025 at 17:17):
(tested on live lean)
Aaron Liu (Oct 18 2025 at 17:30):
I had the same problem which sometimes I encounter it and sometimes it's fine, didn't think it was serious enough to report
Kim Morrison (Oct 20 2025 at 02:29):
@Kenny Lau, can you please open an issue?
Kenny Lau (Oct 20 2025 at 07:27):
Kim Morrison said:
Kenny Lau, can you please open an issue?
Robin Arnez (Oct 20 2025 at 07:31):
That was lean4#10679, wasn't it?
Kenny Lau (Oct 20 2025 at 07:32):
but i tested it against a version after that date
Kenny Lau (Oct 20 2025 at 07:33):
the description is different, the one you linked is saying that the error message stays after removing the alternative, mine says that the error message appears after adding the alternative
Kenny Lau (Oct 20 2025 at 07:33):
which, if you think about it, how can there be an error message in the first place if there is an "offending alternative"?? that's my bug i think
Robin Arnez (Oct 20 2025 at 07:38):
I've had this problem before but I can't seem to reproduce it with your steps. You're probably right that this is still a problem but maybe there is a better way to reproduce it?
Kenny Lau (Oct 20 2025 at 07:39):
did you delete the comment?
Sebastian Ullrich (Oct 20 2025 at 07:44):
I have a reproducer
Robin Arnez (Oct 20 2025 at 07:46):
Maybe I misunderstood something but:
- open in Lean 4 playground
- put
| cons => trivialinto the clipboard - select
-- start here - backspace
- enter
- paste
causes no error to occur. I think a better repro is:
theorem foo (L : List Nat) : True := by
induction L with
| nil => trivial
- Type a single
|at the end of the last line. - Wait until the error appears.
- Write
cons => trivial=> The error is still there - Add a space before the
|=> The error disappears
Sebastian Ullrich (Oct 20 2025 at 07:47):
lean#10848, a partial oversight from lean#10679
Last updated: Dec 20 2025 at 21:32 UTC