Emmy-love-api icon indicating copy to clipboard operation
Emmy-love-api copied to clipboard

Fix parent of class declaration.

Open MikuAuahDark opened this issue 5 years ago • 0 comments

For anyone who uses this script for latest love-api, the class declaration may have no parent.

https://github.com/EmmyLua/Emmy-love-api/blob/f9b185591677788ab0b133340a3783591c070971/genEmmyAPI.lua#L74-L75

Changing that line to this

if type.supertypes and type.supertypes[1] then
    code = code .. ' : ' .. type.supertypes[1]

fixes the problem.

MikuAuahDark avatar Jul 31 '20 13:07 MikuAuahDark