Skip to content

Update string.rbs to avoid deprecation warning in Steep - #2654

Closed
soutaro wants to merge 26 commits into
masterfrom
deprecated
Closed

Update string.rbs to avoid deprecation warning in Steep#2654
soutaro wants to merge 26 commits into
masterfrom
deprecated

Conversation

@soutaro

@soutaro soutaro commented Sep 8, 2025

Copy link
Copy Markdown
Member

Both ::_ArefFromStringToString and String::encode_fallback are marked as deprecated, and referencing the interface from encode_fallback results in RBS::DeprecatedTypeName error in RBS file reported by Steep.

$ bundle exec steep check --no-type-check --validate=library
# Type checking files:

....................................................................................................................................................................................................F..............

core/string.rbs:3583:70: [warning] Type `::String::_ArefFromStringToString` is deprecated
│ Diagnostic ID: RBS::DeprecatedTypeName
│
└ type String::encode_fallback = Hash[String, String] | Proc | Method | String::_ArefFromStringToString
                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Detected 1 problem from 1 file

This warning doesn't make sense:

  1. String::encode_fallback itself is a deprecated, so using the type in user's code are already reported as a type error
  2. Users cannot silence the warning by changing Steep configuration

This PR changes the type definition to remove the warning.

soutaro and others added 26 commits March 24, 2025 10:00
`did_you_mean` is a default gem
Change `{}` to `{ 0 }`
Use erb instead of set for load path testing
Add `super` calls in `#setup` (3.9)
Allows the use of a path list as RBS_SKIP_TESTS
Allows the use of a path list as RBS_SKIP_TESTS
```
main.c: In function ‘Init_rbs_extension’:
main.c:24:3: warning: multi-line comment [-Wcomment]
   24 |   // grep -o 'INTERN("\([^"]*\)")' ext/rbs_extension/parser.c \
      |   ^
```
Suppress to GCC warning with multi-line comment
@soutaro soutaro modified the milestones: RBS 4.0, RBS 3.9.x Sep 8, 2025
@soutaro soutaro added this to the RBS 4.0 milestone Sep 8, 2025
@soutaro
soutaro changed the base branch from aaa-3.9.x to master September 8, 2025 08:07
@soutaro soutaro closed this Sep 8, 2025
@soutaro
soutaro deleted the deprecated branch September 8, 2025 08:09
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.

3 participants