local function foo(): ({integer:integer}, boolean) | ({integer:integer}, nil)
end
local flags, err
flags, err = foo()
I get this:
lua: /Users/hisham/projects/github/typedlua/typedlua/tltype.lua:1058: attempt to concatenate a nil value (field 'tag')
stack traceback:
/Users/hisham/projects/github/typedlua/typedlua/tltype.lua:1058: in upvalue 'type2str'
/Users/hisham/projects/github/typedlua/typedlua/tltype.lua:1056: in upvalue 'type2str'
/Users/hisham/projects/github/typedlua/typedlua/tltype.lua:1052: in function </Users/hisham/projects/github/typedlua/typedlua/tltype.lua:1011>
(...tail calls...)
...s/hisham/projects/github/typedlua/typedlua/tlchecker.lua:576: in upvalue 'check_return_type'
...s/hisham/projects/github/typedlua/typedlua/tlchecker.lua:989: in function <...s/hisham/projects/github/typedlua/typedlua/tlchecker.lua:949>
(...tail calls...)
...s/hisham/projects/github/typedlua/typedlua/tlchecker.lua:1550: in function 'typedlua.tlchecker.typecheck'
/Users/hisham/projects/github/typedlua/tlc:123: in main chunk
[C]: in ?
I just pushed a quick fix to this. Can you please pull it and check?
Thanks for the report and for the pull requests. You fixed some things that were in my TODO list. :)
Running typedlua master branch (commit f4a0fb6ae0)
Testcase:
I get this: