Skip to content

Commit 8c2dccd

Browse files
committed
fix
1 parent 47a538c commit 8c2dccd

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

fpy2/interpret/default.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ def _cvt_return(self, x: Value):
853853
x[i] = self._cvt_return(x[i])
854854
return x
855855
case _:
856-
raise RuntimeError(f'unreachable')
856+
raise RuntimeError('unreachable')
857857

858858
def _visit_function(self, func: FuncDef, ctx: Context):
859859
# process free variables

fpy2/libraries/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def tree_sum(xs: list[fp.Real]):
251251
"""
252252

253253
with fp.INTEGER:
254-
n = len(xs)
254+
n: fp.Real = len(xs)
255255
assert n > 0, "Length of xs must be positive"
256256

257257
depth = fp.log2(n)
@@ -262,7 +262,7 @@ def tree_sum(xs: list[fp.Real]):
262262
with fp.INTEGER:
263263
n /= 2
264264

265-
for i in range(n):
265+
for i in range(n): # type: ignore[arg-type]
266266
with fp.INTEGER:
267267
j = 2 * i
268268
k = 2 * i + 1

tests/infra/backend/cpp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ def _test_unit(output_dir: Path, no_cc: bool = False):
189189
'_modf_spec',
190190
'isinteger',
191191
'_ldexp_spec',
192+
'tree_sum',
192193
# eft
193194
'ideal_2sum',
194195
'ideal_2mul',

0 commit comments

Comments
 (0)