You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>> return tostring(require('lgi').cairo.PathData._field.header[3])
stdin:1: '__tostring' must return a string
stack traceback:
[C]: in function 'tostring'
stdin:1: in main chunk
[C]: in ?
>>> return getmetatable(require('lgi').cairo.PathData._field.header[3]):__tostring()
nil
And similarly for cairo.PathData._field.point. I got this error by attempting to perform a recursive dump on _G; I'm not sure where else it may come up.
The text was updated successfully, but these errors were encountered:
Looks like the third argument of component.create is supposed to be the name. According to git grep, there are many calls to that function with just two arguments (not just in cairo).
A possible fix (besides fixing all callers) might be:
diff --git a/lgi/component.lua b/lgi/component.lua
index a6803ae..d15a177 100644
--- a/lgi/component.lua+++ b/lgi/component.lua@@ -319,7 +319,7 @@ function component.create(info, mt, name)
end
-- Fill in meta of the compound.
- local component = { _name = name }+ local component = { _name = name or "__unnamed__" }
if gtype then
-- Bind component in repo, make the relation using GType.
component._gtype = gtype
@fstirlitz What's your Lua version? My Lua 5.2 does not really complain here:
@pavouk I'll leave it up to you to fix this. I don't know if all callers should be fixed or the implementation should work around this issue (as in the above example patch). Also, no idea what good names for these things would be.
And similarly for
cairo.PathData._field.point
. I got this error by attempting to perform a recursive dump on_G
; I'm not sure where else it may come up.The text was updated successfully, but these errors were encountered: