Skip to content

Fix some rbs - #437

Merged
ydah merged 3 commits into
ruby:masterfrom
ydah:fix-rbs
Jun 9, 2024
Merged

ydah merged 3 commits into
ruby:masterfrom
ydah:fix-rbs

Conversation

@ydah

@ydah ydah commented Jun 7, 2024

Copy link
Copy Markdown
Member
  • Fix an indentation in sig/lrama/options.rbs
  • Fix rbs validate warning
    ❯ bundle exec rbs -I sig validate
    W, [2024-06-07T16:09:23.137310 #4825]  WARN -- rbs: sig/lrama/grammar.rbs:74:19...74:37: `void` type is only allowed in return type or generics parameter (RBS::WillSyntaxError)
          def validate!: () -> (void | bot)
                         ^^^^^^^^^^^^^^^^^^
    
  • Use void instead of bot?

ydah added 3 commits June 7, 2024 16:19
```
❯ bundle exec rbs -I sig validate
W, [2024-06-07T16:09:23.137310 #4825]  WARN -- rbs: sig/lrama/grammar.rbs:74:19...74:37: `void` type is only allowed in return type or generics parameter (RBS::WillSyntaxError)

      def validate!: () -> (void | bot)
                     ^^^^^^^^^^^^^^^^^^
```
The bot is used for methods that either always throw an exception or enter an infinite loop and never terminate. Therefore, I believe void is correct here.
Comment thread sig/lrama/grammar.rbs
def fill_symbols: () -> Array[Grammar::Symbol]
def fill_sym_to_rules: () -> Array[Rule]
def validate_rule_lhs_is_nterm!: () -> bot?
def validate_rule_lhs_is_nterm!: () -> void

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memo) The bot is used for methods that either always throw an exception or enter an infinite loop and never terminate. Therefore, I believe void is correct here.

@ydah
ydah merged commit 40781a9 into ruby:master Jun 9, 2024
@ydah
ydah deleted the fix-rbs branch June 13, 2024 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant