rzel / kahlua

Automatically exported from code.google.com/p/kahlua
0 stars 0 forks source link

LuaTableImpl.len() doesn't work properly on non-numerically-indexed LuaTables #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Test.java is in directory src/se/krka/kahlua/vm:

package se.krka.kahlua.vm;

public class Test {
    public static void main(String a[]) {
        LuaTable lt = new LuaTableImpl();
        lt.rawset("a", "b");
        lt.rawset("c", "d");
        System.out.println(lt.len());
    }
}

Then I compile it:
mbp:src idave$ javac se/krka/kahlua/vm/Test.java
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

And I run it:
mbp:src idave$ java se/krka/kahlua/vm/Test
0

Original issue reported on code.google.com by j0t...@gmail.com on 3 Aug 2009 at 10:17

GoogleCodeExporter commented 8 years ago
Not a bug, this is the expected behavior of tables in Lua.

Original comment by kristofer.karlsson@gmail.com on 3 Aug 2009 at 10:38