Merge pull request #6530 from dearblue/visibility

This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-05-19 08:11:18 +09:00
committed by GitHub
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -764,7 +764,7 @@ find_visibility_scope(mrb_state *mrb, const struct RClass *c, int n, mrb_callinf
if (check_visibility_break(p, c, ci, NULL)) {
mrb_assert(ci->u.env);
*ep = NULL;
*ep = (ci->u.env->tt == MRB_TT_ENV ? ci->u.env : NULL);
*cp = ci;
return;
}
+10
View File
@@ -839,6 +839,16 @@ assert('method visibility with meta programming') do
f.call
c.new.bad!
end
assert_raise NoMethodError do
c = Class.new {
-> { private }.call
def bad!
"BAD!"
end
}
c.new.bad!
end
end
assert('Module#module_function') do