Skip to content

Commit 7420942

Browse files
authored
fix: correct type assertion for index in __index function (#539)
1 parent 6721857 commit 7420942

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rogue-properties/src/Shared/Implementation/RoguePropertyTable.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ function RoguePropertyTable:__newindex(index, value)
225225
end
226226

227227
function RoguePropertyTable:__index(index)
228-
assert(type(index) == "string", "Bad index")
228+
assert(type(index) == "string" or type(index) == "number", "Bad index")
229229

230230
if RoguePropertyTable[index] then
231231
return RoguePropertyTable[index]
@@ -259,4 +259,4 @@ function RoguePropertyTable:__index(index)
259259
end
260260
end
261261

262-
return RoguePropertyTable
262+
return RoguePropertyTable

0 commit comments

Comments
 (0)