declare class Panel {
Paint(width: number, height: number): void;
}
let pnl = new Panel();
pnl.Paint = (width, height) => {
// custom paint function
}
=>
local pnl = Panel.new();
pnl.Paint = function(width, height)
// causes error when using width because width is userdata (self)
end
Possible fix automatically add self as first parameter, if functions are overwritten this way. But this might cause issues when using this inside the function.