Issue #6287 has been reported by botp (bot pena).

----------------------------------------
Feature #6287: nested method should only be visible by nesting/enclosing method
https://bugs.ruby-lang.org/issues/6287

Author: botp (bot pena)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 2.0.0




> def test1
  def test2
    p "i am test2"
  end
  test2
  end

 
>  test1
  "i am test2"  # ok

>  test2   
  "i am test2"  # not ok (imho), this should fail; ie test2 should only be visible by test1, not by outside.





-- 
http://bugs.ruby-lang.org/