Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Constants defined under a payload alias (YAML = Psych) are emitted under the alias name, rejected by sorbet >= 0.6.13550

Abierto
#2,738 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
57/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
ruby
Área
tooling

Línea de trabajo

Start by reading Tapioca’s gem RBI generation path and how it resolves constant namespaces; the issue identifies the generated nested constant as the failing case. Reproduce with bundle exec tapioca gem yaml and bundle exec srb tc using the stated versions. Done means the generated RBI handles YAML::LOADER_VERSION without Sorbet error 4022 while the constant remains accessible as a String through YAML.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

Since sorbet 0.6.13550 (sorbet/sorbet#10758; related: sorbet/sorbet#10767 for the net-http counterpart), Sorbet rejects any definition nested under a payload constant alias. The yaml gem RBI that tapioca generates now fails srb tc:

sorbet/rbi/gems/[email protected]:9: Redefining constant `YAML` as a class or module https://srb.help/4022
    https://github.com/sorbet/sorbet/tree/b3a38a5fcb5cfeadd9031b3ddf513547f2c2f229/rbi/stdlib/yaml.rbi#L62: Previously defined as a static field here
    62 |YAML = Psych # :nodoc:
Reproduction
  • tapioca 0.20.0, sorbet 0.6.13550, Ruby 4.0.6, yaml 0.4.0 (a dependency of pagy)
  • bundle exec tapioca gem yaml generates:
# pkg:gem/yaml#lib/yaml.rb:69
YAML::LOADER_VERSION = T.let(T.unsafe(nil), String)
  • bundle exec srb tc reports the 4022 error above. Minimal case without tapioca: sorbet.run. sorbet 0.6.13544 accepts it.

The gem's lib/yaml.rb does YAML = Psych and later module YAML; LOADER_VERSION = "0.4.0"; end. At runtime YAML.equal?(Psych) is true, so the constant really lives on Psych.

Expected

When the namespace is an alias, tapioca should emit the constant under the alias target's real name (Psych::LOADER_VERSION = T.let(T.unsafe(nil), String)). Sorbet 0.6.13550 accepts that, and YAML::LOADER_VERSION still resolves to String. Alternatively, it could skip constants whose namespace is a payload alias.

Tapioca 0.20.0 already drops the module YAML; end line that older versions emitted. The same reasoning has to cover nested constants.

Lenguaje dominante
Ruby
Estrellas
874
Forks
166
Merge medio
5 d 12 h
PR fusionados (30 d)
11

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Shopify/tapioca

Todos los issues de Shopify/tapioca

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.