From 854758c464e6cdba06eed5d05b7fe10c33788c89 Mon Sep 17 00:00:00 2001 From: drbrain Date: Thu, 6 Dec 2012 06:20:50 +0000 Subject: * lib/rdoc/context.rb: Don't warn for duplicate methods while loading. * test/rdoc/test_rdoc_context.rb: Test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/context.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/rdoc/context.rb') diff --git a/lib/rdoc/context.rb b/lib/rdoc/context.rb index 6f9deae4a8..22339bf1c7 100644 --- a/lib/rdoc/context.rb +++ b/lib/rdoc/context.rb @@ -447,11 +447,13 @@ class RDoc::Context < RDoc::CodeObject known = @methods_hash[key] if known then - known.comment = method.comment if known.comment.empty? - previously = ", previously in #{known.file}" unless - method.file == known.file - @store.rdoc.options.warn \ - "Duplicate method #{known.full_name} in #{method.file}#{previously}" + if @store then # otherwise we are loading + known.comment = method.comment if known.comment.empty? + previously = ", previously in #{known.file}" unless + method.file == known.file + @store.rdoc.options.warn \ + "Duplicate method #{known.full_name} in #{method.file}#{previously}" + end else @methods_hash[key] = method method.visibility = @visibility -- cgit v1.2.3