Skip to content

Commit 4c972ba

Browse files
authored
fix: add missing s! in UInt64.fromJson? (#11237)
This PR fixes the error thrown by `UInt64.fromJson?` and `USize.fromJson?` to use the missing `s!`.
1 parent f6e580c commit 4c972ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Lean/Data/Json/FromToJson/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def bignumToJson (n : Nat) : Json :=
155155
protected def _root_.USize.fromJson? (j : Json) : Except String USize := do
156156
let n ← bignumFromJson? j
157157
if n ≥ USize.size then
158-
throw "value '{j}' is too large for `USize`"
158+
throw s!"value '{j}' is too large for `USize`"
159159
return USize.ofNat n
160160

161161
instance : FromJson USize where
@@ -167,7 +167,7 @@ instance : ToJson USize where
167167
protected def _root_.UInt64.fromJson? (j : Json) : Except String UInt64 := do
168168
let n ← bignumFromJson? j
169169
if n ≥ UInt64.size then
170-
throw "value '{j}' is too large for `UInt64`"
170+
throw s!"value '{j}' is too large for `UInt64`"
171171
return UInt64.ofNat n
172172

173173
instance : FromJson UInt64 where

0 commit comments

Comments
 (0)