From ca8f48f34467d3ceb80cd8e63c03fd2d4816885e Mon Sep 17 00:00:00 2001 From: ksss Date: Tue, 12 Sep 2023 15:21:26 +0900 Subject: [PATCH] Base#file might potentially return `nil`. --- lib/yard/code_objects/base.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/yard/code_objects/base.rb b/lib/yard/code_objects/base.rb index 27b37e549..fed0957d3 100644 --- a/lib/yard/code_objects/base.rb +++ b/lib/yard/code_objects/base.rb @@ -303,6 +303,7 @@ def add_file(file, line = nil, has_comments = false) # definitions with docstrings first. # # @return [String] a filename + # @return [nil] if there is no file associated with the object def file @files.first ? @files.first[0] : nil end