Skip to content

[Question]Add support for yield and block type annotations #34

Open

Description

@kimdj2

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

  1. Is block/yield support planned for a future milestone?
  2. Would you accept a PR implementing this feature?
  3. Should t-ruby follow RBS block syntax exactly, or define its own syntax?

Activity

  1. changed the title [-]Add support for yield and block type annotations[/-] [+][Question]Add support for yield and block type annotations[/+] on Dec 31, 2025
  2. added a commit that references this issue on Jan 15, 2026
    d552e1e
  3. yhk1038 commented on Jan 17, 2026

    @yhk1038
    Contributor

    Hi, @dfl.
    Thank you for supporting.

    Please send PR for your commits.
    Then we can talk about that on comments thread.
    And also, I'll put your pr into project#1

    It's ok your pr is not completed, i can stand until it could be done.

    Thank you.

  4. moved this from Backlog to In progress in T-Ruby Roadmapon Jan 17, 2026
  5. added this to the v0.0.5 milestone on Jan 17, 2026
  6. yhk1038 commented on Jan 19, 2026

    @yhk1038
    Contributor

    It has been developed by PR #39 #38 .
    And discussion is on going at #41 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededsuggestionIdeas, proposals, and feature suggestions

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions