You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
private/public/module_function without arguments, called on another module from a block, change the caller's visibility #133
private, public and module_function with no arguments, called with an explicit receiver (or through send) from a block inside a method, change the default visibility of the calling method's scope instead of nothing:
moduleM;endclassC;deffoo;1.times{M.send:module_function};defyyy;end;end;endC.new.foopC.public_instance_methods(false).sort# CRuby: [:foo, :yyy]# IronRuby: TypeError: A module function cannot be defined on a class.
The visibility mode belongs to the receiver's own scope (here M's body, which isn't running), so CRuby changes nothing visible. IronRuby seems to apply it to the innermost Ruby scope of the caller.
Found by running the scripts PR #119 deleted (Tests/Experiments, Tests/Legacy) on CRuby 4.0.9 and on IronRuby built from master c7f70cf (net10.0, Linux). (Experiments/Methods/Visibility/s.rb, flags.rb)
Activity
Merge pull request #147 from Largo/claude/core-fixes-from-old-tests