Prerequisites
Please put an X between the brackets as you perform the following steps:
Description
The following code gives (kernel) declaration has free variables 'getHexDigit?' on Lean 4.9.0-rc1.
def getHexDigit? (char : Char) : Option (Fin 16) :=
if char.toNat < 0x0030 then
none
else
let n := if char.toNat < 0xFF10 then char.toNat - 0x0030 else char.toNat - 0xFF10
if h : n < 10 then
some ⟨n, Nat.lt_trans h (by decide)⟩
else if n >= 17 then
let n := n - 7
if h : n < 16 then
some ⟨n, h⟩
else if n >= 32 then
let n := n - 32
if h : n < 16 then
some ⟨n, h⟩
else
none
else
none
else
none
Removing the second let or the third let eliminates the problem.
Context
Discovered while updating lean4-unicode-basic to v4.9.0-rc1. Posted on Zulip.
Versions
Lean (version 4.9.0-rc1, arm64-apple-darwin23.5.0, commit be6c4894e0a6, Release)
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
Prerequisites
Please put an X between the brackets as you perform the following steps:
https://github.com/leanprover/lean4/issues
Avoid dependencies to Mathlib or Batteries.
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
The following code gives
(kernel) declaration has free variables 'getHexDigit?'on Lean 4.9.0-rc1.Removing the second let or the third let eliminates the problem.
Context
Discovered while updating lean4-unicode-basic to v4.9.0-rc1. Posted on Zulip.
Versions
Lean (version 4.9.0-rc1, arm64-apple-darwin23.5.0, commit be6c4894e0a6, Release)Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.