Skip to content

Fix Sorbet RBI for Parser35 alias to Parser40#3821

Merged
Earlopain merged 1 commit into
ruby:mainfrom
p-linnane:fix-sorbet-parser35-alias
Dec 22, 2025
Merged

Fix Sorbet RBI for Parser35 alias to Parser40#3821
Earlopain merged 1 commit into
ruby:mainfrom
p-linnane:fix-sorbet-parser35-alias

Conversation

@p-linnane

Copy link
Copy Markdown
Contributor

Hello. I'm a maintainer for Homebrew. Our latest bundler Dependabot PR added Prism 1.7.0 to our Gemfile.lock. Running Sorbet identified an error related to aliasing Parser35 to Parser40 with the change from Ruby 3.5.0 to 4.0.0. This PR removes the class in favor of just an alias.

sorbet/rbi/gems/prism@1.7.0.rbi:15758: Cannot initialize the class `Parser35` by constant assignment https://srb.help/4022
       15758 |Prism::Translation::Parser35 = Prism::Translation::Parser40
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    sorbet/rbi/gems/prism@1.7.0.rbi:15759: Previously defined as a class here
       15759 |class Prism::Translation::Parser35 < Prism::Translation::Parser; end
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  Note:
    Sorbet does not allow treating constant assignments as class or module definitions,
    even if the initializer computes a `Module` object at runtime. See the docs for more.
Errors: 1

Signed-off-by: Patrick Linnane <patrick@linnane.io>

@Earlopain Earlopain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! We check sorbet in CI but unfortunatly this rule is disabled.

@Earlopain
Earlopain merged commit 4c79365 into ruby:main Dec 22, 2025
61 of 64 checks passed
@p-linnane
p-linnane deleted the fix-sorbet-parser35-alias branch December 22, 2025 16:53
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.

2 participants