Skip to content

The tapioca-generated rbi shim for prism v1.7.0 results in sorbet errors #2454

@dduugg

Description

@dduugg

Using the latest tapioca and sorbet releases:

sorbet/rbi/gems/prism@1.7.0.rbi:20832: Cannot initialize the class Parser35 by constant assignment https://srb.help/4022
       20832 |Prism::Translation::Parser35 = Prism::Translation::Parser40
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    sorbet/rbi/gems/prism@1.7.0.rbi:20833: Previously defined as a class here
       20833 |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

Reproduced in a public repo here: dduugg/yard-sorbet#384

See: https://github.com/dduugg/yard-sorbet/actions/runs/20416294489/job/58660421072

(Reported in #tapioca in the sorbet slack, pasting here for ease of tracking & search)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions