Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type for Enumerator::Chain #2220

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ParadoxV5
Copy link
Contributor

No description provided.

@ParadoxV5 ParadoxV5 marked this pull request as ready for review January 2, 2025 05:35
@ParadoxV5 ParadoxV5 changed the title Add type for Enumerator::Chain::new Add type for Enumerator::Chain Jan 8, 2025
@@ -612,19 +612,24 @@ end
#
# This type of objects can be created by Enumerable#chain and Enumerator#+.
#
class Enumerator::Chain[out Elem] < Enumerator[Elem, void]
include Enumerable[Elem]
class Enumerator::Chain[out Elem] < Enumerator[Elem, void] # Rubocop: `self` type is not allowed in this context
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why isn’t it allowed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, rake annotate deletes this comment.

Comment on lines +632 to +649
# wrong argument type chain (expected enumerator) (TypeError)
def with_index: (?Integer) ?{ (?) -> untyped } -> bot
def each_with_index: () ?{ (?) -> untyped } -> bot
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ruby bug?

@ParadoxV5
Copy link
Contributor Author

CI:

⚠️⚠️⚠️ src/constants.c is older than templates/src/constants.c.erb. You may need to run `rake templates` ⚠️⚠️⚠️
⚠️⚠️⚠️ src/ruby_objs.c is older than templates/src/ruby_objs.c.erb. You may need to run `rake templates` ⚠️⚠️⚠️

Local:

$ rake templates
/usr/local/bin/ruby templates/template.rb include/rbs/constants.h
/usr/local/bin/ruby templates/template.rb include/rbs/ruby_objs.h
/usr/local/bin/ruby templates/template.rb src/constants.c
/usr/local/bin/ruby templates/template.rb src/ruby_objs.c
$ git diff
$ echo $?
0

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

Successfully merging this pull request may close these issues.

1 participant