Skip to content

Commit

Permalink
allow dynamic require
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad committed Aug 16, 2023
1 parent 710c081 commit dbd2490
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 @@ -8540,7 +8540,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 @@ -8540,7 +8540,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 dbd2490

Please sign in to comment.