From d2bb0755ac1c45a97120341673ab097718aadd72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Perrad?= Date: Thu, 19 Oct 2023 21:26:47 +0200 Subject: [PATCH] fix file:close signature (#687) since Lua 5.2, when closing a file handle created with io.popen, file:close returns the same values returned by os.execute. --- tl.lua | 2 +- tl.tl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tl.lua b/tl.lua index dc647bf7..d52abae0 100644 --- a/tl.lua +++ b/tl.lua @@ -5224,7 +5224,7 @@ local function init_globals(lax) typename = "record", is_userdata = true, fields = { - ["close"] = a_type({ typename = "function", args = TUPLE({ NOMINAL_FILE }), rets = TUPLE({ BOOLEAN, STRING }) }), + ["close"] = a_type({ typename = "function", args = TUPLE({ NOMINAL_FILE }), rets = TUPLE({ BOOLEAN, STRING, INTEGER }) }), ["flush"] = a_type({ typename = "function", args = TUPLE({ NOMINAL_FILE }), rets = TUPLE({}) }), ["lines"] = a_type({ typename = "function", args = VARARG({ NOMINAL_FILE, a_type({ typename = "union", types = { STRING, NUMBER } }) }), rets = TUPLE({ a_type({ typename = "function", args = TUPLE({}), rets = VARARG({ STRING }) }), diff --git a/tl.tl b/tl.tl index 915275f5..f4eea84c 100644 --- a/tl.tl +++ b/tl.tl @@ -5224,7 +5224,7 @@ local function init_globals(lax: boolean): {string:Variable}, {string:Type} typename = "record", is_userdata = true, fields = { - ["close"] = a_type { typename = "function", args = TUPLE { NOMINAL_FILE }, rets = TUPLE { BOOLEAN, STRING} }, + ["close"] = a_type { typename = "function", args = TUPLE { NOMINAL_FILE }, rets = TUPLE { BOOLEAN, STRING, INTEGER } }, ["flush"] = a_type { typename = "function", args = TUPLE { NOMINAL_FILE }, rets = TUPLE {} }, ["lines"] = a_type { typename = "function", args = VARARG { NOMINAL_FILE, a_type { typename = "union", types = { STRING, NUMBER } } }, rets = TUPLE { a_type { typename = "function", args = TUPLE {}, rets = VARARG { STRING } },