Skip to content

Commit

Permalink
funcall: minor simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed Sep 5, 2024
1 parent 65a904e commit 775ceda
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions tl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9277,9 +9277,7 @@ a.types[i], b.types[i]), }

infer_emptytables(self, w, where_args, args, f.args, argdelta)

mark_invalid_typeargs(self, f)

return self:resolve_typevars_at(w, f.rets)
return f.rets
end
end

Expand Down Expand Up @@ -9335,9 +9333,7 @@ a.types[i], b.types[i]), }

local f = resolve_function_type(func, 1)

mark_invalid_typeargs(self, f)

return self:resolve_typevars_at(w, f.rets)
return f.rets
end

local function check_call(self, w, where_args, func, args, expected_rets, is_typedecl_funcall, argdelta)
Expand Down Expand Up @@ -9449,6 +9445,10 @@ a.types[i], b.types[i]), }

local ret, f = check_call(self, node, e2, func, args, expected_rets, is_typedecl_funcall, argdelta or 0)

if f then
mark_invalid_typeargs(self, f)
end

ret = self:resolve_typevars_at(node, ret)
self:end_scope()

Expand Down
12 changes: 6 additions & 6 deletions tl.tl
Original file line number Diff line number Diff line change
Expand Up @@ -9277,9 +9277,7 @@ do

infer_emptytables(self, w, where_args, args, f.args, argdelta)

mark_invalid_typeargs(self, f)

return self:resolve_typevars_at(w, f.rets)
return f.rets
end
end

Expand Down Expand Up @@ -9335,9 +9333,7 @@ do

local f = resolve_function_type(func, 1)

mark_invalid_typeargs(self, f)

return self:resolve_typevars_at(w, f.rets)
return f.rets
end

local function check_call(self: TypeChecker, w: Where, where_args: {Node}, func: Type, args: TupleType, expected_rets: TupleType, is_typedecl_funcall: boolean, argdelta: integer): InvalidOrTupleType, FunctionType
Expand Down Expand Up @@ -9449,6 +9445,10 @@ do

local ret, f = check_call(self, node, e2, func, args, expected_rets, is_typedecl_funcall, argdelta or 0)

if f then
mark_invalid_typeargs(self, f)
end

ret = self:resolve_typevars_at(node, ret)
self:end_scope()

Expand Down

0 comments on commit 775ceda

Please sign in to comment.