Skip to content

Add %a{pure} to Array#[] and Hash#[] - #3186

Open
ksss wants to merge 1 commit into
ruby:masterfrom
ksss:array-hash-aref-pure
Open

ksss wants to merge 1 commit into
ruby:masterfrom
ksss:array-hash-aref-pure

Conversation

@ksss

@ksss ksss commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Steep has treated Array#[] and Hash#[] as pure methods since v1.1.0 (soutaro/steep#600), by hard-coding them in KNOWN_PURE_METHODS.

https://github.com/soutaro/steep/blob/605de278/lib/steep/type_construction.rb#L3249-L3252

This PR writes that behavior down in the signatures with %a{pure}, so the fact is visible from RBS and available to other tools as well.

There is no behavior change for Steep users.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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