Preparing for Ruby inline type signatures
There is a gem called rbs-inline that is exploring the idea of putting RBS inline in the source code instead of separate files.
Andrey Eremin shared this first, and I just wanted to share it further with some extra screenshots.Â
Here is an example from the gem repo (syntax is experimental):
The most important part is in the description of this gem, where it seems the plan is to experiment with inline RBS and then merge it to the RBS gem so we can have direct support for inline type signatures instead of only supporting separated files.
Using Sorbet for a while, I started to appreciate the following idea:Â
If I need type signatures, I would like to have them in the same file with code instead of separated files. This makes it easier to develop a habit of writing and maintain the signatures.Â