Skip to content

Commit

Permalink
document(assertions) Add note about possible use for LuaMacro
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrady committed Aug 29, 2020
1 parent e8738c1 commit 3972d8a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions assertions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ do
end

-- Provide less magical type assertion.
-- TODO(dabrady) Evaluate LuaMacro as possible alternative.
-- This current approach results in misleading function name in failed assertion
-- error messages: it always reports `assert_type` as the source of type errors.
-- @see https://github.com/stevedonovan/LuaMacro
-- @see https://luarocks.org/modules/steved/luamacro
function module.assert_type(val, t)
module.__checks__(t) -- Asserts against the first argument to `assert_type`
return val
Expand Down

0 comments on commit 3972d8a

Please sign in to comment.