do local a , b = setmetatable({ }, { __close = function(self) return print("closed") end }) local c , d = 123, 'abc' close(a, b) const(c, d) end do local v = (function() if flag then return func() else return setmetatable({ }, { __close = function(self) end }) end end)() local f = (function() local _with_0 = io.open("file.txt") _with_0:write("Hello") return _with_0 end)() end do local _ = (function() local _with_0 = io.open("file.txt") _with_0:write("Hello") return _with_0 end)(); local _ = setmetatable({ }, { __close = function(self) return print("second") end }); local _ = setmetatable({ }, { __close = function() return print("first") end }) end local _defers = setmetatable({ }, { __close = function(self) self[#self]() self[#self] = nil end }) do _defers[#_defers + 1] = function() return print(3) end local _ = _defers; _defers[#_defers + 1] = function() return print(2) end local _ = _defers; _defers[#_defers + 1] = function() return print(1) end local _ = _defers end