Skip to content

Commit 091156c

Browse files
committed
Document a few details about class
Signed-off-by: Alexandre Terrasa <[email protected]>
1 parent c04a6b0 commit 091156c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/syntax.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ The following `class`/`instance` types are allowed.
289289
class Foo
290290
attr_reader parent: class
291291
292-
def foo: () -> instance
292+
def foo: () -> instance # behaves like `self` in this context
293+
294+
def self?.bar: () -> instance # behaves like `class` for `def self.bar()` and `self` for `def bar()`
293295
294296
@@foos: Array[instance]
295297

0 commit comments

Comments
 (0)