diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-01-07 19:44:14 +0900 |
---|---|---|
committer | git <[email protected]> | 2024-01-07 11:39:45 +0000 |
commit | 2325b72cf3f14448603a97024c112d8dde159f5a (patch) | |
tree | 7ea1bce0ade4f25473cd927415118782af3dfa21 /lib/rdoc/parser | |
parent | 83c98ead4e889710916a367c146884c987576e8b (diff) |
[ruby/rdoc] Singleton method visibility should be isolated
Each singleton method definition of the form `def recv.method` has
visibility separate from the outer scope and is set to `public` by
default.
https://github.com/ruby/rdoc/commit/810913a7ea
Diffstat (limited to 'lib/rdoc/parser')
-rw-r--r-- | lib/rdoc/parser/ruby.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb index 39c3bae4c4..aab91e0790 100644 --- a/lib/rdoc/parser/ruby.rb +++ b/lib/rdoc/parser/ruby.rb @@ -1453,6 +1453,12 @@ class RDoc::Parser::Ruby < RDoc::Parser meth = RDoc::AnyMethod.new get_tkread, name look_for_directives_in meth, comment meth.singleton = single == SINGLE ? true : singleton + if singleton + # `current_line_visibility' is useless because it works against + # the normal method named as same as the singleton method, after + # the latter was defined. Of course these are different things. + container.current_line_visibility = :public + end record_location meth meth.line = line_no |