From fc625344431f9e7f4aa9ccb661e42f584421c171 Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Tue, 17 Dec 2024 14:00:56 -0500 Subject: [PATCH] Document a few details about `class` Signed-off-by: Alexandre Terrasa --- docs/syntax.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/syntax.md b/docs/syntax.md index 06f50bb7b..d081e9b15 100644 --- a/docs/syntax.md +++ b/docs/syntax.md @@ -289,7 +289,9 @@ The following `class`/`instance` types are allowed. class Foo attr_reader parent: class - def foo: () -> instance + def foo: () -> instance # behaves like `self` in this context + + def self?.bar: () -> instance # behaves like `class` for `def self.bar()` and `self` for `def bar()` @@foos: Array[instance]