From c3169ba05deb07ba2bdf8f899f4a9d2c54cbf722 Mon Sep 17 00:00:00 2001 From: dt <98478153+realcorvus@users.noreply.github.com> Date: Thu, 7 Dec 2023 14:04:14 -0500 Subject: [PATCH] Use trunc when idx is given as a float instead of an int --- lib/sobelow/parse.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sobelow/parse.ex b/lib/sobelow/parse.ex index d8ee966..8b074f1 100644 --- a/lib/sobelow/parse.ex +++ b/lib/sobelow/parse.ex @@ -455,7 +455,7 @@ defmodule Sobelow.Parse do end defp create_fun_cap(fun, meta, idx) when is_number(idx) do - opts = Enum.map(1..idx, fn i -> {:&, [], [i]} end) + opts = Enum.map(1..trunc(idx), fn i -> {:&, [], [i]} end) {fun, meta, opts} end