diff --git a/src/main/java/net/hollowcube/luau/LuaStateImpl.java b/src/main/java/net/hollowcube/luau/LuaStateImpl.java index 68447fe..88374f0 100644 --- a/src/main/java/net/hollowcube/luau/LuaStateImpl.java +++ b/src/main/java/net/hollowcube/luau/LuaStateImpl.java @@ -856,10 +856,8 @@ public boolean newMetaTable(@NotNull String typeName) { @Override public void getMetaTable(@NotNull String typeName) { - try (Arena arena = Arena.ofConfined()) { - final LuaType type = getField(LUA_REGISTRYINDEX(), typeName); - assert type == LuaType.TABLE : "expected table"; - } + final LuaType type = getField(LUA_REGISTRYINDEX(), typeName); + assert type == LuaType.TABLE : "expected table"; } @Override diff --git a/src/main/java/net/hollowcube/luau/LuaType.java b/src/main/java/net/hollowcube/luau/LuaType.java index 713a856..bfdcfd5 100644 --- a/src/main/java/net/hollowcube/luau/LuaType.java +++ b/src/main/java/net/hollowcube/luau/LuaType.java @@ -27,7 +27,7 @@ public enum LuaType { private static final LuaType[] VALUES = values(); public static @NotNull LuaType byId(int id) { - return id >= 0 && id < VALUES.length ? VALUES[id] : NONE; + return id >= 0 && id < VALUES.length ? VALUES[id + 1] : NONE; } public int id() {