torch / argcheck

A powerful (and blazing fast) argument checker and function overloading system for Lua or LuaJIT
Other
54 stars 17 forks source link

torch/rational broken #16

Open IlGriS opened 5 years ago

IlGriS commented 5 years ago

argcheck cause error :

th> rat = require 'rational'
                                                                      [0.0622s]
th> print(rat(5, 4) * rat(3, 6))
[string "argcheck"]:42: 
Arguments:

({
   a = rational.number  -- 
   b = rational.number  -- 
})

Got: table, table
invalid arguments!
stack traceback:
        [C]: in function 'error'
        [string "argcheck"]:42: in function '__mul'
        [string "print(rat(5, 4) * rat(3, 6))"]:1: in main chunk
        [C]: in function 'xpcall'
        ...lya/devel/lua/torch/install/share/lua/5.1/trepl/init.lua:679: in function 'repl'
        .../lua/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:204: in main chunk
        [C]: at 0x562db81c3e00
                                                                      [0.0005s]