Skip to content

Commit

Permalink
fix io.write & file:write signature
Browse files Browse the repository at this point in the history
quoted from https://www.lua.org/manual/5.4/manual.html#pdf-file:write
> Writes the value of each of its arguments to `file`. The arguments must be strings or numbers.
  • Loading branch information
fperrad committed Sep 27, 2023
1 parent f6fc5dc commit 1397d8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5232,7 +5232,7 @@ local function init_globals(lax)
["read"] = a_type({ typename = "function", args = TUPLE({ NOMINAL_FILE, UNION({ STRING, NUMBER }) }), rets = TUPLE({ STRING, STRING }) }),
["seek"] = a_type({ typename = "function", args = TUPLE({ NOMINAL_FILE, OPT(STRING), OPT(NUMBER) }), rets = TUPLE({ INTEGER, STRING }) }),
["setvbuf"] = a_type({ typename = "function", args = TUPLE({ NOMINAL_FILE, STRING, OPT(NUMBER) }), rets = TUPLE({}) }),
["write"] = a_type({ typename = "function", args = VARARG({ NOMINAL_FILE, STRING }), rets = TUPLE({ NOMINAL_FILE, STRING }) }),
["write"] = a_type({ typename = "function", args = VARARG({ NOMINAL_FILE, UNION({ STRING, NUMBER }) }), rets = TUPLE({ NOMINAL_FILE, STRING }) }),

},
meta_fields = { ["__close"] = FUNCTION },
Expand Down Expand Up @@ -5375,7 +5375,7 @@ local function init_globals(lax)
["stdout"] = NOMINAL_FILE,
["tmpfile"] = a_type({ typename = "function", args = TUPLE({}), rets = TUPLE({ NOMINAL_FILE }) }),
["type"] = a_type({ typename = "function", args = TUPLE({ ANY }), rets = TUPLE({ STRING }) }),
["write"] = a_type({ typename = "function", args = VARARG({ STRING }), rets = TUPLE({ NOMINAL_FILE, STRING }) }),
["write"] = a_type({ typename = "function", args = VARARG({ UNION({ STRING, NUMBER }) }), rets = TUPLE({ NOMINAL_FILE, STRING }) }),
},
}),
["math"] = a_type({
Expand Down
6 changes: 3 additions & 3 deletions tl.tl
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ if TL_DEBUG then
return
end

io.stderr:write(info.name or "<anon>", info.currentline > 0 and "@" .. info.currentline or "", " :: ", event, "\n")
io.stderr:write(info.name or "<anon>", info.currentline > 0 and "@" .. info.currentline or "", " :: ", event as string, "\n")
io.stderr:flush()
else
count = count + 100
Expand Down Expand Up @@ -5232,7 +5232,7 @@ local function init_globals(lax: boolean): {string:Variable}, {string:Type}
["read"] = a_type { typename = "function", args = TUPLE { NOMINAL_FILE, UNION { STRING, NUMBER } }, rets = TUPLE { STRING, STRING } },
["seek"] = a_type { typename = "function", args = TUPLE { NOMINAL_FILE, OPT(STRING), OPT(NUMBER) }, rets = TUPLE { INTEGER, STRING } },
["setvbuf"] = a_type { typename = "function", args = TUPLE { NOMINAL_FILE, STRING, OPT(NUMBER) }, rets = TUPLE {} },
["write"] = a_type { typename = "function", args = VARARG { NOMINAL_FILE, STRING }, rets = TUPLE { NOMINAL_FILE, STRING } },
["write"] = a_type { typename = "function", args = VARARG { NOMINAL_FILE, UNION { STRING, NUMBER } }, rets = TUPLE { NOMINAL_FILE, STRING } },
-- TODO complete...
},
meta_fields = { ["__close"] = FUNCTION },
Expand Down Expand Up @@ -5375,7 +5375,7 @@ local function init_globals(lax: boolean): {string:Variable}, {string:Type}
["stdout"] = NOMINAL_FILE,
["tmpfile"] = a_type { typename = "function", args = TUPLE {}, rets = TUPLE { NOMINAL_FILE } },
["type"] = a_type { typename = "function", args = TUPLE { ANY }, rets = TUPLE { STRING } },
["write"] = a_type { typename = "function", args = VARARG { STRING }, rets = TUPLE { NOMINAL_FILE, STRING } },
["write"] = a_type { typename = "function", args = VARARG { UNION { STRING, NUMBER } }, rets = TUPLE { NOMINAL_FILE, STRING } },
},
},
["math"] = a_type {
Expand Down

0 comments on commit 1397d8d

Please sign in to comment.