summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-01-24 09:46:34 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-01-24 09:46:34 +0900
commit6b86549df8f6d48eeab3c7b48b3fd9ee02f744ba (patch)
tree69b8410e2d75722346eef5bd1d2adcff92d06fea /object.c
parentf8a8f055123bc81fc13fa295b936504196df0da4 (diff)
[DOC] fixed line numbers [ci skip]
Fix up the example of const_source_location at 2bde7919a0a8302c344e9bb9ddc217958fcbd3c7.
Diffstat (limited to 'object.c')
-rw-r--r--object.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/object.c b/object.c
index 8acb80c35e..e15b17fa00 100644
--- a/object.c
+++ b/object.c
@@ -2771,16 +2771,16 @@ rb_mod_const_defined(int argc, VALUE *argv, VALUE mod)
* by default).
*
* # test.rb:
- * class A
+ * class A # line 1
* C1 = 1
* C2 = 2
* end
*
- * module M
+ * module M # line 6
* C3 = 3
* end
*
- * class B < A
+ * class B < A # line 10
* include M
* C4 = 4
* end
@@ -2789,15 +2789,15 @@ rb_mod_const_defined(int argc, VALUE *argv, VALUE mod)
* C2 = 8 # constant redefinition; warned yet allowed
* end
*
- * p B.const_source_location('C4') # => ["test.rb", 11]
- * p B.const_source_location('C3') # => ["test.rb", 6]
+ * p B.const_source_location('C4') # => ["test.rb", 12]
+ * p B.const_source_location('C3') # => ["test.rb", 7]
* p B.const_source_location('C1') # => ["test.rb", 2]
*
* p B.const_source_location('C3', false) # => nil -- don't lookup in ancestors
*
* p A.const_source_location('C2') # => ["test.rb", 16] -- actual (last) definition place
*
- * p Object.const_source_location('B') # => ["test.rb", 9] -- top-level constant could be looked through Object
+ * p Object.const_source_location('B') # => ["test.rb", 10] -- top-level constant could be looked through Object
* p Object.const_source_location('A') # => ["test.rb", 1] -- class reopening is NOT considered new definition
*
* p B.const_source_location('A') # => ["test.rb", 1] -- because Object is in ancestors