Skip to content

Commit

Permalink
allow dynamic require
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad authored and hishamhm committed Aug 15, 2024
1 parent 2e22be8 commit bd48be0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8674,7 +8674,7 @@ tl.type_check = function(ast, opts)
return node_error(node, "require expects one literal argument")
end
if node.e2[1].kind ~= "string" then
return node_error(node, "don't know how to resolve a dynamic require")
return ANY
end

local module_name = assert(node.e2[1].conststr)
Expand Down
2 changes: 1 addition & 1 deletion tl.tl
Original file line number Diff line number Diff line change
Expand Up @@ -8674,7 +8674,7 @@ tl.type_check = function(ast: Node, opts: TypeCheckOptions): Result, string
return node_error(node, "require expects one literal argument")
end
if node.e2[1].kind ~= "string" then
return node_error(node, "don't know how to resolve a dynamic require")
return ANY
end

local module_name = assert(node.e2[1].conststr)
Expand Down

0 comments on commit bd48be0

Please sign in to comment.