From 1921784d8087e6cc0d672ecd19e63adf40ece1d4 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 17 Sep 2023 18:40:29 +0900 Subject: [PATCH] doc: Add description for implicitly-returns-nil annotation refs: https://github.com/ruby/rbs/pull/1226 --- docs/syntax.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/syntax.md b/docs/syntax.md index d319c7549..350979e34 100644 --- a/docs/syntax.md +++ b/docs/syntax.md @@ -780,3 +780,8 @@ _annotation_ ::= `%a{` _annotation-text_ `}` # Annotation using {} _annotation-text_ ::= /[^\x00]*/ # Any characters except NUL (and parenthesis) ``` + +Supported annotations are: + +* `implicitly-returns-nil`: This annotation tells the method may return nil (ex. `Array#[]` and `Hash#[]`). + RBS itself doesn't do anything for this annotation. The type checkers may give precise types of the methods with the annotations.