Skip to content

Commit 961a359

Browse files
authored
Add note about generic type members named T (#9754)
Signed-off-by: Alexandre Terrasa <[email protected]>
1 parent 461778e commit 961a359

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

website/docs/rbs-support.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,8 @@ box = Box.new #: Box[Integer]
662662
box << 42
663663
```
664664
665+
> **Note**: do not name the type member `T` to avoid confusion with the [`T` module from Sorbet](https://github.com/sorbet/sorbet/blob/master/rbi/sorbet/t.rbi).
666+
665667
RBS generics do not use `T::Generic`, thus the `[]` method doesn't exist at runtime and Sorbet will report an error if you try to use it:
666668

667669
```ruby

0 commit comments

Comments
 (0)