Skip to content

Remove call to Any#todo! from C parser#2249

Merged
soutaro merged 4 commits intoruby:masterfrom
Shopify:at-remove-todo-call
Jan 28, 2025
Merged

Remove call to Any#todo! from C parser#2249
soutaro merged 4 commits intoruby:masterfrom
Shopify:at-remove-todo-call

Conversation

@Morriar
Copy link
Contributor

@Morriar Morriar commented Jan 21, 2025

As we're trying to detangle the C parser implementation from Ruby, the call to Any#todo! is problematic.

Instead we can store a flag in the C structure and move this call to the Ruby implementation during the object initialization.

lib/rbs/types.rb Outdated
@string || "untyped"
end

private
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The private here is not required for the change to work but todo! shouldn't be called from clients.

This will impact the public API, maybe we should make a deprecation first?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, can you keep the method and print a deprecation message?

class Any < Base
@string: String?

def initialize: (location: Location[bot, bot]?, ?todo: bool) -> void
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

Looks good. The requested change is to keep the #todo! method public with deprecation.

@soutaro soutaro added this to the RBS 3.9 milestone Jan 24, 2025
@Morriar Morriar force-pushed the at-remove-todo-call branch from d8b95cb to b1656db Compare January 24, 2025 15:00
@Morriar Morriar requested a review from soutaro January 24, 2025 15:00
@Morriar
Copy link
Contributor Author

Morriar commented Jan 24, 2025

I removed the private, added a deprecation comment in the Ruby file and a deprecation annotation in the RBS file 👍

Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar force-pushed the at-remove-todo-call branch from b1656db to 8b80ea8 Compare January 27, 2025 18:52
Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

👍

@soutaro soutaro added this pull request to the merge queue Jan 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 28, 2025
@soutaro soutaro added this pull request to the merge queue Jan 28, 2025
Merged via the queue into ruby:master with commit d70b6ee Jan 28, 2025
19 checks passed
@Morriar Morriar deleted the at-remove-todo-call branch January 28, 2025 14:13
@soutaro soutaro added the Released PRs already included in the released version label Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Released PRs already included in the released version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants