Skip to content

Commit

Permalink
Add includeClassNew() for include module feature
Browse files Browse the repository at this point in the history
  • Loading branch information
elct9620 committed Aug 28, 2024
1 parent 9f96a5d commit 28204ba
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions class.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ func (mrb *State) prepareSingletonClass(obj RObject) error {
return nil
}

func (mrb *State) includeClassNew(module, super RClass) RClass {
ic := mrb.AllocClass()

return ic
}

func (mrb *State) includeModuleAt(class, insPos, module RClass, searchSuper bool) int {
for module != nil {
parentClass := class.Super()
Expand All @@ -192,6 +198,12 @@ func (mrb *State) includeModuleAt(class, insPos, module RClass, searchSuper bool

parentClass = parentClass.Super()
}

{
ic := mrb.includeClassNew(module, insPos.Super())
insPos.setSuper(ic)
insPos = ic
}
Skip:
module = module.Super()
}
Expand Down

0 comments on commit 28204ba

Please sign in to comment.