X Tutup
Skip to content

Class functions overwritten at runtime are not called correctly #192

@lolleko

Description

@lolleko
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup