Skip to content

Commit

Permalink
assert: ignores additional arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed Sep 18, 2024
1 parent 1c3ba3d commit 8f63a86
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions spec/stdlib/assert_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ describe("assert", function()
{ y = 9, msg = "cannot use operator '..' for types string | boolean and string" },
{ y = 11, msg = "cannot use operator '..' for types string | boolean and string" },
}))

it("ignores additional arguments", util.check([[
local f = assert(io.open("nonexistent.txt"))
]]))

end)
2 changes: 1 addition & 1 deletion tl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ do
type XpcallMsghFunction = function(...: any): ()
arg: {string}
assert: function<A, B>(A, ? B): A
assert: function<A, B>(A, ? B, ...: any): A
collectgarbage: function(? CollectGarbageCommand): number
collectgarbage: function(CollectGarbageSetValue, integer): number
Expand Down
2 changes: 1 addition & 1 deletion tl.tl
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ do
type XpcallMsghFunction = function(...: any): ()
arg: {string}
assert: function<A, B>(A, ? B): A
assert: function<A, B>(A, ? B, ...: any): A
collectgarbage: function(? CollectGarbageCommand): number
collectgarbage: function(CollectGarbageSetValue, integer): number
Expand Down

0 comments on commit 8f63a86

Please sign in to comment.