Skip to content

Stack Overflow? #4

@awilliamson

Description

@awilliamson

Using the extends method, and upon calling self:super("init",params) from within my extended class' init function It appears to recursively call.

[ERROR] gamemodes/inpsb/gamemode/classes/../classes/hudpanel.lua:7: stack overflow
  1. super - gamemodes/inpsb/gamemode/classes/../classes/hudpanel.lua:7
   2. super - gamemodes/inpsb/gamemode/classes/../classes/hudpanel.lua:7
    3. super - gamemodes/inpsb/gamemode/classes/../classes/hudpanel.lua:7
     4. super - gamemodes/inpsb/gamemode/classes/../classes/hudpanel.lua:7
      5. super - gamemodes/inpsb/gamemode/classes/../classes/hudpanel.lua:7
       6. super - gamemodes/inpsb/gamemode/classes/../classes/hudpanel.lua:7
        7. super - gamemodes/inpsb/gamemode/classes/../classes/hudpanel.lua:7
         8. super - gamemodes/inpsb/gamemode/classes/../classes/hudpanel.lua:7
          9. super - gamemodes/inpsb/gamemode/classes/../classes/hudpanel.lua:7

HudPanel.lua:

local HudComponent = GM.class.getClass("HudComponent")
local C = HudComponent:extends()

function C:init(x, y, width, height, backgroundColor, autosize)
    self:super("init",x, y, width, height)
        ... etc

HudComponent.lua:

local C = GM.LCS.class()

function C:init(x, y, width, height)
    self.x = x
    self.y = y
        ... etc

I can't see anything wrong with that as a class extension, any help is much appreciated.

NB - Not sure if I've given you enough to diagnose the issue here, but I would have to put the whole system on otherwise, due to the way I integrated the class system into my creation system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions