Skip to content

Commit

Permalink
Merge pull request #126 from psychon/gtop
Browse files Browse the repository at this point in the history
record.load: Require constructor to be a function
  • Loading branch information
pavouk committed Dec 14, 2015
2 parents 5719bf9 + 1b6982b commit d08dfee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lgi/record.lua
Expand Up @@ -199,7 +199,8 @@ function record.load(info)

-- Check, whether ctor is valid. In order to be valid, it must
-- return instance of this record.
if (ctor and ctor.return_type.tag =='interface'
if (ctor and ctor.type == 'function'
and ctor.return_type.tag =='interface'
and ctor.return_type.interface == info) then
ctor = core.callable.new(ctor)
record._new = function(typetable, ...) return ctor(...) end
Expand Down

0 comments on commit d08dfee

Please sign in to comment.