Skip to content

Commit 7cdcfe1

Browse files
committed
Remove nil from the return type of Module#name and instead add the %a{implicitly-returns-nil} annotation
Calling `Module#name` on an anonymous module or class is not a common use case, and I don’t see much benefit in always considering `nil`. Therefore, I believe using the `%a{implicitly-returns-nil}` annotation is appropriate.
1 parent e389107 commit 7cdcfe1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/module.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ class Module < Object
11641164
# -->
11651165
# Returns the name of the module *mod*. Returns `nil` for anonymous modules.
11661166
#
1167-
def name: () -> String?
1167+
def name: %a{implicitly-returns-nil} () -> String
11681168

11691169
# <!--
11701170
# rdoc-file=eval.c

0 commit comments

Comments
 (0)