Skip to content

Commit 7e4e034

Browse files
DarxoDarxo
authored andcommitted
feat: add type checker for unsigned integers
1 parent ae48997 commit 7e4e034

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

msu/utils/type_checkers.nut

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@
88
::MSU.requireTypeArray("integer", vargv);
99
}
1010

11+
::MSU.requireUnsigned <- function( ... )
12+
{
13+
::MSU.requireInt(vargv);
14+
foreach (value in vargv)
15+
{
16+
if (value < 0)
17+
{
18+
::logError(value + " must have the type: unsigned");
19+
throw ::MSU.Exception.InvalidType(value);
20+
}
21+
}
22+
}
23+
1124
::MSU.requireArray <- function( ... )
1225
{
1326
::MSU.requireTypeArray("array", vargv);

0 commit comments

Comments
 (0)