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

unexpected error when elaborating 'let' #6426

Open
3 tasks done
Rob23oba opened this issue Dec 20, 2024 · 0 comments
Open
3 tasks done

unexpected error when elaborating 'let' #6426

Rob23oba opened this issue Dec 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Rob23oba
Copy link

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

For some combinations of if statements, for loops, let declarations and mutation inside of a do block, the error unexpected error while elaborating 'let' is produced.

Example

example (arr : Array Nat) : Unit := Id.run do
  let mut abc := 0
  if 0 = 0 then
    ()
  for (i, j) in [(0, 0)] do -- unexpected error when elaborating 'let'
    let a : Nat := i + 2
    if h : arr.size ≤ 4 then
      continue
    else if h : arr[4] ≤ a then
      continue
    else
      if 0 = 0 then
        continue
      abc := 0

If you change the last part to

let b := arr[0]
if b = 0 then
  continue
abc := ()

then the error goes away.

Versions

Lean 4.16.0-nightly-2024-12-20 (on live.lean-lang.org)
Lean 4.14.0-rc2

Impact

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

@Rob23oba Rob23oba added the bug Something isn't working label Dec 20, 2024
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

No branches or pull requests

1 participant