Skip to content

Commit

Permalink
fix signature and return values for debug.getlocal
Browse files Browse the repository at this point in the history
Fixes #713.
  • Loading branch information
JLPLabs LLC authored and hishamhm committed Nov 5, 2023
1 parent d1e6a1e commit 266e712
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions tl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5313,8 +5313,10 @@ local function init_globals(lax)
["getlocal"] = a_type({
typename = "poly",
types = {
a_type({ typename = "function", args = TUPLE({ THREAD, FUNCTION, NUMBER }), rets = TUPLE({}) }),
a_type({ typename = "function", args = TUPLE({ FUNCTION, NUMBER }), rets = TUPLE({}) }),
a_type({ typename = "function", args = TUPLE({ THREAD, FUNCTION, NUMBER }), rets = STRING }),
a_type({ typename = "function", args = TUPLE({ THREAD, NUMBER, NUMBER }), rets = TUPLE({ STRING, ANY }) }),
a_type({ typename = "function", args = TUPLE({ FUNCTION, NUMBER }), rets = STRING }),
a_type({ typename = "function", args = TUPLE({ NUMBER, NUMBER }), rets = TUPLE({ STRING, ANY }) }),
},
}),
["getmetatable"] = a_gfunction(1, function(a) return { args = TUPLE({ a }), rets = TUPLE({ METATABLE(a) }) } end),
Expand Down
6 changes: 4 additions & 2 deletions tl.tl
Original file line number Diff line number Diff line change
Expand Up @@ -5313,8 +5313,10 @@ local function init_globals(lax: boolean): {string:Variable}, {string:Type}
["getlocal"] = a_type {
typename = "poly",
types = {
a_type { typename = "function", args = TUPLE { THREAD, FUNCTION, NUMBER }, rets = TUPLE {} },
a_type { typename = "function", args = TUPLE { FUNCTION, NUMBER }, rets = TUPLE {} },
a_type { typename = "function", args = TUPLE { THREAD, FUNCTION, NUMBER }, rets = STRING },
a_type { typename = "function", args = TUPLE { THREAD, NUMBER, NUMBER }, rets = TUPLE { STRING, ANY } },
a_type { typename = "function", args = TUPLE { FUNCTION, NUMBER }, rets = STRING },
a_type { typename = "function", args = TUPLE { NUMBER, NUMBER }, rets = TUPLE { STRING, ANY } },
},
},
["getmetatable"] = a_gfunction(1, function(a: Type): Type return { args = TUPLE { a }, rets = TUPLE { METATABLE(a) } } end),
Expand Down

0 comments on commit 266e712

Please sign in to comment.