First of all, thank you for starting this interesting project!
While testing various scenarios, I noticed that t-ruby currently does not support parsing and type-checking yield expressions and block type annotations.
For example....
I've written some abstract example code to illustrate the expected behavior. I would like to parse block types and the return values of yield expressions as shown here.
Currently, yield raises an error unless the return type is void, and it seems that block type annotations are not supported at all.
def hello_world: Integer
return calculate { |n| n + 3 }: Integer -> Integer
end
def calculate: Integer
yield(7)
end
Since this is a critical feature for Ruby's idiomatic block-based programming patterns, could you please take a look?
Current Status
I investigated the codebase and found
Partial Support
Missing Implementation
Questions
- Is block/yield support planned for a future milestone?
- Would you accept a PR implementing this feature?
- Should t-ruby follow RBS block syntax exactly, or define its own syntax?
First of all, thank you for starting this interesting project!
While testing various scenarios, I noticed that t-ruby currently does not support parsing and type-checking yield expressions and block type annotations.
For example....
I've written some abstract example code to illustrate the expected behavior. I would like to parse block types and the return values of yield expressions as shown here.
Currently, yield raises an error unless the return type is void, and it seems that block type annotations are not supported at all.
Since this is a critical feature for Ruby's idiomatic block-based programming patterns, could you please take a look?
Current Status
I investigated the codebase and found
Partial Support
yieldas a keyword token (scanner.rb:57)Missing Implementation
:yieldtokens in expression_parser.rb or statement_parser.rbYieldnode type defined in ir.rb{ (T) -> R })Questions