Skip to content

Visibility state of method definitions is not inherited across fibers #6494

@dearblue

Description

@dearblue

I noticed a different behavior with commit ed00879 than with CRuby.

class A
  #private    # even if this comment section is enabled, the result is the same
  f = Fiber.new { def a; p "BAD!"; end }
  private
  f.resume
end

A.new.a
# (ruby34) => -:7:in '<main>': private method 'a' called for an instance of A (NoMethodError)
# (mruby)  => "BAD!"

I have tried to fix it a bit, but I think I may need to inherit from proc->e.env->flags as well, since I can't see the ci if it crosses over a terminated fiber.
However, I do not know how serious this problem is.
And I don't know if I can fix it right away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions