lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, May 22, 2020 at 4:26 PM Andrew Gierth
<andrew@tao11.riddles.org.uk> wrote:
>
> >>>>> "Gé" == Gé Weijers <ge@weijers.org> writes:
>
>  Gé> The following program generates this error message:
>
>  Gé> lua: bug.lua:19: attempt to close non-closable variable 'database'
>  Gé> stack traceback:
>  Gé>         bug.lua:19: in main chunk
>  Gé>         [C]: in ?
>
> Confirmed this on freebsd/amd64, with asserts on and with or without
> compiler optimizations.
>
> --
> Andrew.

I can confirm as well, and I also managed to minimize the reproducer some more:

    local var1 <const> = nil
    local var2 <const> = nil
    do
        local var3 <close> = setmetatable({}, {__close = function() end})
    end
    local var4 = true

Joseph C. Sible